|
2 | 2 |
|
3 | 3 | set -eux |
4 | 4 |
|
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 |
40 | 16 |
|
41 | 17 | # 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 |
60 | 21 |
|
61 | 22 | # 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 |
68 | 26 |
|
| 27 | +# make appbundle |
69 | 28 | UPINFO="$(echo "$UPINFO" | sed 's#.AppImage.zsync#*.AppBundle.zsync#g')" |
70 | 29 | wget -O ./pelf "https://github.com/xplshn/pelf/releases/latest/download/pelf_$(uname -m)" |
71 | 30 | chmod +x ./pelf |
72 | 31 | echo "Generating [dwfs]AppBundle..." |
73 | 32 | ./pelf --add-appdir ./AppDir \ |
74 | 33 | --appimage-compat \ |
75 | 34 | --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)" \ |
77 | 36 | --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 |
80 | 38 | zsyncmake ./*.AppBundle -u ./*.AppBundle |
81 | 39 |
|
| 40 | +mkdir -p ./dist |
| 41 | +mv -v ./*.AppImage* ./dist |
| 42 | +mv -v ~/version ./dist |
| 43 | + |
82 | 44 | echo "All Done!" |
0 commit comments