Separate staging and patching vendor library steps.

This commit is contained in:
casey langen 2022-12-03 16:41:38 -08:00
parent 5dbd4f2dd8
commit 783aedf665
3 changed files with 27 additions and 17 deletions

View File

@ -73,6 +73,8 @@ else
make ${JOBS} || exit $?
fi
./script/patch-vendor-libraries.sh || exit $?
rm -rf dist/$VERSION/*${OS_ARCH}_$VERSION* 2> /dev/null
mkdir -p $OUTDIR/lib

View File

@ -0,0 +1,25 @@
#!/bin/bash
PLATFORM=$(uname)
if [[ "$PLATFORM" == 'Linux' ]]; then
echo "[patch-static-vendor-libraries] patch Linux .so files..."
# update the RPATH so libraries in libs/ can discover each other,
# and plugins can discover themselves, and libs/ (but not the
# other way around)
FILES="./bin/lib/*"
for f in $FILES
do
patchelf --set-rpath "\$ORIGIN" "$f"
done
FILES="./bin/plugins/*.so"
for f in $FILES
do
patchelf --set-rpath "\$ORIGIN:\$ORIGIN/../lib" "$f"
done
chmod -x ./bin/lib/*
fi

View File

@ -77,21 +77,4 @@ elif [[ "$PLATFORM" == 'Linux' ]]; then
mkdir -p ./bin/share/terminfo
cp -rfp /lib/terminfo/* ./bin/share/terminfo
# update the RPATH so libraries in libs/ can discover each other,
# and plugins can discover themselves, and libs/ (but not the
# other way around)
FILES="./bin/lib/*"
for f in $FILES
do
patchelf --set-rpath "\$ORIGIN" "$f"
done
FILES="./bin/plugins/*.so"
for f in $FILES
do
patchelf --set-rpath "\$ORIGIN:\$ORIGIN/../lib" "$f"
done
chmod -x ./bin/lib/*
fi