hooks/script-wrapper: sdl2-config and libpng-config wrappers; enabled in build phase too.

This commit is contained in:
Juan RP 2014-05-23 09:58:45 +02:00
parent b0809bdc96
commit ff4663480e

View file

@ -8,12 +8,31 @@ WRAPPERDIR="${wrksrc}/.xbps/bin"
generic_wrapper() {
local wrapper="$1"
[ ! -x ${XBPS_CROSS_BASE}/usr/bin/${wrapper} ] && return 0
[ -x ${WRAPPERDIR}/${wrapper} ] && return 0
echo "#!/bin/sh" >> ${WRAPPERDIR}/${wrapper}
echo "exec ${XBPS_CROSS_BASE}/usr/bin/${wrapper} --prefix=${XBPS_CROSS_BASE}/usr \"\$@\"" >> ${WRAPPERDIR}/${wrapper}
chmod 755 ${WRAPPERDIR}/${wrapper}
}
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
}
hook() {
[ -z "$CROSS_BUILD" ] && return 0
@ -24,6 +43,8 @@ hook() {
generic_wrapper libgcrypt-config
generic_wrapper freetype-config
generic_wrapper sdl-config
generic_wrapper sdl2-config
libpng_config_wrapper
export PATH=${WRAPPERDIR}:$PATH
}