|
1 | 1 | #!/bin/sh |
2 | 2 |
|
3 | | -set -eu |
4 | | - |
5 | | -PACKAGE=strawberry |
6 | | -DESKTOP=org.strawberrymusicplayer.strawberry.desktop |
7 | | -ICON=strawberry.png |
8 | | - |
9 | | -export ARCH="$(uname -m)" |
10 | | -export APPIMAGE_EXTRACT_AND_RUN=1 |
11 | | -export VERSION=$(pacman -Q "$PACKAGE" | awk 'NR==1 {print $2; exit}') |
12 | | -echo "$VERSION" > ~/version |
13 | | - |
14 | | -UPINFO="gh-releases-zsync|$(echo "$GITHUB_REPOSITORY" | tr '/' '|')|latest|*$ARCH.AppImage.zsync" |
15 | | -LIB4BN="https://raw.githubusercontent.com/VHSgunzo/sharun/refs/heads/main/lib4bin" |
16 | | -URUNTIME="https://github.com/VHSgunzo/uruntime/releases/latest/download/uruntime-appimage-dwarfs-$ARCH" |
17 | | - |
18 | | -# Prepare AppDir |
19 | | -mkdir -p ./AppDir/shared/lib |
20 | | -cd ./AppDir |
21 | | - |
22 | | -cp -v /usr/share/applications/"$DESKTOP" ./ |
23 | | -cp -v /usr/share/icons/hicolor/128x128/apps/"$ICON" ./ |
24 | | -cp -v /usr/share/icons/hicolor/128x128/apps/"$ICON" ./.DirIcon |
| 3 | +set -eux |
| 4 | + |
| 5 | +ARCH="$(uname -m)" |
| 6 | +URUNTIME="https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/uruntime2appimage.sh" |
| 7 | +SHARUN="https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/quick-sharun.sh" |
| 8 | +VERSION="$(cat ~/version)" |
| 9 | + |
| 10 | +export ADD_HOOKS="self-updater.bg.hook" |
| 11 | +export DESKTOP=/usr/share/applications/org.strawberrymusicplayer.strawberry.desktop |
| 12 | +export ICON=/usr/share/icons/hicolor/128x128/apps/strawberry.png |
| 13 | +export UPINFO="gh-releases-zsync|${GITHUB_REPOSITORY%/*}|${GITHUB_REPOSITORY#*/}|latest|*$ARCH.AppImage.zsync" |
| 14 | +export OUTNAME=strawberry-"$VERSION"-anylinux-"$ARCH".AppImage |
| 15 | +export DEPLOY_OPENGL=1 |
| 16 | +export DEPLOY_PIPEWIRE=1 |
| 17 | +export DEPLOY_GSTREAMER=1 |
25 | 18 |
|
26 | 19 | # ADD LIBRARIES |
27 | | -wget "$LIB4BN" -O ./lib4bin |
28 | | -chmod +x ./lib4bin |
29 | | -xvfb-run -a -- ./lib4bin -p -v -s -k -e \ |
30 | | - /usr/bin/strawberry* \ |
31 | | - /usr/lib/libgst* \ |
32 | | - /usr/lib/gstreamer-*/*.so \ |
33 | | - /usr/lib/qt6/plugins/iconengines/* \ |
34 | | - /usr/lib/qt6/plugins/imageformats/* \ |
35 | | - /usr/lib/qt6/plugins/platforms/* \ |
36 | | - /usr/lib/qt6/plugins/platformthemes/* \ |
37 | | - /usr/lib/qt6/plugins/styles/* \ |
38 | | - /usr/lib/qt6/plugins/sqldrivers/* \ |
39 | | - /usr/lib/qt6/plugins/tls/* \ |
40 | | - /usr/lib/qt6/plugins/xcbglintegrations/* \ |
41 | | - /usr/lib/qt6/plugins/wayland-*/* \ |
42 | | - /usr/lib/pulseaudio/* \ |
43 | | - /usr/lib/pipewire-*/* \ |
44 | | - /usr/lib/spa-*/*/* |
45 | | - |
46 | | -# DEPLOY GSTREAMER |
47 | | -echo "Deploying Gstreamer binaries..." |
48 | | -cp -vn /usr/lib/gstreamer-*/* ./shared/lib/gstreamer-* || true |
49 | | - |
50 | | -# Patch a relative interpreter for the gstreamer plugins |
51 | | -echo "Sharunning Gstreamer bins..." |
52 | | -rm -f ./shared/lib/gstreamer-1.0/libgstopengl* || true |
53 | | -for plugin in ./shared/lib/gstreamer-1.0/gst-*; do |
54 | | - if file "$plugin" | grep -i 'elf.*executable'; then |
55 | | - mv "$plugin" ./shared/bin && ln -s ../../../sharun "$plugin" |
56 | | - echo "Sharan $plugin" |
57 | | - else |
58 | | - echo "$plugin is not a binary, skipping..." |
59 | | - fi |
60 | | -done |
61 | | - |
62 | | -# Prepare sharun |
63 | | -ln ./sharun ./AppRun |
64 | | -./sharun -g |
65 | | - |
66 | | -# Remove bloats |
67 | | -echo "Removing bloats..." |
68 | | -rm -f ./shared/lib/libLLVM* ./shared/lib/libgallium* || true |
| 20 | +wget --retry-connrefused --tries=30 "$SHARUN" -O ./quick-sharun |
| 21 | +chmod +x ./quick-sharun |
| 22 | +./quick-sharun /usr/bin/strawberry* |
69 | 23 |
|
70 | 24 | # MAKE APPIMAGE WITH URUNTIME |
71 | | -cd .. |
72 | | -wget -q "$URUNTIME" -O ./uruntime |
73 | | -chmod +x ./uruntime |
74 | | - |
75 | | -#Add udpate info to runtime |
76 | | -echo "Adding update information \"$UPINFO\" to runtime..." |
77 | | -printf "$UPINFO" > data.upd_info |
78 | | -llvm-objcopy --update-section=.upd_info=data.upd_info \ |
79 | | - --set-section-flags=.upd_info=noload,readonly ./uruntime |
80 | | -printf 'AI\x02' | dd of=./uruntime bs=1 count=3 seek=8 conv=notrunc |
81 | | - |
82 | | -echo "Generating AppImage..." |
83 | | -./uruntime --appimage-mkdwarfs -f \ |
84 | | - --set-owner 0 --set-group 0 \ |
85 | | - --no-history --no-create-timestamp \ |
86 | | - --compression zstd:level=22 -S26 -B8 \ |
87 | | - --header uruntime \ |
88 | | - -i ./AppDir -o "$PACKAGE"-"$VERSION"-anylinux-"$ARCH".AppImage |
| 25 | +wget --retry-connrefused --tries=30 "$URUNTIME" -O ./uruntime2appimage |
| 26 | +chmod +x ./uruntime2appimage |
| 27 | +./uruntime2appimage |
89 | 28 |
|
90 | | -echo "Generating zsync file..." |
91 | | -zsyncmake *.AppImage -u *.AppImage |
92 | | -echo "All Done!" |
| 29 | +mkdir -p ./dist |
| 30 | +mv -v ./*.AppImage* ./dist |
| 31 | +mv -v ~/version ./dist |
0 commit comments