Skip to content

Commit 836e9db

Browse files
authored
deploy with wrapper scripts
1 parent cd919e1 commit 836e9db

File tree

1 file changed

+24
-62
lines changed

1 file changed

+24
-62
lines changed

sonic-appimage.sh

Lines changed: 24 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -2,81 +2,43 @@
22

33
set -eux
44

5-
PACKAGE=UnleashedRecomp
6-
ICON="https://raw.githubusercontent.com/hedge-dev/UnleashedRecompResources/e5a4adccb30734321ac17347090abeb6690dab70/images/game_icon.png"
7-
8-
export ARCH="$(uname -m)"
9-
export APPIMAGE_EXTRACT_AND_RUN=1
10-
11-
UPINFO="gh-releases-zsync|$(echo "$GITHUB_REPOSITORY" | tr '/' '|')|latest|*$ARCH.AppImage.zsync"
12-
LIB4BN="https://raw.githubusercontent.com/VHSgunzo/sharun/refs/heads/main/lib4bin"
13-
APPIMAGETOOL="https://github.com/pkgforge-dev/appimagetool-uruntime/releases/download/continuous/appimagetool-$ARCH.AppImage"
14-
BINARY=$(wget "https://api.github.com/repos/Jujstme/UnleashedRecomp/releases" -O - \
15-
| sed 's/[()",{} ]/\n/g' | grep -oi "https.*unleashed.*.zip$" | head -1)
16-
VERSION=$(echo "$BINARY" | awk -F'/' '{print $(NF-1)}')
17-
echo "$VERSION" > ~/version
18-
19-
# Prepare AppDir
20-
mkdir -p ./AppDir/shared/bin
21-
cd ./AppDir
22-
23-
wget "$ICON" -O ./unleashedrecomp.png
24-
ln -s unleashedrecomp.png ./.DirIcon
25-
26-
echo '[Desktop Entry]
27-
Name=Unleashed Recompiled
28-
Exec=UnleashedRecomp --sdl-video-driver wayland
29-
Type=Application
30-
Icon=unleashedrecomp
31-
Categories=Game;
32-
Comment=Static recompilation of Sonic Unleashed
33-
MimeType=x-scheme-handler/unleashedrecomp
34-
StartupWMClass=UnleashedRecomp' > ./unleashedrecomp.desktop
35-
36-
wget "$BINARY" -O ./bin.zip
37-
unzip ./bin.zip
38-
rm -f ./bin.zip
39-
mv -v ./UnleashedRecomp ./shared/bin
5+
ARCH="$(uname -m)"
6+
VERSION="$(cat ~/version)"
7+
URUNTIME="https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/uruntime2appimage.sh"
8+
SHARUN="https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/quick-sharun.sh"
9+
10+
export DESKTOP=/usr/share/applications/io.github.hedge_dev.unleashedrecomp.desktop
11+
export ICON=/usr/share/icons/hicolor/128x128/apps/io.github.hedge_dev.unleashedrecomp.png
12+
export UPINFO="gh-releases-zsync|${GITHUB_REPOSITORY%/*}|${GITHUB_REPOSITORY#*/}|latest|*$ARCH.AppImage.zsync"
13+
export OUTNAME=UnleashedRecomp-"$VERSION"-anylinux-"$ARCH".AppImage
14+
export DEPLOY_PIPEWIRE=1
15+
export DEPLOY_VULKAN=1
4016

4117
# ADD LIBRARIES
42-
wget "$LIB4BN" -O ./lib4bin
43-
chmod +x ./lib4bin
44-
xvfb-run -a -- ./lib4bin -p -v -e -s -k \
45-
./shared/bin/UnleashedRecomp \
46-
/usr/lib/gconv/* \
47-
/usr/lib/libvulkan* \
48-
/usr/lib/libwayland* \
49-
/usr/lib/gtk-3*/*/* \
50-
/usr/lib/dri/* \
51-
/usr/lib/libXss.so* \
52-
/usr/lib/pulseaudio/* \
53-
/usr/lib/pipewire-0.3/* \
54-
/usr/lib/spa-0.2/*/*
55-
56-
# Prepare sharun
57-
echo "Preparing sharun..."
58-
ln ./sharun ./AppRun
59-
./sharun -g
18+
wget --retry-connrefused --tries=30 "$SHARUN" -O ./quick-sharun
19+
chmod +x ./quick-sharun
20+
./quick-sharun /usr/bin/UnleashedRecomp
6021

6122
# MAKE APPIMAGE WITH URUNTIME
62-
cd ..
63-
wget "$APPIMAGETOOL" -O ./appimagetool
64-
chmod +x ./appimagetool
65-
66-
echo "Generating AppImage..."
67-
./appimagetool -n -u "$UPINFO" "$PWD"/AppDir "$PWD"/"$PACKAGE"-"$VERSION"-anylinux-"$ARCH".AppImage
23+
wget --retry-connrefused --tries=30 "$URUNTIME" -O ./uruntime2appimage
24+
chmod +x ./uruntime2appimage
25+
./uruntime2appimage
6826

27+
# make appbundle
6928
UPINFO="$(echo "$UPINFO" | sed 's#.AppImage.zsync#*.AppBundle.zsync#g')"
7029
wget -O ./pelf "https://github.com/xplshn/pelf/releases/latest/download/pelf_$(uname -m)"
7130
chmod +x ./pelf
7231
echo "Generating [dwfs]AppBundle..."
7332
./pelf --add-appdir ./AppDir \
7433
--appimage-compat \
7534
--add-updinfo "$UPINFO" \
76-
--appbundle-id="$PACKAGE#github.com/$GITHUB_REPOSITORY:$VERSION@$(date +%d_%m_%Y)" \
35+
--appbundle-id="UnleashedRecomp#github.com/$GITHUB_REPOSITORY:$VERSION@$(date +%d_%m_%Y)" \
7736
--compression "-C zstd:level=22 -S26 -B8" \
78-
--output-to "$PACKAGE-$VERSION-anylinux-$ARCH.dwfs.AppBundle"
79-
37+
--output-to ./UnleashedRecomp-"$VERSION"-anylinux-"$ARCH".AppImage
8038
zsyncmake ./*.AppBundle -u ./*.AppBundle
8139

40+
mkdir -p ./dist
41+
mv -v ./*.AppImage* ./dist
42+
mv -v ~/version ./dist
43+
8244
echo "All Done!"

0 commit comments

Comments
 (0)