Merge pull request #802 from zacaj/auto-appimage-deps

automatically determine AppImage shared lib dependences
This commit is contained in:
Drew Weymouth
2026-01-10 09:35:28 -08:00
committed by GitHub
5 changed files with 138 additions and 95 deletions
+1
View File
@@ -13,6 +13,7 @@
}, },
"containerEnv": { "containerEnv": {
"VNC_RESOLUTION": "1920x1080x24", "VNC_RESOLUTION": "1920x1080x24",
"APPIMAGE_EXTRACT_AND_RUN": "1",
}, },
"runArgs": [ "runArgs": [
"--device=/dev/snd:/dev/snd", "--device=/dev/snd:/dev/snd",
+2 -2
View File
@@ -22,7 +22,7 @@ jobs:
go-version: '1.24' go-version: '1.24'
- name: Install dependencies - name: Install dependencies
run: sudo apt update && sudo apt install libmpv-dev gcc libegl1-mesa-dev xorg-dev desktop-file-utils run: sudo apt update && sudo apt install -y libmpv-dev gcc libegl1-mesa-dev xorg-dev
- name: Build - name: Build
run: make build run: make build
@@ -30,7 +30,7 @@ jobs:
- name: make appimage - name: make appimage
run: | run: |
chmod +x ./scripts/appimage-build.sh chmod +x ./scripts/appimage-build.sh
./scripts/appimage-build.sh ./scripts/appimage-build.sh --manual-libs
- name: upload artifact - name: upload artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
+5
View File
@@ -12,7 +12,12 @@ supersonic
*.dll *.dll
*.so *.so
*.dylib *.dylib
*.AppImage
Supersonic.app Supersonic.app
Supersonic.AppDir/
appimagetool-x86_64.AppImage
tmp/
# Test binary, built with `go test -c` # Test binary, built with `go test -c`
*.test *.test
Regular → Executable
+25 -4
View File
@@ -1,8 +1,24 @@
#!/bin/bash #!/bin/bash -e
if (ls supersonic); if (ls supersonic);
then then
rm -rf Supersonic.AppDir/
mkdir -p Supersonic.AppDir/usr/lib mkdir -p Supersonic.AppDir/usr/lib
mkdir Supersonic.AppDir/usr/bin mkdir -p Supersonic.AppDir/usr/bin
if [[ "$@" != *"--manual-libs"* ]]; then
# auto add all dependences of binary except those on AppImage exclude list
EXCLUDE=$(wget -nv -O - https://github.com/AppImageCommunity/pkg2appimage/raw/refs/heads/master/excludelist | grep -v "^#")
ldd ./supersonic | grep -F "x86_64-linux-gnu" | sort | while read -r file _ path __; do
if [[ "$EXCLUDE" == *"$file"* ]]; then
echo "exclude $file"
else
echo "add $path"
cp $path "Supersonic.AppDir/usr/lib/$file"
fi
done
else
# (smaller) manual list of dependencies which avoids some libs that are generally available on most linux installs already
set -x
cp /usr/lib/x86_64-linux-gnu/libpostproc.so.55 Supersonic.AppDir/usr/lib # cp /usr/lib/x86_64-linux-gnu/libpostproc.so.55 Supersonic.AppDir/usr/lib #
cp /usr/lib/x86_64-linux-gnu/libsrt-gnutls.so.1.4 Supersonic.AppDir/usr/lib/ # cp /usr/lib/x86_64-linux-gnu/libsrt-gnutls.so.1.4 Supersonic.AppDir/usr/lib/ #
cp /usr/lib/x86_64-linux-gnu/libx264.so.163 Supersonic.AppDir/usr/lib/ # cp /usr/lib/x86_64-linux-gnu/libx264.so.163 Supersonic.AppDir/usr/lib/ #
@@ -92,16 +108,21 @@ cp /usr/lib/x86_64-linux-gnu/libtheoradec.so.1 Supersonic.AppDir/usr/lib/ # Open
cp /usr/lib/x86_64-linux-gnu/libxml2.so.2 Supersonic.AppDir/usr/lib/ # CachyOS fix cp /usr/lib/x86_64-linux-gnu/libxml2.so.2 Supersonic.AppDir/usr/lib/ # CachyOS fix
cp /usr/lib/x86_64-linux-gnu/libicuuc.so.70 Supersonic.AppDir/usr/lib/ # CachyOS fix cp /usr/lib/x86_64-linux-gnu/libicuuc.so.70 Supersonic.AppDir/usr/lib/ # CachyOS fix
cp /usr/lib/x86_64-linux-gnu/libicudata.so.70 Supersonic.AppDir/usr/lib/ # CachyOS fix cp /usr/lib/x86_64-linux-gnu/libicudata.so.70 Supersonic.AppDir/usr/lib/ # CachyOS fix
set +x
fi
printf '%s\n' '#!/bin/bash' 'SELF=$(readlink -f "$0")' 'HERE=${SELF%/*}' 'EXEC="${HERE}/usr/bin/supersonic"' 'export LD_LIBRARY_PATH="/usr/lib64:/lib64:/usr/lib/x86_64-linux-gnu:/usr/lib:${HERE}/usr/lib/"' 'exec "${EXEC}";' > Supersonic.AppDir/AppRun printf '%s\n' '#!/bin/bash' 'SELF=$(readlink -f "$0")' 'HERE=${SELF%/*}' 'EXEC="${HERE}/usr/bin/supersonic"' 'export LD_LIBRARY_PATH="/usr/lib64:/lib64:/usr/lib/x86_64-linux-gnu:/usr/lib:${HERE}/usr/lib/"' 'exec "${EXEC}";' > Supersonic.AppDir/AppRun
printf '%s\n' '[Desktop Entry]' 'Name=Supersonic' 'Exec=supersonic' 'Icon=ico' 'Type=Application' 'Comment=A lightweight cross-platform desktop client for self-hosted music servers' 'Categories=AudioVideo;' > Supersonic.AppDir/"supersonic.desktop" printf '%s\n' '[Desktop Entry]' 'Name=Supersonic' 'Exec=supersonic' 'Icon=ico' 'Type=Application' 'Comment=A lightweight cross-platform desktop client for self-hosted music servers' 'Categories=AudioVideo;' > Supersonic.AppDir/"supersonic.desktop"
chmod +x Supersonic.AppDir/AppRun chmod +x Supersonic.AppDir/AppRun
chmod +x Supersonic.AppDir/supersonic.desktop chmod +x Supersonic.AppDir/supersonic.desktop
wget https://github.com/dweymouth/supersonic/blob/main/res/appicon.png?raw=true -O Supersonic.AppDir/ico.png wget -nv https://github.com/dweymouth/supersonic/blob/main/res/appicon.png?raw=true -O Supersonic.AppDir/ico.png
cp supersonic Supersonic.AppDir/usr/bin/ cp supersonic Supersonic.AppDir/usr/bin/
chmod +x Supersonic.AppDir/usr/bin/supersonic chmod +x Supersonic.AppDir/usr/bin/supersonic
wget https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage
wget -nv -nc https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x appimagetool-x86_64.AppImage chmod +x appimagetool-x86_64.AppImage
./appimagetool-x86_64.AppImage Supersonic.AppDir/ ./appimagetool-x86_64.AppImage Supersonic.AppDir/
echo "Script finished" echo "Script finished"
else else
echo "executable not found!" echo "executable not found!"
+16
View File
@@ -0,0 +1,16 @@
{
"folders": [
{
"path": "."
},
{
"path": "tmp"
},
{
"path": "../../home/vscode/.ssh"
},
{
"path": "../fake"
}
]
}