33set -ex
44ARCH=" $( uname -m) "
55REPO=" https://github.com/ares-emulator/ares"
6- SHARUN=" https://github.com/VHSgunzo/sharun/releases/latest/download/sharun-$ARCH -aio"
76GRON=" https://raw.githubusercontent.com/xonixx/gron.awk/refs/heads/main/gron.awk"
8- URUNTIME=" https://github.com/VHSgunzo/uruntime/releases/latest/download/uruntime-appimage-dwarfs-$ARCH "
9- URUNTIME_LITE=" https://github.com/VHSgunzo/uruntime/releases/latest/download/uruntime-appimage-dwarfs-lite-$ARCH "
107
118# Determine to build nightly or stable
129if [ " $1 " = ' devel' ]; then
1310 echo " Making nightly build of ares..."
14- UPINFO=" gh-releases-zsync|$( echo " $ GITHUB_REPOSITORY" | tr ' / ' ' | ' ) |nightly|*$ARCH .AppImage.zsync"
11+ export UPINFO=" gh-releases-zsync|${ GITHUB_REPOSITORY%/* } | ${GITHUB_REPOSITORY #*/ } |nightly|*$ARCH .AppImage.zsync"
1512 VERSION=" $( git ls-remote " $REPO " HEAD | cut -c 1-9) "
1613 git clone " $REPO "
1714else
1815 echo " Making stable build of ares..."
19- UPINFO=" gh-releases-zsync|$( echo " $ GITHUB_REPOSITORY" | tr ' / ' ' | ' ) |latest|*$ARCH .AppImage.zsync"
16+ export UPINFO=" gh-releases-zsync|${ GITHUB_REPOSITORY%/* } | ${GITHUB_REPOSITORY #*/ } |latest|*$ARCH .AppImage.zsync"
2017 wget " $GRON " -O ./gron.awk
2118 chmod +x ./gron.awk
2219 VERSION=$( wget https://api.github.com/repos/ares-emulator/ares/tags -O - \
2320 | ./gron.awk | awk -F' =|"' ' /name/ {print $3; exit}' )
2421 git clone --branch " $VERSION " --single-branch " $REPO " ./ares
2522fi
2623
27- echo " $VERSION " > ~ /version
28-
2924# BUILD ARES
3025(
3126 cd ./ares
@@ -50,59 +45,33 @@ echo "$VERSION" > ~/version
5045 ccache -s -v
5146)
5247rm -rf ./ares
48+ [ -n " $VERSION " ] && echo " $VERSION " > ~ /version
5349
5450# NOW MAKE APPIMAGE
55- mkdir -p ./AppDir/share && (
56- cd ./AppDir
57- cp -rv /usr/share/ares ./share
58- cp -v /usr/share/applications/ares.desktop ./ares.desktop
59- cp -v /usr/share/icons/hicolor/256x256/apps/ares.png ./ares.png
60- cp -v /usr/share/icons/hicolor/256x256/apps/ares.png ./.DirIcon
61-
62- wget --retry-connrefused --tries=30 " $SHARUN " -O ./sharun-aio
63- chmod +x ./sharun-aio
64- xvfb-run -a -- \
65- ./sharun-aio l -p -v -e -s -k \
66- /usr/bin/ares \
67- /usr/bin/sourcery \
68- /usr/lib/lib* GL* .so* \
69- /usr/lib/dri/* \
70- /usr/lib/libXss.so* \
71- /usr/lib/gtk-3* /* /* \
72- /usr/lib/gio/modules/* \
73- /usr/lib/gdk-pixbuf-* /* /* /* \
74- /usr/lib/alsa-lib/* \
75- /usr/lib/pulseaudio/* \
76- /usr/lib/pipewire-0.3/* \
77- /usr/lib/spa-0.2/* /* || true # nobody saw a thing ok?
78- rm -f ./sharun-aio
79-
80- # Prepare sharun
81- ln ./sharun ./AppRun
82- ./sharun -g
83- )
51+ URUNTIME=" https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/uruntime2appimage.sh"
52+ SHARUN=" https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/quick-sharun.sh"
8453
85- # turn appdir into appimage
86- wget --retry-connrefused --tries=30 " $URUNTIME " -O ./uruntime
87- wget --retry-connrefused --tries=30 " $URUNTIME_LITE " -O ./uruntime-lite
88- chmod +x ./uruntime*
54+ export ADD_HOOKS=" self-updater.bg.hook"
55+ export OUTNAME=ares-" $VERSION " -anylinux-" $ARCH " .AppImage
56+ export DESKTOP=/usr/share/applications/ares.desktop
57+ export ICON=/usr/share/icons/hicolor/256x256/apps/ares.png
58+ export DEPLOY_OPENGL=1
59+ export DEPLOY_PIPEWIRE=1
8960
90- # Add udpate info to runtime
91- echo " Adding update information \" $UPINFO \" to runtime..."
92- ./uruntime-lite --appimage-addupdinfo " $UPINFO "
61+ # "fix" xvfb-run failing to kill the process in aarch64
62+ if [ " $ARCH " = " aarch64" ]; then
63+ sed -i ' s#kill $XVFBPID#kill $XVFBPID || true#' " $( command -v xvfb-run) "
64+ fi
9365
94- echo " Generating AppImage..."
95- ./uruntime \
96- --appimage-mkdwarfs -f \
97- --set-owner 0 --set-group 0 \
98- --no-history --no-create-timestamp \
99- --compression zstd:level=22 -S26 -B8 \
100- --header uruntime-lite \
101- -i ./AppDir \
102- -o ./ares-" $VERSION " -anylinux-" $ARCH " .AppImage
66+ # ADD LIBRARIES
67+ wget --retry-connrefused --tries=30 " $SHARUN " -O ./quick-sharun
68+ chmod +x ./quick-sharun
69+ ./quick-sharun /usr/bin/ares /usr/bin/sourcery
10370
104- echo " Generating zsync file..."
105- zsyncmake ./* .AppImage -u ./* .AppImage
71+ # turn appdir into appimage
72+ wget --retry-connrefused --tries=30 " $URUNTIME " -O ./uruntime2appimage
73+ chmod +x ./uruntime2appimage
74+ ./uruntime2appimage
10675
10776mkdir -p ./dist
10877mv -v ./* .AppImage* ./dist
0 commit comments