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.
|
|
|
|
|
|
|
|
WRAPPERDIR="${wrksrc}/.xbps/bin"
|
|
|
|
|
2014-05-13 10:42:47 +02:00
|
|
|
generic_wrapper() {
|
|
|
|
local wrapper="$1"
|
|
|
|
[ ! -x ${XBPS_CROSS_BASE}/usr/bin/${wrapper} ] && return 0
|
2014-05-23 09:58:45 +02:00
|
|
|
[ -x ${WRAPPERDIR}/${wrapper} ] && return 0
|
2014-05-12 21:14:23 +02:00
|
|
|
|
2014-05-13 10:42:47 +02: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 08:27:38 +02:00
|
|
|
}
|
|
|
|
|
2014-05-23 09:58:45 +02:00
|
|
|
libpng_config_wrapper() {
|
|
|
|
[ ! -x ${XBPS_CROSS_BASE}/usr/bin/libpng-config ] && return 0
|
|
|
|
[ -x ${WRAPPERDIR}/libpng-config ] && return 0
|
|
|
|
|
|
|
|
cat >>${WRAPPERDIR}/libpng-config<<_EOF
|
|
|
|
#!/bin/sh
|
|
|
|
if [ "\$1" = "--prefix" ]; then
|
|
|
|
echo "${XBPS_CROSS_BASE}/usr"
|
|
|
|
elif [ "\$1" = "--cflags" ]; then
|
|
|
|
echo "-I${XBPS_CROSS_BASE}/usr/include/libpng16"
|
|
|
|
else
|
|
|
|
echo "exec ${XBPS_CROSS_BASE}/usr/bin/libpng-config "\$@"
|
|
|
|
fi
|
|
|
|
exit \$?
|
|
|
|
_EOF
|
|
|
|
chmod 755 ${WRAPPERDIR}/libpng-config
|
|
|
|
}
|
|
|
|
|
2014-05-12 21:14:23 +02:00
|
|
|
hook() {
|
|
|
|
[ -z "$CROSS_BUILD" ] && return 0
|
|
|
|
|
|
|
|
mkdir -p ${WRAPPERDIR}
|
|
|
|
|
|
|
|
# create wrapers
|
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
|
|
|
|
libpng_config_wrapper
|
2014-05-12 21:14:23 +02:00
|
|
|
|
|
|
|
export PATH=${WRAPPERDIR}:$PATH
|
|
|
|
}
|