Skip to content

Commit 514e5be

Browse files
authored
Simplify deployment with anylinux wrapper scripts, add option to self update appimage (#15)
* simplify deployment using wrapper scripts * add retries for git clone librashader * Update get-dependencies.sh * aur is down lmao * fix `aarch64` failing * simplify deps install
1 parent 1fdcd38 commit 514e5be

File tree

2 files changed

+29
-78
lines changed

2 files changed

+29
-78
lines changed

ares-appimage.sh

Lines changed: 23 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,24 @@
33
set -ex
44
ARCH="$(uname -m)"
55
REPO="https://github.com/ares-emulator/ares"
6-
SHARUN="https://github.com/VHSgunzo/sharun/releases/latest/download/sharun-$ARCH-aio"
76
GRON="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
129
if [ "$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"
1714
else
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
2522
fi
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
)
5247
rm -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

10776
mkdir -p ./dist
10877
mv -v ./*.AppImage* ./dist

get-dependencies.sh

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,25 @@
11
#!/bin/sh
22

33
set -ex
4-
ARCH="$(uname -m)"
4+
EXTRA_PACKAGES="https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/get-debloated-pkgs.sh"
55

66
echo "Installing dependencies..."
77
echo "---------------------------------------------------------------"
88
pacman -Syu --noconfirm \
9-
alsa-lib \
109
base-devel \
1110
cmake \
1211
ccache \
1312
curl \
1413
gcc-libs \
1514
git \
16-
glibc \
1715
gtk3 \
18-
hicolor-icon-theme \
1916
libao \
2017
libdecor \
2118
libpulse \
2219
libretro-shaders \
2320
libx11 \
2421
libxrandr \
2522
libxss \
26-
mesa \
2723
ninja \
2824
openal \
2925
pipewire-audio \
@@ -33,31 +29,17 @@ pacman -Syu --noconfirm \
3329
rust \
3430
sdl2 \
3531
sdl3 \
36-
vulkan-driver \
37-
vulkan-icd-loader \
3832
wget \
3933
xorg-server-xvfb \
4034
zlib \
4135
zsync
4236

43-
case "$ARCH" in
44-
'x86_64') PKG_TYPE='x86_64.pkg.tar.zst';;
45-
'aarch64') PKG_TYPE='aarch64.pkg.tar.xz';;
46-
''|*) echo "Unknown arch: $ARCH"; exit 1;;
47-
esac
4837

49-
LLVM_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/continuous/llvm-libs-mini-$PKG_TYPE"
50-
LIBXML_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/continuous/libxml2-iculess-$PKG_TYPE"
51-
OPUS_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/continuous/opus-nano-$PKG_TYPE"
52-
53-
echo "Installing debloated pckages..."
38+
echo "Installing debloated packages..."
5439
echo "---------------------------------------------------------------"
55-
wget --retry-connrefused --tries=30 "$LLVM_URL" -O ./llvm-libs.pkg.tar.zst
56-
wget --retry-connrefused --tries=30 "$LIBXML_URL" -O ./libxml2.pkg.tar.zst
57-
wget --retry-connrefused --tries=30 "$OPUS_URL" -O ./opus-nano.pkg.tar.zst
58-
59-
pacman -U --noconfirm ./*.pkg.tar.zst
60-
rm -f ./*.pkg.tar.zst
40+
wget --retry-connrefused --tries=30 "$EXTRA_PACKAGES" -O ./get-debloated-pkgs.sh
41+
chmod +x ./get-debloated-pkgs.sh
42+
./get-debloated-pkgs.sh --add-opengl gtk3-mini opus-mini libxml2-mini
6143

6244
# Make librashader
6345
echo "Making extra dependencies..."
@@ -71,7 +53,7 @@ cat /etc/makepkg.conf
7153
git clone "https://aur.archlinux.org/librashader.git" ./librashader
7254
( cd ./librashader
7355
export RUSTC_WRAPPER="sccache"
74-
makepkg -f
56+
makepkg -fs --noconfirm
7557
sccache --show-stats
7658
ls -la .
7759
pacman --noconfirm -U *.pkg.tar.*

0 commit comments

Comments
 (0)