AppImage: Patch AppRun to load bundled Qt libs before system Qt libs

Fixes Qt version mismatch errors.
This commit is contained in:
Albert Liu 2020-10-01 17:07:09 -07:00
parent b2ed9087de
commit b7f240a367
1 changed files with 14 additions and 4 deletions

View File

@ -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 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 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 <resolution>/<app_name>.<ext> directory structure that linuxdeploy nominally expects, # Copy icons into the <resolution>/<app_name>.<ext> directory structure that linuxdeploy nominally expects,
# e.g. 16x16/duckstation-qt.png, 32x32/duckstation-qt.png, etc. # e.g. 16x16/duckstation-qt.png, 32x32/duckstation-qt.png, etc.
FRONTENDS=("qt" "sdl") FRONTENDS=("qt" "sdl")
@ -61,15 +65,21 @@ done
# Pass UPDATE_INFORMATION and OUTPUT variables (used by linuxdeploy-plugin-appimage) # Pass UPDATE_INFORMATION and OUTPUT variables (used by linuxdeploy-plugin-appimage)
# to the environment of the linuxdeploy commands # 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 \ ${BUILD_DIR}/linuxdeploy-x86_64.AppImage \
--appdir=${BUILD_DIR}/duckstation-qt.AppDir \ --appdir=${BUILD_DIR}/duckstation-qt.AppDir \
--executable=${BUILD_DIR}/bin/duckstation-qt \ --executable=${BUILD_DIR}/bin/duckstation-qt \
--desktop-file=${APPIMAGE_RESOURCES_DIR}/duckstation-qt.desktop \ --desktop-file=${APPIMAGE_RESOURCES_DIR}/duckstation-qt.desktop \
${ICONS_QT[@]/#/--icon-file=} \ ${ICONS_QT[@]/#/--icon-file=} \
--plugin=qt \ --plugin=qt
--output=appimage
# 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" \ UPDATE_INFORMATION="zsync|https://github.com/stenzek/duckstation/releases/download/latest/duckstation-sdl-x64.AppImage.zsync" \
OUTPUT="duckstation-sdl-x64.AppImage" \ OUTPUT="duckstation-sdl-x64.AppImage" \