hooks/script-wrapper: use XBPS_WRAPPERDIR.
This commit is contained in:
parent
f1bb0a6d81
commit
9b3c55b8a3
1 changed files with 20 additions and 26 deletions
|
@ -3,25 +3,23 @@
|
||||||
# Wrappers are created in ${wrksrc}/.xbps/bin and this path is appended
|
# Wrappers are created in ${wrksrc}/.xbps/bin and this path is appended
|
||||||
# to make configure scripts find them.
|
# to make configure scripts find them.
|
||||||
|
|
||||||
WRAPPERDIR="${wrksrc}/.xbps/bin"
|
|
||||||
|
|
||||||
generic_wrapper() {
|
generic_wrapper() {
|
||||||
local wrapper="$1"
|
local wrapper="$1"
|
||||||
[ ! -x ${XBPS_CROSS_BASE}/usr/bin/${wrapper} ] && return 0
|
[ ! -x ${XBPS_CROSS_BASE}/usr/bin/${wrapper} ] && return 0
|
||||||
[ -x ${WRAPPERDIR}/${wrapper} ] && return 0
|
[ -x ${XBPS_WRAPPERDIR}/${wrapper} ] && return 0
|
||||||
|
|
||||||
echo "#!/bin/sh" >> ${WRAPPERDIR}/${wrapper}
|
echo "#!/bin/sh" >> ${XBPS_WRAPPERDIR}/${wrapper}
|
||||||
echo "exec ${XBPS_CROSS_BASE}/usr/bin/${wrapper} --prefix=${XBPS_CROSS_BASE}/usr \"\$@\"" >> ${WRAPPERDIR}/${wrapper}
|
echo "exec ${XBPS_CROSS_BASE}/usr/bin/${wrapper} --prefix=${XBPS_CROSS_BASE}/usr \"\$@\"" >> ${XBPS_WRAPPERDIR}/${wrapper}
|
||||||
chmod 755 ${WRAPPERDIR}/${wrapper}
|
chmod 755 ${XBPS_WRAPPERDIR}/${wrapper}
|
||||||
}
|
}
|
||||||
|
|
||||||
generic_wrapper2() {
|
generic_wrapper2() {
|
||||||
local wrapper="$1"
|
local wrapper="$1"
|
||||||
|
|
||||||
[ ! -x ${XBPS_CROSS_BASE}/usr/bin/${wrapper} ] && return 0
|
[ ! -x ${XBPS_CROSS_BASE}/usr/bin/${wrapper} ] && return 0
|
||||||
[ -x ${WRAPPERDIR}/${wrapper} ] && return 0
|
[ -x ${XBPS_WRAPPERDIR}/${wrapper} ] && return 0
|
||||||
|
|
||||||
cat >>${WRAPPERDIR}/${wrapper}<<_EOF
|
cat >>${XBPS_WRAPPERDIR}/${wrapper}<<_EOF
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
if [ "\$1" = "--prefix" ]; then
|
if [ "\$1" = "--prefix" ]; then
|
||||||
echo "${XBPS_CROSS_BASE}/usr"
|
echo "${XBPS_CROSS_BASE}/usr"
|
||||||
|
@ -34,42 +32,42 @@ else
|
||||||
fi
|
fi
|
||||||
exit \$?
|
exit \$?
|
||||||
_EOF
|
_EOF
|
||||||
chmod 755 ${WRAPPERDIR}/${wrapper}
|
chmod 755 ${XBPS_WRAPPERDIR}/${wrapper}
|
||||||
}
|
}
|
||||||
|
|
||||||
generic_wrapper3() {
|
generic_wrapper3() {
|
||||||
local wrapper="$1"
|
local wrapper="$1"
|
||||||
[ ! -x ${XBPS_CROSS_BASE}/usr/bin/${wrapper} ] && return 0
|
[ ! -x ${XBPS_CROSS_BASE}/usr/bin/${wrapper} ] && return 0
|
||||||
[ -x ${WRAPPERDIR}/${wrapper} ] && return 0
|
[ -x ${XBPS_WRAPPERDIR}/${wrapper} ] && return 0
|
||||||
|
|
||||||
cp ${XBPS_CROSS_BASE}/usr/bin/${wrapper} ${WRAPPERDIR}
|
cp ${XBPS_CROSS_BASE}/usr/bin/${wrapper} ${XBPS_WRAPPERDIR}
|
||||||
sed -e "s,/usr/include,${XBPS_CROSS_BASE}/usr/include,g" -i ${WRAPPERDIR}/${wrapper}
|
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 ${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 ${WRAPPERDIR}/${wrapper}
|
sed -e "s,^prefix=/usr,prefix=${XBPS_CROSS_BASE}/usr," -i ${XBPS_WRAPPERDIR}/${wrapper}
|
||||||
|
|
||||||
chmod 755 ${WRAPPERDIR}/${wrapper}
|
chmod 755 ${XBPS_WRAPPERDIR}/${wrapper}
|
||||||
}
|
}
|
||||||
|
|
||||||
python_wrapper() {
|
python_wrapper() {
|
||||||
local wrapper="$1" version="$2"
|
local wrapper="$1" version="$2"
|
||||||
|
|
||||||
[ -x ${WRAPPERDIR}/${wrapper} ] && return 0
|
[ -x ${XBPS_WRAPPERDIR}/${wrapper} ] && return 0
|
||||||
cat >>${WRAPPERDIR}/${wrapper}<<_EOF
|
cat >>${XBPS_WRAPPERDIR}/${wrapper}<<_EOF
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
if [ "\$1" = "--includes" ]; then
|
if [ "\$1" = "--includes" ]; then
|
||||||
echo "-I${XBPS_CROSS_BASE}/usr/include/python${version}"
|
echo "-I${XBPS_CROSS_BASE}/usr/include/python${version}"
|
||||||
fi
|
fi
|
||||||
exit $?
|
exit $?
|
||||||
_EOF
|
_EOF
|
||||||
chmod 755 ${WRAPPERDIR}/${wrapper}
|
chmod 755 ${XBPS_WRAPPERDIR}/${wrapper}
|
||||||
}
|
}
|
||||||
|
|
||||||
pkgconfig_wrapper() {
|
pkgconfig_wrapper() {
|
||||||
if [ ! -x /usr/bin/pkg-config ]; then
|
if [ ! -x /usr/bin/pkg-config ]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
[ -x ${WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-pkg-config ] && return 0
|
[ -x ${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-pkg-config ] && return 0
|
||||||
cat >>${WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-pkg-config<<_EOF
|
cat >>${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-pkg-config<<_EOF
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
export PKG_CONFIG_SYSROOT_DIR="$XBPS_CROSS_BASE"
|
export PKG_CONFIG_SYSROOT_DIR="$XBPS_CROSS_BASE"
|
||||||
|
@ -77,15 +75,13 @@ export PKG_CONFIG_PATH="$XBPS_CROSS_BASE/lib/pkgconfig:$XBPS_CROSS_BASE/usr/shar
|
||||||
export PKG_CONFIG_LIBDIR="$XBPS_CROSS_BASE/lib/pkgconfig"
|
export PKG_CONFIG_LIBDIR="$XBPS_CROSS_BASE/lib/pkgconfig"
|
||||||
exec /usr/bin/pkg-config "\$@"
|
exec /usr/bin/pkg-config "\$@"
|
||||||
_EOF
|
_EOF
|
||||||
chmod 755 ${WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-pkg-config
|
chmod 755 ${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-pkg-config
|
||||||
ln -sf ${XBPS_CROSS_TRIPLET}-pkg-config ${WRAPPERDIR}/pkg-config
|
ln -sf ${XBPS_CROSS_TRIPLET}-pkg-config ${XBPS_WRAPPERDIR}/pkg-config
|
||||||
}
|
}
|
||||||
|
|
||||||
hook() {
|
hook() {
|
||||||
[ -z "$CROSS_BUILD" ] && return 0
|
[ -z "$CROSS_BUILD" ] && return 0
|
||||||
|
|
||||||
mkdir -p ${WRAPPERDIR}
|
|
||||||
|
|
||||||
# create wrapers
|
# create wrapers
|
||||||
pkgconfig_wrapper
|
pkgconfig_wrapper
|
||||||
generic_wrapper icu-config
|
generic_wrapper icu-config
|
||||||
|
@ -112,6 +108,4 @@ hook() {
|
||||||
generic_wrapper3 xml2-config
|
generic_wrapper3 xml2-config
|
||||||
python_wrapper python-config 2.7
|
python_wrapper python-config 2.7
|
||||||
python_wrapper python3.4-config 3.4m
|
python_wrapper python3.4-config 3.4m
|
||||||
|
|
||||||
export PATH=${WRAPPERDIR}:$PATH
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue