From cb6fd882390359e5e437e4cde93b3c858b46b17a Mon Sep 17 00:00:00 2001 From: Anthony Bilinski Date: Wed, 27 Oct 2021 17:28:42 -0700 Subject: [PATCH] refactor(appimage): List manual libs and copy iteratively Also preserve symlinks while copying with -P to avoid creating duplicate files from symlinks on build env system. --- appimage/build.sh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/appimage/build.sh b/appimage/build.sh index a30da45e8..de9eaf13c 100755 --- a/appimage/build.sh +++ b/appimage/build.sh @@ -31,6 +31,7 @@ readonly OUTPUT_DIR="/output" readonly BUILD_DIR="/build" readonly QTOX_BUILD_DIR="$BUILD_DIR"/qtox readonly QTOX_APP_DIR="$BUILD_DIR"/appdir +readonly LOCAL_LIB_DIR="$QTOX_APP_DIR"/local/lib # "linuxdeployqt" is to long, shortened to ldqt readonly LDQT_BUILD_DIR="$BUILD_DIR"/ldqt # "appimagetool" becomes aitool @@ -161,17 +162,22 @@ eval "$LDQT_BIN $QTOX_DESKTOP_FILE -bundle-non-qt-libs -extra-plugins=libsnore-q mv "$QTOX_APP_DIR"/usr/* "$QTOX_APP_DIR/" rm -rf "$QTOX_APP_DIR/usr" -# copy OpenSSL libs to AppImage # Warning: This is hard coded to debain:stretch. -cp /usr/lib/x86_64-linux-gnu/libssl.so* "$QTOX_APP_DIR/local/lib/" -cp /usr/lib/x86_64-linux-gnu/libcrypt.so* "$QTOX_APP_DIR/local/lib/" -cp /usr/lib/x86_64-linux-gnu/libcrypto.so* "$QTOX_APP_DIR/local/lib" +libs=( +# copy OpenSSL libs to AppImage +/usr/lib/x86_64-linux-gnu/libssl.so +/usr/lib/x86_64-linux-gnu/libcrypt.so +/usr/lib/x86_64-linux-gnu/libcrypto.so # Also bundle libjack.so* without which the AppImage does not work in Fedora Workstation -cp /usr/lib/x86_64-linux-gnu/libjack.so* "$QTOX_APP_DIR/local/lib" +/usr/lib/x86_64-linux-gnu/libjack.so.0 +) -# this is important , aitool automatically uses the same filename in .zsync meta file. -# if this name does not match with the one we upload , the update always fails. +for lib in "${libs[@]}"; do + cp -P $(echo "$lib"*) "$LOCAL_LIB_DIR" +done +# this is important, aitool automatically uses the same filename in .zsync meta file. +# if this name does not match with the one we upload, the update always fails. if [ -n "${TRAVIS_TAG-}" ] then VERSION_NAME="${TRAVIS_TAG}"