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).
This commit is contained in:
Martin Pulec
2023-04-04 12:53:20 +02:00
parent 9eb376ee38
commit 062f771fde
2 changed files with 14 additions and 0 deletions

View File

@@ -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"

View File

@@ -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"