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

27
AppImage-build-debian.sh Executable file
View File

@@ -0,0 +1,27 @@
#! /bin/bash
set -e
# Get torzu source dir
TORZU_SOURCE_DIR="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
echo "Source dir is $TORZU_SOURCE_DIR"
rm -rf "$TORZU_SOURCE_DIR/AppImageBuilder/build"
# Generate debian rootfs
cd /tmp
rm -rf rootfs-torzu-appimage-build
debootstrap stable rootfs-torzu-appimage-build http://deb.debian.org/debian/
bwrap --bind rootfs-torzu-appimage-build / \
--unshare-pid \
--dev-bind /dev /dev --proc /proc --tmpfs /tmp --ro-bind /sys /sys --dev-bind /run /run \
--tmpfs /var/tmp \
--chmod 1777 /tmp \
--ro-bind /etc/resolv.conf /etc/resolv.conf \
--ro-bind "$TORZU_SOURCE_DIR" /tmp/torzu-src \
--chdir / \
--tmpfs /home \
--setenv HOME /home \
--bind /tmp /tmp/hosttmp \
/tmp/torzu-src/AppImage-build-debian-inner.sh
appimagetool /tmp/torzu-debian-appimage-rootfs /tmp/torzu.AppImage
echo "AppImage generated at /tmp/torzu.AppImage! Cleaning up..."
exec rm -rf /tmp/torzu-debian-appimage-rootfs /tmp/rootfs-torzu-appimage-build