Made AppImages way more robust, compatible and reproducible using containerization and by using system-provided glibc

This commit is contained in:
spectranator
2025-04-06 19:15:22 +02:00
parent f8ae0e4f2a
commit a16e593fa8
6 changed files with 92 additions and 8 deletions

View File

@@ -1,6 +1,3 @@
#! /bin/sh
# NOTE: the `ld-linux-aarch64.so.1` filename came from a pi debian 11 installation,
# this may be incorrect for a different or more up-to-date system.
# Can find out the correct filename using command "ldd yuzu" on the non-AppImage app
QT_QPA_PLATFORM=xcb QT_PLUGIN_PATH=. exec ./ld-linux-aarch64.so.1 --library-path . ./yuzu "$@"
LD_LIBRARY_PATH=/usr/lib/$(uname -m)-linux-gnu:. QT_QPA_PLATFORM=xcb QT_PLUGIN_PATH=. exec ./yuzu "$@"

View File

@@ -1,2 +1,2 @@
#! /bin/sh
QT_QPA_PLATFORM=xcb QT_PLUGIN_PATH=. exec ./ld-linux-x86-64.so.2 --library-path . ./yuzu "$@"
LD_LIBRARY_PATH=/usr/lib/$(uname -m)-linux-gnu:. QT_QPA_PLATFORM=xcb QT_PLUGIN_PATH=. exec ./yuzu "$@"

View File

@@ -60,13 +60,36 @@ if [ $QTFOUND == "true" ]; then
# - '/lib64/ld-linux-x86-64.so.2' or `/lib/ld-linux-aarch64.so.1` file per architecture
# - required files from `/usr/lib/x86_64-linux-gnu` or `/usr/lib/aarch64-linux-gnu`
# - different for SteamDeck, but still does it automatically
for lib in $(ldd "$YUZU_BIN_GUI"); do
(cp -v "$lib" ./build/ 2> /dev/null) || true
done
function copy_libs {
for lib in $(ldd "$1"); do
(cp -vn "$lib" ./build/ 2> /dev/null) || true
done
}
echo "Copying main dependencies..."
copy_libs "$YUZU_BIN_GUI"
# Copy QT dependency folders, path determined above
echo "Copying Qt dependencies..."
cp -rv "$QTDIR"/{imageformats,platforms,platformthemes,xcbglintegrations} ./build/
# Discover indirect dependencies (mostly from runtime-loaded Qt plugins)
echo "Copying extra dependencies..."
while true; do
LIBS="$(find ./build -name \*.so\*)"
LIB_COUNT=$(echo "$LIBS" | wc -l)
echo "$LIB_COUNT dependency libraries discovered so far..."
if [ $LIB_COUNT == "$PREV_LIB_COUNT" ]; then
break
fi
PREV_LIB_COUNT=$LIB_COUNT
for plib in $LIBS; do
if [ -f "$plib" ]; then
copy_libs "$plib"
fi
done
done
# Copy executable
cp -v "$YUZU_BIN_GUI" ./build/