11#! /bin/sh
22
3- set -eu
3+ set -eux
44
5- PACKAGE=desmume
6- DESKTOP=org.desmume.DeSmuME.desktop
7- ICON=org.desmume.DeSmuME.svg
8- TARGET_BIN=" $PACKAGE "
5+ ARCH=" $( uname -m) "
6+ URUNTIME=" https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/uruntime2appimage.sh"
7+ SHARUN=" https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/quick-sharun.sh"
98
10- export ARCH=" $( uname -m) "
11- export APPIMAGE_EXTRACT_AND_RUN=1
12- export VERSION=" $( pacman -Q " $PACKAGE " | awk ' NR==1 {print $2; exit}' ) "
9+ VERSION=" $( pacman -Q desmume | awk ' {print $2; exit}' ) "
1310echo " $VERSION " > ~ /version
1411
15- UPINFO=" gh-releases-zsync|$( echo " $GITHUB_REPOSITORY " | tr ' /' ' |' ) |latest|*$ARCH .AppImage.zsync"
16- LIB4BN=" https://raw.githubusercontent.com/VHSgunzo/sharun/refs/heads/main/lib4bin"
17- URUNTIME=" https://github.com/VHSgunzo/uruntime/releases/latest/download/uruntime-appimage-dwarfs-$ARCH "
12+ export ADD_HOOKS=" self-updater.bg.hook"
13+ export DESKTOP=/usr/share/applications/org.desmume.DeSmuME.desktop
14+ export ICON=/usr/share/icons/hicolor/scalable/apps/org.desmume.DeSmuME.svg
15+ export UPINFO=" gh-releases-zsync|${GITHUB_REPOSITORY%/* } |${GITHUB_REPOSITORY#*/ } |latest|*$ARCH .AppImage.zsync"
16+ export OUTNAME=desmume-" $VERSION " -anylinux-" $ARCH " .AppImage
1817
19- # Prepare AppDir
20- mkdir -p ./AppDir/shared/lib
21- cd ./AppDir
22- cp /usr/share/applications/" $DESKTOP " ./
23- cp /usr/share/icons/hicolor/scalable/apps/" $ICON " ./
24- cp /usr/share/icons/hicolor/scalable/apps/" $ICON " ./.DirIcon
25-
26- # ADD LIBRARIES
27- wget " $LIB4BN " -O ./lib4bin
28- chmod +x ./lib4bin
29- xvfb-run -a -- ./lib4bin -p -v -e -s -k \
30- /usr/bin/" $TARGET_BIN " * \
31- /usr/lib/libGLX* \
32- /usr/lib/libGL.so* \
33- /usr/lib/libXss.so* \
34- /usr/lib/gio/modules/* \
35- /usr/lib/alsa-lib/* \
36- /usr/lib/pulseaudio/* \
37- /usr/lib/pipewire-0.3/* \
38- /usr/lib/spa-0.2/* /*
39-
40- # Prepare sharun
41- echo " Preparing sharun..."
42- ln ./sharun ./AppRun
43- ./sharun -g
18+ # Deploy dependencies
19+ wget --retry-connrefused --tries=30 " $SHARUN " -O ./quick-sharun
20+ chmod +x ./quick-sharun
21+ ./quick-sharun /usr/bin/desmume
4422
4523# MAKE APPIMAGE WITH URUNTIME
46- cd ..
47- wget " $URUNTIME " -O ./uruntime
48- chmod +x ./uruntime
49-
50- # Add udpate info to runtime
51- echo " Adding update information \" $UPINFO \" to runtime..."
52- ./uruntime --appimage-addupdinfo " $UPINFO "
53-
54- echo " Generating AppImage..."
55- ./uruntime --appimage-mkdwarfs -f \
56- --set-owner 0 --set-group 0 \
57- --no-history --no-create-timestamp \
58- --compression zstd:level=22 -S26 -B8 \
59- --header uruntime \
60- -i ./AppDir -o " $PACKAGE " -" $VERSION " -anylinux-" $ARCH " .AppImage
24+ wget --retry-connrefused --tries=30 " $URUNTIME " -O ./uruntime2appimage
25+ chmod +x ./uruntime2appimage
26+ ./uruntime2appimage
6127
6228# Set up the PELF toolchain
6329UPINFO=" $( echo " $UPINFO " | sed ' s#.AppImage.zsync#*.AppBundle.zsync#g' ) "
@@ -69,10 +35,7 @@ echo "Generating [dwfs]AppBundle...(Go runtime)"
6935 --add-updinfo " $UPINFO " \
7036 --appbundle-id=" org.desmume.DeSmuME#github.com/$GITHUB_REPOSITORY :$VERSION @$( date +%d_%m_%Y) " \
7137 --compression " -C zstd:level=22 -S26 -B8" \
72- --output-to " $PACKAGE -$VERSION -anylinux-$ARCH .dwfs.AppBundle"
73-
74- echo " Generating zsync file..."
75- zsyncmake * .AppImage -u * .AppImage
76- zsyncmake * .AppBundle -u * .AppBundle
38+ --output-to " desmume-$VERSION -anylinux-$ARCH .dwfs.AppBundle"
39+ zsyncmake ./* .AppBundle -u ./* .AppBundle
7740
7841echo " All Done!"
0 commit comments