AppRun fixed libva-x11 not being LD_PRELOADED

In the second iteration of for cycle, $NAME was derived from something
like "/usr/lib/libva.so.2:/usr/lib/libva-drm.so.2"  (s/libva/libva-x11),
which obviously didn't exist as a file.

Fixes:

    $ <AppImage> --list-modules | grep -A 2 'Errors:'
    Errors:
            ultragrid_acompress_libavcodec.so
                    ./squashfs-root2/usr/lib/libva-x11.so.2: undefined symbol: va_fool_postp
This commit is contained in:
Martin Pulec
2022-07-20 12:19:01 +02:00
parent 9bbcefc240
commit 97dd5ceecb

View File

@@ -129,14 +129,15 @@ set_libva_ld_preload() {
if [ -z "$LIBVA_LIB" ]; then
return 1
fi
libva_libs=$LIBVA_LIB
# add also libva-drm, libva-x11 if present
for n in libva-drm libva-x11; do
NAME=$(echo "$LIBVA_LIB" | sed s/libva/$n/)
if [ -f "$NAME" ]; then
LIBVA_LIB=$LIBVA_LIB:$NAME
libva_libs=$libva_libs:$NAME
fi
done
export LD_PRELOAD="$LIBVA_LIB${LD_PRELOAD:+:$LD_PRELOAD}"
export LD_PRELOAD="$libva_libs${LD_PRELOAD:+:$LD_PRELOAD}"
return 0
}