Skip to content

Commit 77067e6

Browse files
authored
simplify deployment with wrapper script, refactor
1 parent a2f141d commit 77067e6

File tree

1 file changed

+19
-38
lines changed

1 file changed

+19
-38
lines changed

citron-appimage.sh

Lines changed: 19 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
set -ex
44

55
ARCH="$(uname -m)"
6-
SHARUN="https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/quick-sharun.sh"
7-
URUNTIME="https://github.com/VHSgunzo/uruntime/releases/latest/download/uruntime-appimage-dwarfs-$ARCH"
8-
URUNTIME_LITE="https://github.com/VHSgunzo/uruntime/releases/latest/download/uruntime-appimage-dwarfs-lite-$ARCH"
96

107
if [ "$1" = 'v3' ] && [ "$ARCH" = 'x86_64' ]; then
118
echo "Making x86-64-v3 optimized build of citron..."
@@ -19,8 +16,6 @@ else
1916
ARCH_FLAGS="-march=armv8-a -mtune=generic -O3"
2017
fi
2118

22-
UPINFO="gh-releases-zsync|$(echo "$GITHUB_REPOSITORY" | tr '/' '|')|latest|*$ARCH.AppImage.zsync"
23-
2419
# BUILD CITRON, fallback to mirror if upstream repo fails to clone
2520
git clone --recursive "https://git.citron-emu.org/citron/emu.git" ./citron && (
2621
cd ./citron
@@ -74,13 +69,21 @@ git clone --recursive "https://git.citron-emu.org/citron/emu.git" ./citron && (
7469
echo "$VERSION" >~/version
7570
)
7671
rm -rf ./citron
72+
73+
# Deploy AppImage
7774
VERSION="$(cat ~/version)"
75+
URUNTIME="https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/uruntime2appimage.sh"
76+
SHARUN="https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/quick-sharun.sh"
77+
78+
export ADD_HOOKS="self-updater.bg.hook"
79+
export UPINFO="gh-releases-zsync|${GITHUB_REPOSITORY%/*}|${GITHUB_REPOSITORY#*/}|latest|*$ARCH.AppImage.zsync"
80+
export OUTNAME=Citron-"$VERSION"-anylinux-"$ARCH".AppImage
81+
export DESKTOP=/usr/share/applications/org.citron_emu.citron.desktop
82+
export ICON=/usr/share/icons/hicolor/scalable/apps/org.citron_emu.citron.svg
83+
export DEPLOY_OPENGL=1
84+
export DEPLOY_VULKAN=1
85+
export DEPLOY_PIPEWIRE=1
7886

79-
# PREPARE APPDIR
80-
mkdir -p ./AppDir
81-
cp -v /usr/share/applications/*citron*.desktop ./AppDir
82-
cp -v /usr/share/icons/hicolor/scalable/apps/*citron*.svg ./AppDir
83-
cp -v /usr/share/icons/hicolor/scalable/apps/*citron*.svg ./AppDir/.DirIcon
8487
if [ "$DEVEL" = 'true' ]; then
8588
sed -i 's|Name=citron|Name=citron nightly|' ./AppDir/*.desktop
8689
UPINFO="$(echo "$UPINFO" | sed 's|latest|nightly|')"
@@ -89,36 +92,14 @@ fi
8992
# ADD LIBRARIES
9093
wget --retry-connrefused --tries=30 "$SHARUN" -O ./quick-sharun
9194
chmod +x ./quick-sharun
92-
DEPLOY_OPENGL=1 DEPLOY_VULKAN=1 DEPLOY_PIPEWIRE=1 \
93-
./quick-sharun /usr/bin/citron* /usr/lib/libgamemode.so*
94-
ln ./AppDir/sharun ./AppDir/AppRun
95+
./quick-sharun /usr/bin/citron* /usr/lib/libgamemode.so*
9596

96-
# Prepare sharun
97+
# allow the host vulkan to be used for aarch64 given the sad situation
9798
if [ "$ARCH" = 'aarch64' ]; then
98-
# allow the host vulkan to be used for aarch64 given the sad situation
9999
echo 'SHARUN_ALLOW_SYS_VKICD=1' > ./AppDir/.env
100100
fi
101101

102-
# turn appdir into appimage
103-
wget --retry-connrefused --tries=30 "$URUNTIME" -O ./uruntime
104-
wget --retry-connrefused --tries=30 "$URUNTIME_LITE" -O ./uruntime-lite
105-
chmod +x ./uruntime*
106-
107-
# Add udpate info to runtime
108-
echo "Adding update information \"$UPINFO\" to runtime..."
109-
./uruntime-lite --appimage-addupdinfo "$UPINFO"
110-
111-
echo "Generating AppImage..."
112-
./uruntime \
113-
--appimage-mkdwarfs -f \
114-
--set-owner 0 --set-group 0 \
115-
--no-history --no-create-timestamp \
116-
--compression zstd:level=22 -S26 -B8 \
117-
--header uruntime-lite \
118-
-i ./AppDir \
119-
-o ./Citron-"$VERSION"-anylinux-"$ARCH".AppImage
120-
121-
echo "Generating zsync file..."
122-
zsyncmake *.AppImage -u *.AppImage
123-
124-
echo "All Done!"
102+
# MAKE APPIMAGE WITH URUNTIME
103+
wget --retry-connrefused --tries=30 "$URUNTIME" -O ./uruntime2appimage
104+
chmod +x ./uruntime2appimage
105+
./uruntime2appimage

0 commit comments

Comments
 (0)