Add AppImage builds
This is based on miniupnp's MR from a few years ago: !261 (closed) Compared to that MR there are a few changes:
-
Add alsa and pulseaudio dependencies: Even though I don't think we need them, go-appimage requires them unconditionally.
-
Don't use standalone mode
go-appimage deploy -senables standalone mode, which bundles all dependencies in the AppImage, including ld-linux. It's a nice feature that allows AppImages to work on very old Linux systems or even non-Linux systems that can emulate Linux syscalls. Unfortunately, for GrafX2 it requires too much to be bundled into the AppImage. Even graphics drivers need to be included. In my testing, the standalone version of the AppImage was 160 MiB, compared to 10 MiB for the non-standalone version. Besides the size, there are drawbacks of shipping graphics drivers in an AppImage.In non-standalone mode, the minimum requirements are higher. We're building on Debian 12 and linking to glibc 2.36, circa 2023, and generally requiring a Linux system from 2022 or newer. We can't go older because of SDL features that GrafX2 needs. For example, we need SDL_ScaleModeNearest, which was introduced in SDL 2.0.12 1. patchelf also has a bug that breaks libraries with older glibc 2.
Other than glibc, SDL needs any working graphical system from the host. It will dlopen whatever X11, Wayland, etc. libraries are available.
-
Use argv[0] for relative and absolute paths
argv[0] is unreliable in the case where the program is on the PATH and the user invoked the program as plain
grafx2with no slashes. If argv[0] contains any slashes, (e.g. /usr/bin/grafx2 or ./grafx2), then argv[0] is a reliable source of the program path.I made this change to get the AppImage able to run, but after some changes, it's no longer required. It could still be considered an improvement.