2014-05-12 21:14:23 +02: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.
|
|
|
|
|
2014-05-13 10:42:47 +02:00
|
|
|
generic_wrapper() {
|
|
|
|
local wrapper="$1"
|
|
|
|
[ ! -x ${XBPS_CROSS_BASE}/usr/bin/${wrapper} ] && return 0
|
2014-12-19 10:54:48 +01:00
|
|
|
[ -x ${XBPS_WRAPPERDIR}/${wrapper} ] && return 0
|
2014-05-12 21:14:23 +02:00
|
|
|
|
2014-12-19 10:54:48 +01:00
|
|
|
echo "#!/bin/sh" >> ${XBPS_WRAPPERDIR}/${wrapper}
|
|
|
|
echo "exec ${XBPS_CROSS_BASE}/usr/bin/${wrapper} --prefix=${XBPS_CROSS_BASE}/usr \"\$@\"" >> ${XBPS_WRAPPERDIR}/${wrapper}
|
|
|
|
chmod 755 ${XBPS_WRAPPERDIR}/${wrapper}
|
2014-05-13 08:27:38 +02:00
|
|
|
}
|
|
|
|
|
2014-06-05 01:10:08 +02:00
|
|
|
generic_wrapper2() {
|
2014-06-16 13:35:29 +02:00
|
|
|
local wrapper="$1"
|
2014-05-23 09:58:45 +02:00
|
|
|
|
2014-06-05 01:10:08 +02:00
|
|
|
[ ! -x ${XBPS_CROSS_BASE}/usr/bin/${wrapper} ] && return 0
|
2014-12-19 10:54:48 +01:00
|
|
|
[ -x ${XBPS_WRAPPERDIR}/${wrapper} ] && return 0
|
2014-06-05 01:10:08 +02:00
|
|
|
|
2014-12-19 10:54:48 +01:00
|
|
|
cat >>${XBPS_WRAPPERDIR}/${wrapper}<<_EOF
|
2014-05-23 09:58:45 +02:00
|
|
|
#!/bin/sh
|
|
|
|
if [ "\$1" = "--prefix" ]; then
|
|
|
|
echo "${XBPS_CROSS_BASE}/usr"
|
|
|
|
elif [ "\$1" = "--cflags" ]; then
|
2014-06-05 01:10:08 +02: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 09:58:45 +02:00
|
|
|
else
|
2014-06-05 01:10:08 +02:00
|
|
|
exec ${XBPS_CROSS_BASE}/usr/bin/${wrapper} "\$@"
|
2014-05-23 09:58:45 +02:00
|
|
|
fi
|
|
|
|
exit \$?
|
|
|
|
_EOF
|
2014-12-19 10:54:48 +01:00
|
|
|
chmod 755 ${XBPS_WRAPPERDIR}/${wrapper}
|
2014-05-23 09:58:45 +02:00
|
|
|
}
|
|
|
|
|
2014-06-25 09:29:25 +02:00
|
|
|
generic_wrapper3() {
|
|
|
|
local wrapper="$1"
|
|
|
|
[ ! -x ${XBPS_CROSS_BASE}/usr/bin/${wrapper} ] && return 0
|
2014-12-19 10:54:48 +01:00
|
|
|
[ -x ${XBPS_WRAPPERDIR}/${wrapper} ] && return 0
|
2014-06-25 09:29:25 +02:00
|
|
|
|
2014-12-19 10:54:48 +01:00
|
|
|
cp ${XBPS_CROSS_BASE}/usr/bin/${wrapper} ${XBPS_WRAPPERDIR}
|
|
|
|
sed -e "s,/usr/include,${XBPS_CROSS_BASE}/usr/include,g" -i ${XBPS_WRAPPERDIR}/${wrapper}
|
|
|
|
sed -e "s,libdir=/usr/lib,libdir=${XBPS_CROSS_BASE}/usr/lib,g" -i ${XBPS_WRAPPERDIR}/${wrapper}
|
|
|
|
sed -e "s,^prefix=/usr,prefix=${XBPS_CROSS_BASE}/usr," -i ${XBPS_WRAPPERDIR}/${wrapper}
|
2014-09-28 07:47:14 +02:00
|
|
|
|
2014-12-19 10:54:48 +01:00
|
|
|
chmod 755 ${XBPS_WRAPPERDIR}/${wrapper}
|
2014-06-25 09:29:25 +02:00
|
|
|
}
|
|
|
|
|
2014-06-19 13:11:40 +02:00
|
|
|
python_wrapper() {
|
|
|
|
local wrapper="$1" version="$2"
|
|
|
|
|
2014-12-19 10:54:48 +01:00
|
|
|
[ -x ${XBPS_WRAPPERDIR}/${wrapper} ] && return 0
|
|
|
|
cat >>${XBPS_WRAPPERDIR}/${wrapper}<<_EOF
|
2014-06-19 13:11:40 +02:00
|
|
|
#!/bin/sh
|
|
|
|
if [ "\$1" = "--includes" ]; then
|
|
|
|
echo "-I${XBPS_CROSS_BASE}/usr/include/python${version}"
|
|
|
|
fi
|
2014-12-19 11:01:15 +01:00
|
|
|
exit \$?
|
2014-06-19 13:11:40 +02:00
|
|
|
_EOF
|
2014-12-19 10:54:48 +01:00
|
|
|
chmod 755 ${XBPS_WRAPPERDIR}/${wrapper}
|
2014-06-19 13:11:40 +02:00
|
|
|
}
|
|
|
|
|
2014-09-25 14:37:06 +02:00
|
|
|
pkgconfig_wrapper() {
|
|
|
|
if [ ! -x /usr/bin/pkg-config ]; then
|
|
|
|
return 0
|
|
|
|
fi
|
2014-12-19 10:54:48 +01:00
|
|
|
[ -x ${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-pkg-config ] && return 0
|
|
|
|
cat >>${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-pkg-config<<_EOF
|
2014-09-25 14:37:06 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
export PKG_CONFIG_SYSROOT_DIR="$XBPS_CROSS_BASE"
|
|
|
|
export PKG_CONFIG_PATH="$XBPS_CROSS_BASE/lib/pkgconfig:$XBPS_CROSS_BASE/usr/share/pkgconfig"
|
|
|
|
export PKG_CONFIG_LIBDIR="$XBPS_CROSS_BASE/lib/pkgconfig"
|
|
|
|
exec /usr/bin/pkg-config "\$@"
|
|
|
|
_EOF
|
2014-12-19 10:54:48 +01:00
|
|
|
chmod 755 ${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-pkg-config
|
|
|
|
ln -sf ${XBPS_CROSS_TRIPLET}-pkg-config ${XBPS_WRAPPERDIR}/pkg-config
|
2014-09-25 14:37:06 +02:00
|
|
|
}
|
|
|
|
|
2014-05-12 21:14:23 +02:00
|
|
|
hook() {
|
|
|
|
[ -z "$CROSS_BUILD" ] && return 0
|
|
|
|
|
|
|
|
# create wrapers
|
2014-09-25 14:37:06 +02:00
|
|
|
pkgconfig_wrapper
|
2014-05-13 10:42:47 +02:00
|
|
|
generic_wrapper icu-config
|
|
|
|
generic_wrapper libgcrypt-config
|
|
|
|
generic_wrapper freetype-config
|
2014-05-13 11:14:07 +02:00
|
|
|
generic_wrapper sdl-config
|
2014-05-23 09:58:45 +02:00
|
|
|
generic_wrapper sdl2-config
|
2014-06-04 13:43:17 +02:00
|
|
|
generic_wrapper gpgme-config
|
2014-06-22 09:49:41 +02:00
|
|
|
generic_wrapper imlib2-config
|
2014-10-12 09:16:02 +02:00
|
|
|
generic_wrapper libmikmod-config
|
2014-06-25 09:01:51 +02:00
|
|
|
generic_wrapper2 curl-config
|
2014-06-16 13:35:29 +02:00
|
|
|
generic_wrapper2 gpg-error-config
|
|
|
|
generic_wrapper2 libpng-config
|
|
|
|
generic_wrapper2 ncurses5-config
|
2014-11-16 19:59:50 +01:00
|
|
|
generic_wrapper2 ncursesw5-config
|
2014-06-25 09:29:25 +02:00
|
|
|
generic_wrapper3 xmlrpc-c-config
|
2014-06-26 10:02:15 +02:00
|
|
|
generic_wrapper3 krb5-config
|
|
|
|
generic_wrapper3 mysql_config
|
2014-06-26 10:07:59 +02:00
|
|
|
generic_wrapper3 taglib-config
|
2014-07-22 08:51:27 +02:00
|
|
|
generic_wrapper3 cups-config
|
2014-07-25 19:17:26 +02:00
|
|
|
generic_wrapper3 Magick-config
|
2014-11-16 08:48:38 +01:00
|
|
|
generic_wrapper3 fltk-config
|
2014-11-19 07:31:30 +01:00
|
|
|
generic_wrapper3 xslt-config
|
|
|
|
generic_wrapper3 xml2-config
|
2014-06-19 13:11:40 +02:00
|
|
|
python_wrapper python-config 2.7
|
2014-06-20 11:05:00 +02:00
|
|
|
python_wrapper python3.4-config 3.4m
|
2014-12-19 11:01:15 +01:00
|
|
|
|
|
|
|
export PATH="$XBPS_WRAPPERDIR:$PATH"
|
2014-05-12 21:14:23 +02:00
|
|
|
}
|