hooks/pre-configure: new hook to generate foo-config wrappers in cross builds.
Script wrappers are created in ${wrksrc}/.xbps/bin and this path is appended to make the configure scripts detect them. This avoids adding build deps in hostmakedepends, as well as avoiding modifying templates to specify the path to the script. Currently this only creates a wrapper for "icu-config", but can be extended easily to create more wrappers (freetype, libxml, etc).
This commit is contained in:
parent
8d91bdb5ac
commit
fac0d115bc
1 changed files with 25 additions and 0 deletions
25
common/hooks/pre-configure/02-script-wrapper.sh
Normal file
25
common/hooks/pre-configure/02-script-wrapper.sh
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
# 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"
|
||||||
|
|
||||||
|
icu_config_wrapper() {
|
||||||
|
[ ! -x ${XBPS_CROSS_BASE}/usr/bin/icu-config ] && return 0
|
||||||
|
|
||||||
|
echo "#!/bin/sh" >> ${WRAPPERDIR}/icu-config
|
||||||
|
echo "exec ${XBPS_CROSS_BASE}/usr/bin/icu-config --prefix=${XBPS_CROSS_BASE}/usr \"\$@\"" >> ${WRAPPERDIR}/icu-config
|
||||||
|
chmod 755 ${WRAPPERDIR}/icu-config
|
||||||
|
}
|
||||||
|
|
||||||
|
hook() {
|
||||||
|
[ -z "$CROSS_BUILD" ] && return 0
|
||||||
|
|
||||||
|
mkdir -p ${WRAPPERDIR}
|
||||||
|
|
||||||
|
# create wrapers
|
||||||
|
icu_config_wrapper
|
||||||
|
|
||||||
|
export PATH=${WRAPPERDIR}:$PATH
|
||||||
|
}
|
Loading…
Reference in a new issue