Skip to content

Commit a5bb7ce

Browse files
authored
simplify deployment with anylinux wrapper scripts (#8)
1 parent 87575dd commit a5bb7ce

File tree

1 file changed

+24
-67
lines changed

1 file changed

+24
-67
lines changed

azahar-appimage.sh

Lines changed: 24 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22

33
set -ex
44

5-
export ARCH="$(uname -m)"
6-
5+
ARCH="$(uname -m)"
76
REPO="https://github.com/azahar-emu/azahar.git"
87
GRON="https://raw.githubusercontent.com/xonixx/gron.awk/refs/heads/main/gron.awk"
9-
URUNTIME="https://github.com/VHSgunzo/uruntime/releases/latest/download/uruntime-appimage-dwarfs-$ARCH"
10-
SHARUN="https://github.com/VHSgunzo/sharun/releases/latest/download/sharun-$ARCH-aio"
8+
URUNTIME="https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/uruntime2appimage.sh"
9+
SHARUN="https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/quick-sharun.sh"
1110

1211
if [ "$1" = 'v3' ] && [ "$ARCH" = 'x86_64' ]; then
1312
echo "Making x86-64-v3 optimized build of azahar..."
@@ -21,8 +20,6 @@ else
2120
ARCH_FLAGS="-march=armv8-a -mtune=generic -O3 -flto=thin -DNDEBUG"
2221
fi
2322

24-
UPINFO="gh-releases-zsync|$(echo "$GITHUB_REPOSITORY" | tr '/' '|')|latest|*$ARCH.AppImage.zsync"
25-
2623
# Determine to build nightly or stable
2724
if [ "DEVEL" = 'true' ]; then
2825
echo "Making nightly build of azahar..."
@@ -38,6 +35,9 @@ else
3835
fi
3936
echo "$VERSION" > ~/version
4037

38+
export UPINFO="gh-releases-zsync|${GITHUB_REPOSITORY%/*}|${GITHUB_REPOSITORY#*/}|latest|*$ARCH.AppImage.zsync"
39+
export OUTNAME=Azahar-Enhanced-"$VERSION"-anylinux-"$ARCH".AppImage
40+
4141
# BUILD AZAAHR
4242
(
4343
cd ./azahar
@@ -69,72 +69,29 @@ echo "$VERSION" > ~/version
6969
)
7070
rm -rf ./azahar
7171

72-
# NOW MAKE APPIMAGE
72+
# PREPARE APPDIR
7373
mkdir ./AppDir
74-
cd ./AppDir
75-
76-
cp -v /usr/share/applications/org.azahar_emu.Azahar.desktop ./azahar.desktop
77-
cp -v /usr/share/icons/hicolor/512x512/apps/org.azahar_emu.Azahar.png ./azahar.png
78-
cp -v /usr/share/icons/hicolor/512x512/apps/org.azahar_emu.Azahar.png ./.DirIcon
79-
74+
cp -v /usr/share/applications/org.azahar_emu.Azahar.desktop ./AppDir/azahar.desktop
75+
cp -v /usr/share/icons/hicolor/512x512/apps/org.azahar_emu.Azahar.png ./AppDir/azahar.png
76+
cp -v /usr/share/icons/hicolor/512x512/apps/org.azahar_emu.Azahar.png ./AppDir/.DirIcon
8077
if [ "$DEVEL" = 'true' ]; then
81-
sed -i 's|Name=Azahar|Name=Azahar nightly|' ./azahar.desktop
78+
sed -i 's|Name=Azahar|Name=Azahar nightly|' ./AppDir/azahar.desktop
8279
UPINFO="$(echo "$UPINFO" | sed 's|latest|nightly|')"
8380
fi
8481

85-
# Bundle all libs
86-
wget --retry-connrefused --tries=30 "$SHARUN" -O ./sharun-aio
87-
chmod +x ./sharun-aio
88-
xvfb-run -a ./sharun-aio l -p -v -e -s -k \
89-
/usr/bin/azahar* \
90-
/usr/lib/lib*GL* \
91-
/usr/lib/dri/* \
92-
/usr/lib/vdpau/* \
93-
/usr/lib/libvulkan* \
94-
/usr/lib/libVkLayer* \
95-
/usr/lib/libXss.so* \
96-
/usr/lib/libdecor-0.so* \
97-
/usr/lib/libgamemode.so* \
98-
/usr/lib/qt6/plugins/audio/* \
99-
/usr/lib/qt6/plugins/bearer/* \
100-
/usr/lib/qt6/plugins/imageformats/* \
101-
/usr/lib/qt6/plugins/iconengines/* \
102-
/usr/lib/qt6/plugins/platforms/* \
103-
/usr/lib/qt6/plugins/platformthemes/* \
104-
/usr/lib/qt6/plugins/platforminputcontexts/* \
105-
/usr/lib/qt6/plugins/styles/* \
106-
/usr/lib/qt6/plugins/xcbglintegrations/* \
107-
/usr/lib/qt6/plugins/wayland-*/* \
108-
/usr/lib/pulseaudio/* \
109-
/usr/lib/pipewire-*/* \
110-
/usr/lib/spa-*/*/* \
111-
/usr/lib/alsa-lib/*
112-
rm -f ./sharun-aio
82+
# ADD LIBRARIES
83+
wget --retry-connrefused --tries=30 "$SHARUN" -O ./quick-sharun
84+
chmod +x ./quick-sharun
85+
DEPLOY_OPENGL=1 DEPLOY_VULKAN=1 DEPLOY_PIPEWIRE=1 \
86+
./quick-sharun /usr/bin/azahar* /usr/lib/libgamemode.so*
87+
ln ./AppDir/sharun ./AppDir/AppRun
11388

114-
# Prepare sharun
115-
if [ "$ARCH" = 'aarch64' ]; then # allow using host vk for aarch64 given the sad situation
116-
echo 'SHARUN_ALLOW_SYS_VKICD=1' >> ./.env
89+
# allow using host vk for aarch64 given the sad situation
90+
if [ "$ARCH" = 'aarch64' ]; then
91+
echo 'SHARUN_ALLOW_SYS_VKICD=1' >> ./AppDir/.env
11792
fi
118-
ln ./sharun ./AppRun
119-
./sharun -g
120-
121-
# turn appdir into appimage
122-
cd ..
123-
wget -q "$URUNTIME" -O ./uruntime
124-
chmod +x ./uruntime
125-
126-
#Add udpate info to runtime
127-
echo "Adding update information \"$UPINFO\" to runtime..."
128-
./uruntime --appimage-addupdinfo "$UPINFO"
129-
130-
echo "Generating AppImage..."
131-
./uruntime --appimage-mkdwarfs -f \
132-
--set-owner 0 --set-group 0 \
133-
--no-history --no-create-timestamp \
134-
--compression zstd:level=22 -S26 -B8 \
135-
--header uruntime \
136-
-i ./AppDir -o Azahar-Enhanced-"$VERSION"-anylinux-"$ARCH".AppImage
13793

138-
echo "Generating zsync file..."
139-
zsyncmake *.AppImage -u *.AppImage
140-
echo "All Done!"
94+
# MAKE APPIMAGE WITH URUNTIME
95+
wget --retry-connrefused --tries=30 "$URUNTIME" -O ./uruntime2appimage
96+
chmod +x ./uruntime2appimage
97+
./uruntime2appimage

0 commit comments

Comments
 (0)