1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-11-22 02:59:47 +01:00

Add helper function to fixup libtool files

When "libdir" is not the final path where we install the library,
libtool will mess up the relinking process and prepend the global
library directories to the linker search path.

If we fix the libdir path, libtool will insert it into the rpath
in the binary, which is also pretty bonkers.

Maybe, there is a way to do this correctly, but the various GNU
mailing lists, Debian wiki, etc.. could not provide a better
alternative than patching up libtool scripts.

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
This commit is contained in:
David Oberhollenzer 2018-05-19 21:13:51 +02:00
parent e97e355b64
commit d5c8fce58b
3 changed files with 14 additions and 0 deletions

View file

@ -20,6 +20,7 @@ deploy() {
local DEPLOY="$2"
local DEVDEPLOY="$3"
unfuck_libtool
make DESTDIR="$DEPLOY" install
rm -r "$DEPLOY/share"

View file

@ -37,6 +37,7 @@ deploy() {
mkdir -p "$DEPLOY/var/lib/hwclock"
unfuck_libtool
make DESTDIR="$DEPLOY" install
strip_files ${DEPLOY}/{bin,lib}/*

View file

@ -56,3 +56,15 @@ split_dev_deploy() {
break
done
}
unfuck_libtool() {
local libdir="$PKGDEPLOYDIR/$PKGNAME/lib"
local f
for f in $(find $PKGBUILDDIR -type f -name '*.la'); do
sed -i "s#libdir='.*'#libdir='$libdir'#g" "$f";
done
sed -i -r "s/(finish_cmds)=.*$/\1=\"\"/" "$PKGBUILDDIR/libtool"
sed -i -r "s/(hardcode_into_libs)=.*$/\1=no/" "$PKGBUILDDIR/libtool"
}