From 062f771fdeae646282f01cd173880ce1eb67cb16 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 4 Apr 2023 12:53:20 +0200 Subject: [PATCH] AppImage: don't use bundled Wayland libraries Don't use bundled Wayland libraries when running on Wayland but use it otherwise to satisfy possibly unsatisfied dependencies. See also previous commit - Wayland libraries seem not to be portable and prevent SDL2 native run on Wayland. After this change, SDL2 runs on U22.04 in Weston (without Xwayland). --- data/scripts/Linux-AppImage/AppRun | 8 ++++++++ data/scripts/Linux-AppImage/create-appimage.sh | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/data/scripts/Linux-AppImage/AppRun b/data/scripts/Linux-AppImage/AppRun index 2933e154a..3158a282b 100755 --- a/data/scripts/Linux-AppImage/AppRun +++ b/data/scripts/Linux-AppImage/AppRun @@ -161,6 +161,13 @@ setup_vaapi() { fi } +setup_wayland() { + # use bundled Wayland libs only when not running on Wayland, otherwise system ones + if [ -z "${WAYLAND_DISPLAY-}" ]; then + LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$AI_LIB_PATH/wayland" + fi +} + add_whitelist() { if expr "$1" : /tmp >/dev/null; then printf -- "$separator--read-write=%s --mkdir=%s" "$1" "$1" @@ -202,6 +209,7 @@ get_firejail_whitelist() { } setup_vaapi +setup_wayland # shellcheck source=/dev/null . "$DIR/scripts/jack_preload.sh" diff --git a/data/scripts/Linux-AppImage/create-appimage.sh b/data/scripts/Linux-AppImage/create-appimage.sh index 14c4d947a..1eb5a643c 100755 --- a/data/scripts/Linux-AppImage/create-appimage.sh +++ b/data/scripts/Linux-AppImage/create-appimage.sh @@ -70,6 +70,12 @@ for n in "$APPPREFIX"/bin/* "$APPPREFIX"/lib/ultragrid/* $PLUGIN_LIBS; do done done +# hide Wayland libraries +if ls $APPPREFIX/lib/libwayland-* >/dev/null 2>&1; then + mkdir $APPPREFIX/lib/wayland + mv $APPPREFIX/lib/libwayland-* $APPPREFIX/lib/wayland +fi + if command wget >/dev/null && wget -V | grep -q https; then dl() { wget -O - ${GITHUB_TOKEN+--header "Authorization: token $GITHUB_TOKEN"} "$1"