From b7f240a367d0c8505d895afd3005607ec230c304 Mon Sep 17 00:00:00 2001 From: Albert Liu <45282415+ggrtk@users.noreply.github.com> Date: Thu, 1 Oct 2020 17:07:09 -0700 Subject: [PATCH] AppImage: Patch AppRun to load bundled Qt libs before system Qt libs Fixes Qt version mismatch errors. --- appimage/generate_appimages.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/appimage/generate_appimages.sh b/appimage/generate_appimages.sh index 0e1304e3f..45e840815 100755 --- a/appimage/generate_appimages.sh +++ b/appimage/generate_appimages.sh @@ -22,6 +22,10 @@ wget --timestamping --directory-prefix=${BUILD_DIR} \ https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage chmod a+x ${BUILD_DIR}/linuxdeploy-plugin-qt-x86_64.AppImage +wget --timestamping --directory-prefix=${BUILD_DIR} \ + https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage +chmod a+x ${BUILD_DIR}/linuxdeploy-plugin-appimage-x86_64.AppImage + # Copy icons into the /. directory structure that linuxdeploy nominally expects, # e.g. 16x16/duckstation-qt.png, 32x32/duckstation-qt.png, etc. FRONTENDS=("qt" "sdl") @@ -61,15 +65,21 @@ done # Pass UPDATE_INFORMATION and OUTPUT variables (used by linuxdeploy-plugin-appimage) # to the environment of the linuxdeploy commands -UPDATE_INFORMATION="zsync|https://github.com/stenzek/duckstation/releases/download/latest/duckstation-qt-x64.AppImage.zsync" \ -OUTPUT="duckstation-qt-x64.AppImage" \ ${BUILD_DIR}/linuxdeploy-x86_64.AppImage \ --appdir=${BUILD_DIR}/duckstation-qt.AppDir \ --executable=${BUILD_DIR}/bin/duckstation-qt \ --desktop-file=${APPIMAGE_RESOURCES_DIR}/duckstation-qt.desktop \ ${ICONS_QT[@]/#/--icon-file=} \ - --plugin=qt \ - --output=appimage + --plugin=qt + +# Patch AppRun to work around system Qt libraries being loaded ahead of bundled libraries +sed -i 's|exec "$this_dir"/AppRun.wrapped "$@"|exec env LD_LIBRARY_PATH="$this_dir"/usr/lib:$LD_LIBRARY_PATH "$this_dir"/AppRun.wrapped "$@"|' \ + ${BUILD_DIR}/duckstation-qt.AppDir/AppRun + +UPDATE_INFORMATION="zsync|https://github.com/stenzek/duckstation/releases/download/latest/duckstation-qt-x64.AppImage.zsync" \ +OUTPUT="duckstation-qt-x64.AppImage" \ +${BUILD_DIR}/linuxdeploy-plugin-appimage-x86_64.AppImage \ + --appdir=${BUILD_DIR}/duckstation-qt.AppDir UPDATE_INFORMATION="zsync|https://github.com/stenzek/duckstation/releases/download/latest/duckstation-sdl-x64.AppImage.zsync" \ OUTPUT="duckstation-sdl-x64.AppImage" \