|
2 | 2 |
|
3 | 3 | set -eux |
4 | 4 |
|
5 | | -export ARCH="$(uname -m)" |
6 | | -export APPIMAGE_EXTRACT_AND_RUN=1 |
7 | | -export VERSION="$(cat ~/version)" |
8 | | -export STRACE_TIME=20 |
9 | | -export OUTNAME=GIMP-"$VERSION"-anylinux-"$ARCH".AppImage |
10 | | -export OPTIMIZE_LAUNCH=1 |
11 | | -export DESKTOP=/usr/share/applications/gimp.desktop |
12 | | -export ICON=/usr/share/icons/hicolor/256x256/apps/gimp.png |
13 | | -export UPINFO="gh-releases-zsync|${GITHUB_REPOSITORY%/*}|${GITHUB_REPOSITORY#*/}|latest|*$ARCH.AppImage.zsync" |
14 | | - |
15 | | -LIB4BN="https://raw.githubusercontent.com/VHSgunzo/sharun/refs/heads/main/lib4bin" |
| 5 | +ARCH="$(uname -m)" |
| 6 | +VERSION="$(cat ~/version)" |
| 7 | +SHARUN="https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/quick-sharun.sh" |
16 | 8 | URUNTIME="https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/uruntime2appimage.sh" |
17 | 9 | PHOTOGIMP="https://github.com/Diolinux/PhotoGIMP/releases/latest/download/PhotoGIMP-linux.zip" |
18 | 10 |
|
19 | | -# Prepare AppDir |
20 | | -mkdir -p ./AppDir/etc ./AppDir/share/icons |
21 | | -cd ./AppDir |
| 11 | +export ADD_HOOKS="self-updater.bg.hook" |
| 12 | +export STRACE_TIME=15 |
| 13 | +export DEPLOY_OPENGL=1 |
| 14 | +export DEPLOY_PYTHON=1 |
| 15 | +export DEPLOY_LOCALE=1 |
| 16 | +export DEPLOY_LIBHEIF=1 |
| 17 | +export PYTHON_PACKAGES=PyGObject |
| 18 | +export DESKTOP=/usr/share/applications/gimp.desktop |
| 19 | +export ICON=/usr/share/icons/hicolor/256x256/apps/gimp.png |
| 20 | +export UPINFO="gh-releases-zsync|${GITHUB_REPOSITORY%/*}|${GITHUB_REPOSITORY#*/}|latest|*$ARCH.AppImage.zsync" |
| 21 | +export OUTNAME=GIMP-"$VERSION"-anylinux-"$ARCH".AppImage |
| 22 | +export OPTIMIZE_LAUNCH=1 |
22 | 23 |
|
23 | 24 | # ADD LIBRARIES |
24 | | -wget "$LIB4BN" -O ./lib4bin |
25 | | -chmod +x ./lib4bin |
26 | | -xvfb-run -a -- ./lib4bin -p -v -k -s -e -y \ |
27 | | - --python-pkg PyGObject \ |
28 | | - /usr/bin/gimp* \ |
29 | | - /usr/bin/gjs* \ |
30 | | - /usr/bin/gegl \ |
31 | | - /usr/lib/libgimp* \ |
32 | | - /usr/lib/gimp/*/modules/* \ |
33 | | - /usr/lib/gdk-pixbuf-*/*/*/* \ |
34 | | - /usr/lib/gtk-*/*/*/* \ |
35 | | - /usr/lib/gio/*/* \ |
36 | | - /usr/lib/babl-*/* \ |
37 | | - /usr/lib/gegl-*/* \ |
38 | | - /usr/lib/gvfs/* \ |
39 | | - /usr/lib/libcfitsio.so* \ |
40 | | - /usr/lib/libgthread-2.0.so* \ |
41 | | - /usr/lib/libheif/* \ |
42 | | - /usr/lib/libjbig2dec* \ |
43 | | - /usr/lib/libgpm* \ |
44 | | - /usr/lib/libpaper* \ |
45 | | - /usr/lib/libSDL* \ |
46 | | - /usr/lib/libXpm.so* \ |
47 | | - /usr/lib/libheif.so* \ |
48 | | - /usr/lib/libwmf* \ |
49 | | - /usr/lib/libudev.so* \ |
50 | | - /usr/lib/libaa.so* \ |
| 25 | +wget --retry-connrefused --tries=30 "$SHARUN" -O ./quick-sharun |
| 26 | +chmod +x ./quick-sharun |
| 27 | +./quick-sharun \ |
| 28 | + /usr/bin/gimp* \ |
| 29 | + /usr/bin/gjs* \ |
| 30 | + /usr/bin/gegl \ |
| 31 | + /usr/lib/libgimp* \ |
| 32 | + /usr/lib/gimp/*/modules/* \ |
| 33 | + /usr/lib/gtk-*/*/*/* \ |
| 34 | + /usr/lib/gvfs/* \ |
| 35 | + /usr/lib/libcfitsio.so* \ |
| 36 | + /usr/lib/libgthread-2.0.so* \ |
| 37 | + /usr/lib/libjbig2dec* \ |
| 38 | + /usr/lib/libXmu.so* \ |
| 39 | + /usr/lib/libwebpdemux.so* \ |
| 40 | + /usr/lib/libgs.so* \ |
| 41 | + /usr/lib/libgpm* \ |
| 42 | + /usr/lib/libpaper* \ |
| 43 | + /usr/lib/libSDL* \ |
| 44 | + /usr/lib/libXpm.so* \ |
| 45 | + /usr/lib/libwmf* \ |
| 46 | + /usr/lib/libudev.so* \ |
| 47 | + /usr/lib/libaa.so* \ |
51 | 48 | /usr/lib/libmng.so* |
52 | 49 |
|
53 | | -cp -vr /usr/share/gimp ./share |
54 | | -cp -vr /usr/share/locale ./share |
55 | | -find ./share/locale -type f ! -name '*glib*' ! -name '*gimp*' ! -name '*gegl*' -delete |
56 | | -cp -vr /usr/lib/locale ./shared/lib |
57 | | -cp -vr /usr/share/pixmaps ./share |
58 | | -cp -vr /usr/share/icons/hicolor ./share/icons |
59 | | -cp -vr /etc/gimp ./etc |
60 | | -cp -vr /usr/share/vala ./share |
61 | | -cp -vr /usr/share/gir-1.0 ./share |
62 | | -cp -vn /usr/lib/gegl-*/*.json ./shared/lib/gegl-* |
63 | | -cp -rvn /usr/lib/gimp ./shared/lib |
64 | | - |
| 50 | +cp -vr /usr/lib/locale ./AppDir/shared/lib |
| 51 | +cp -vr /usr/share/pixmaps ./AppDir/share |
| 52 | +cp -vr /etc/gimp ./AppDir/etc |
| 53 | +cp -vr /usr/share/vala ./AppDir/share |
| 54 | +cp -vr /usr/share/gir-1.0 ./AppDir/share |
| 55 | +cp -rvn /usr/lib/gimp ./AppDir/shared/lib |
65 | 56 |
|
66 | 57 | # sharun the gimp plugins |
67 | 58 | echo "Sharunning the gimp plugins..." |
68 | | -bins_to_find="$(find ./lib/gimp -exec file {} \; | grep -i 'elf.*executable' | awk -F':' '{print $1}')" |
| 59 | +bins_to_find="$(find ./AppDir/lib/gimp -exec file {} \; | grep -i 'elf.*executable' | awk -F':' '{print $1}')" |
69 | 60 | for plugin in $bins_to_find; do |
70 | | - mv -v "$plugin" ./shared/bin && ln ./sharun "$plugin" |
| 61 | + mv -v "$plugin" ./AppDir/shared/bin && ln -f ./AppDir/sharun "$plugin" |
71 | 62 | echo "Sharan $plugin" |
72 | 63 | done |
73 | 64 |
|
74 | | -# HACK |
75 | | -find ./lib -type f -name 'libgimpwidgets*' -exec sed -i 's|/usr/share|/tmp/xdg69|g' {} \; |
76 | | - |
77 | | -# HACK2 |
78 | | -find ./lib -type f -name 'libgegl*' -exec sed -i 's|/usr/lib|/tmp/o_0|g' {} \; |
79 | | -echo 'unset GEGL_PATH' > ./.env |
80 | | - |
81 | | -# PREPARE SHARUN |
82 | | -chmod +x ./AppRun |
83 | | -./sharun -g |
84 | | - |
85 | 65 | # ADD PHOTOGIMP |
86 | | -wget "$PHOTOGIMP" -O ./PhotoGIMP.zip |
| 66 | +wget --retry-connrefused --tries=30 "$PHOTOGIMP" -O ./PhotoGIMP.zip |
87 | 67 | unzip ./PhotoGIMP.zip |
88 | 68 | rm -f ./PhotoGIMP.zip |
89 | | -mv -v ./PhotoGIMP-linux ./PhotoGIMP |
90 | | -mv -v ./PhotoGIMP/.local/share/applications/org.gimp.GIMP.desktop \ |
91 | | - ./PhotoGIMP/.local/share/applications/PhotoGIMP-AppImage.desktop |
| 69 | +mv -v ./PhotoGIMP-linux ./AppDir/PhotoGIMP |
| 70 | +mv -v ./AppDir/PhotoGIMP/.local/share/applications/org.gimp.GIMP.desktop \ |
| 71 | + ./AppDir/PhotoGIMP/.local/share/applications/PhotoGIMP-AppImage.desktop |
92 | 72 |
|
93 | | -if ! grep -q 'StartupWMClass=' ./PhotoGIMP/.local/share/applications/PhotoGIMP-AppImage.desktop; then |
94 | | - echo 'StartupWMClass=gimp' >> ./PhotoGIMP/.local/share/applications/PhotoGIMP-AppImage.desktop |
| 73 | +if ! grep -q 'StartupWMClass=' ./AppDir/PhotoGIMP/.local/share/applications/PhotoGIMP-AppImage.desktop; then |
| 74 | + echo 'StartupWMClass=gimp' >> ./AppDir/PhotoGIMP/.local/share/applications/PhotoGIMP-AppImage.desktop |
95 | 75 | fi |
96 | | -if ! grep -q 'TryExec=' ./PhotoGIMP/.local/share/applications/PhotoGIMP-AppImage.desktop; then |
97 | | - echo 'TryExec=gimp' >> ./PhotoGIMP/.local/share/applications/PhotoGIMP-AppImage.desktop |
| 76 | +if ! grep -q 'TryExec=' ./AppDir/PhotoGIMP/.local/share/applications/PhotoGIMP-AppImage.desktop; then |
| 77 | + echo 'TryExec=gimp' >> ./AppDir/PhotoGIMP/.local/share/applications/PhotoGIMP-AppImage.desktop |
98 | 78 | fi |
99 | 79 |
|
100 | 80 | sed -i -e 's|Exec=.*|Exec=env ENABLE_PHOTO_GIMP=1 gimp %U|g' \ |
101 | 81 | -e 's|StartupWMClass=.*|StartupWMClass=gimp|g' \ |
102 | | - -e 's|TryExec=.*|TryExec=gimp|g' ./PhotoGIMP/.local/share/applications/PhotoGIMP-AppImage.desktop |
| 82 | + -e 's|TryExec=.*|TryExec=gimp|g' ./AppDir/PhotoGIMP/.local/share/applications/PhotoGIMP-AppImage.desktop |
103 | 83 |
|
104 | 84 | # Fix wrong window class in .desktop |
105 | | -sed -i 's|StartupWMClass=.*|StartupWMClass=gimp|' "$DESKTOP" |
106 | | - |
107 | | -# TODO remove me once we migrate to quick-sharun |
108 | | -cp -v "$DESKTOP" ./ |
109 | | -cp -v "$ICON" ./ |
110 | | -cp -v "$ICON" ./.DirIcon |
| 85 | +sed -i 's|StartupWMClass=.*|StartupWMClass=gimp|' ./AppDir/*.desktop |
111 | 86 |
|
112 | 87 | # MAKE APPIMAGE WITH URUNTIME |
113 | | -cd .. |
114 | 88 | wget --retry-connrefused --tries=30 "$URUNTIME" -O ./uruntime2appimage |
115 | 89 | chmod +x ./uruntime2appimage |
116 | 90 | ./uruntime2appimage |
117 | 91 |
|
118 | 92 | UPINFO="$(echo "$UPINFO" | sed 's#.AppImage.zsync#*.AppBundle.zsync#g')" |
119 | | -wget -O ./pelf "https://github.com/xplshn/pelf/releases/latest/download/pelf_$ARCH" |
| 93 | +wget -O ./pelf "https://github.com/xplshn/pelf/releases/latest/download/pelf_$ARCH" |
120 | 94 | chmod +x ./pelf |
121 | 95 | echo "Generating [dwfs]AppBundle...(Go runtime)" |
122 | 96 | ./pelf --add-appdir ./AppDir \ |
123 | 97 | --appbundle-id="org.gimp.GIMP#github.com/$GITHUB_REPOSITORY:$VERSION@$(date +%d_%m_%Y)" \ |
124 | 98 | --appimage-compat \ |
125 | 99 | --disable-use-random-workdir \ |
126 | 100 | --add-updinfo "$UPINFO" \ |
127 | | - --compression "-C zstd:level=22 -S25 -B8" \ |
128 | | - --output-to GIMP-"$VERSION"-anylinux-"$ARCH".dwfs.AppBundle |
| 101 | + --compression "-C zstd:level=22 -S26 -B8" \ |
| 102 | + --output-to ./GIMP-"$VERSION"-anylinux-"$ARCH".dwfs.AppBundle |
129 | 103 |
|
130 | 104 | echo "Generating zsync file..." |
131 | | -zsyncmake *.AppBundle -u *.AppBundle |
| 105 | +zsyncmake ./*.AppBundle -u ./*.AppBundle |
132 | 106 |
|
133 | 107 | mkdir -p ./dist |
134 | 108 | mv -v ./*.AppImage* ./dist |
|
0 commit comments