2014-05-12 19:14:23 +00:00
|
|
|
# This hook creates wrappers for foo-config scripts in cross builds.
|
|
|
|
#
|
|
|
|
# Wrappers are created in ${wrksrc}/.xbps/bin and this path is appended
|
|
|
|
# to make configure scripts find them.
|
|
|
|
|
|
|
|
WRAPPERDIR="${wrksrc}/.xbps/bin"
|
|
|
|
|
2014-05-13 08:42:47 +00:00
|
|
|
generic_wrapper() {
|
|
|
|
local wrapper="$1"
|
|
|
|
[ ! -x ${XBPS_CROSS_BASE}/usr/bin/${wrapper} ] && return 0
|
2014-05-23 07:58:45 +00:00
|
|
|
[ -x ${WRAPPERDIR}/${wrapper} ] && return 0
|
2014-05-12 19:14:23 +00:00
|
|
|
|
2014-05-13 08:42:47 +00:00
|
|
|
echo "#!/bin/sh" >> ${WRAPPERDIR}/${wrapper}
|
|
|
|
echo "exec ${XBPS_CROSS_BASE}/usr/bin/${wrapper} --prefix=${XBPS_CROSS_BASE}/usr \"\$@\"" >> ${WRAPPERDIR}/${wrapper}
|
|
|
|
chmod 755 ${WRAPPERDIR}/${wrapper}
|
2014-05-13 06:27:38 +00:00
|
|
|
}
|
|
|
|
|
2014-06-04 23:10:08 +00:00
|
|
|
generic_wrapper2() {
|
2014-06-16 11:35:29 +00:00
|
|
|
local wrapper="$1"
|
2014-05-23 07:58:45 +00:00
|
|
|
|
2014-06-04 23:10:08 +00:00
|
|
|
[ ! -x ${XBPS_CROSS_BASE}/usr/bin/${wrapper} ] && return 0
|
|
|
|
[ -x ${WRAPPERDIR}/${wrapper} ] && return 0
|
|
|
|
|
|
|
|
cat >>${WRAPPERDIR}/${wrapper}<<_EOF
|
2014-05-23 07:58:45 +00:00
|
|
|
#!/bin/sh
|
|
|
|
if [ "\$1" = "--prefix" ]; then
|
|
|
|
echo "${XBPS_CROSS_BASE}/usr"
|
|
|
|
elif [ "\$1" = "--cflags" ]; then
|
2014-06-04 23:10:08 +00:00
|
|
|
${XBPS_CROSS_BASE}/usr/bin/${wrapper} --libs | sed -e "s,-I/usr,-I${XBPS_CROSS_BASE}/usr,g;s,-L/usr,-L${XBPS_CROSS_BASE}/usr,g"
|
|
|
|
elif [ "\$1" = "--libs" ]; then
|
|
|
|
${XBPS_CROSS_BASE}/usr/bin/${wrapper} --libs | sed -e "s,-L/usr,-L${XBPS_CROSS_BASE}/usr,g"
|
2014-05-23 07:58:45 +00:00
|
|
|
else
|
2014-06-04 23:10:08 +00:00
|
|
|
exec ${XBPS_CROSS_BASE}/usr/bin/${wrapper} "\$@"
|
2014-05-23 07:58:45 +00:00
|
|
|
fi
|
|
|
|
exit \$?
|
|
|
|
_EOF
|
2014-06-04 23:10:08 +00:00
|
|
|
chmod 755 ${WRAPPERDIR}/${wrapper}
|
2014-05-23 07:58:45 +00:00
|
|
|
}
|
|
|
|
|
2014-06-19 11:11:40 +00:00
|
|
|
python_wrapper() {
|
|
|
|
local wrapper="$1" version="$2"
|
|
|
|
|
|
|
|
cat >>${WRAPPERDIR}/${wrapper}<<_EOF
|
|
|
|
#!/bin/sh
|
|
|
|
if [ "\$1" = "--includes" ]; then
|
|
|
|
echo "-I${XBPS_CROSS_BASE}/usr/include/python${version}"
|
|
|
|
fi
|
|
|
|
exit $?
|
|
|
|
_EOF
|
|
|
|
chmod 755 ${WRAPPERDIR}/${wrapper}
|
|
|
|
}
|
|
|
|
|
2014-05-12 19:14:23 +00:00
|
|
|
hook() {
|
|
|
|
[ -z "$CROSS_BUILD" ] && return 0
|
|
|
|
|
|
|
|
mkdir -p ${WRAPPERDIR}
|
|
|
|
|
|
|
|
# create wrapers
|
2014-05-13 08:42:47 +00:00
|
|
|
generic_wrapper icu-config
|
|
|
|
generic_wrapper libgcrypt-config
|
|
|
|
generic_wrapper freetype-config
|
2014-05-13 09:14:07 +00:00
|
|
|
generic_wrapper sdl-config
|
2014-05-23 07:58:45 +00:00
|
|
|
generic_wrapper sdl2-config
|
2014-06-04 11:43:17 +00:00
|
|
|
generic_wrapper gpgme-config
|
2014-06-22 07:49:41 +00:00
|
|
|
generic_wrapper imlib2-config
|
2014-06-25 05:36:21 +00:00
|
|
|
generic_wrapper cups-config
|
2014-06-25 06:54:41 +00:00
|
|
|
generic_wrapper xml2-config
|
2014-06-16 11:35:29 +00:00
|
|
|
generic_wrapper2 gpg-error-config
|
|
|
|
generic_wrapper2 libpng-config
|
|
|
|
generic_wrapper2 ncurses5-config
|
2014-06-19 11:11:40 +00:00
|
|
|
python_wrapper python-config 2.7
|
2014-06-20 09:05:00 +00:00
|
|
|
python_wrapper python3.4-config 3.4m
|
2014-05-12 19:14:23 +00:00
|
|
|
|
|
|
|
export PATH=${WRAPPERDIR}:$PATH
|
|
|
|
}
|