feat: add AppImage build pipeline with desktop integration and dependency bundling

Implement full AppImage packaging support including AppRun entry point, .desktop launcher, icon asset, and recursive shared library collection via collect_so_files.sh. The Makefile build target now generates a portable Linux executable by assembling the directory structure, copying the binary to AppImage/usr/bin/r, running the dependency collector, and invoking appimagetool to produce a self-contained AppImage binary. Also update .gitignore to exclude the AppImage build directory and add shell scripts to the ignore list.
This commit is contained in:
2025-04-08 22:00:21 +00:00
parent 0f43cd435c
commit 606bc27834
7 changed files with 61 additions and 11 deletions
+27
View File
@@ -0,0 +1,27 @@
#!/bin/bash
# Script: collect_so_files.sh
BINARY="AppImage/usr/bin/r"
LIB_DIR="AppImage/usr/lib"
mkdir -p "$LIB_DIR"
# Function to copy a library and its dependencies
copy_with_deps() {
local lib="$1"
if [ -f "$lib" ] && [ ! -f "$LIB_DIR/$(basename "$lib")" ]; then
cp "$lib" "$LIB_DIR/"
echo "Copied: $lib"
# Recursively check dependencies of this library
ldd "$lib" | grep -o '/[^ ]\+' | while read -r dep; do
if [ -f "$dep" ]; then
copy_with_deps "$dep"
fi
done
fi
}
# Start with the binarys dependencies
ldd "$BINARY" | grep -o '/[^ ]\+' | while read -r lib; do
copy_with_deps "$lib"
done