11#! /bin/sh
22
3- set -ex
3+ set -eux
44
55ARCH=" $( uname -m) "
6- SHARUN=" https://github.com/VHSgunzo/sharun/releases/latest/download/sharun-$ARCH -aio"
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 "
9- UPINFO=" gh-releases-zsync|$( echo " $GITHUB_REPOSITORY " | tr ' /' ' |' ) |latest|*$ARCH .AppImage.zsync"
10- PATCH=" $PWD " /hack.patch
11-
12- # CREATE DIRECTORIES
13- mkdir ./AppDir && (
14- cd ./AppDir
15- # DOWNLOAD AND BUILD ROFI
16- git clone --depth 1 " https://github.com/davatorium/rofi.git" ./rofi && (
17- cd ./rofi
18- patch -p1 -i " $PATCH "
19- meson --prefix /usr . build
20- meson compile -C build
21- meson install -C build --destdir " $( realpath ../) "
22- )
23- mv -v ./usr/* ./
24- cp -v ./share/icons/hicolor/scalable/apps/rofi.svg ./
25- cp -v ./share/icons/hicolor/scalable/apps/rofi.svg ./.DirIcon
26- cp -v ./share/applications/rofi.desktop ./
27- echo " Categories=Utility;" >> ./rofi.desktop
28-
29- # ADD LIBRARIES
30- wget --retry-connrefused --tries=30 " $SHARUN " -O ./sharun-aio
31- chmod +x ./sharun-aio
32- ./sharun-aio l -p -v -k -s \
33- ./bin/* \
34- /usr/lib/gdk-pixbuf-* /* /* /* \
35- /usr/lib/gio/modules/libgvfsdbus.so
36- rm -rf ./sharun-aio ./rofi ./usr
37-
38- # AppRun
39- cat > ./AppRun << -'EOF '
40- #!/bin/sh
41- CURRENTDIR="$(dirname "$(readlink -f "$0")")"
42-
43- BIN="${ARGV0#./}"
44- unset ARGV0
45- DATADIR="${XDG_DATA_HOME:-$HOME/.local/share}"
46-
47- export XDG_DATA_DIRS="$DATADIR:$XDG_DATA_DIRS:/usr/local/share:/usr/share"
48- export PATH="$CURRENTDIR/bin:$PATH"
49-
50- if [ ! -d "$DATADIR"/rofi/themes ]; then
51- mkdir -p "$DATADIR"/rofi || exit 1
52- cp -rn "$CURRENTDIR"/share/rofi/themes "$DATADIR"/rofi/themes || exit 1
53- fi
54-
55- if [ "$1" = "rofi-theme-selector" ]; then
56- shift
57- exec "$CURRENTDIR/bin/rofi-theme-selector" "$@"
58- elif [ -f "$CURRENTDIR/bin/$BIN" ]; then
59- exec "$CURRENTDIR/bin/$BIN" "$@"
60- else
61- exec "$CURRENTDIR/bin/rofi" "$@"
62- fi
63- EOF
64-
65- chmod a+x ./AppRun
66- ./sharun -g
67- )
68-
69- export VERSION=" $( ./AppDir/AppRun -v | awk -F' [- ]' ' {print $2; exit}' ) "
70- echo " $VERSION " > ~ /version
71-
72- # turn appdir into appimage
73- wget --retry-connrefused --tries=30 " $URUNTIME " -O ./uruntime
74- wget --retry-connrefused --tries=30 " $URUNTIME_LITE " -O ./uruntime-lite
75- chmod +x ./uruntime*
76-
77- # Keep the mount point (speeds up launch time)
78- sed -i ' s|URUNTIME_MOUNT=[0-9]|URUNTIME_MOUNT=0|' ./uruntime-lite
79-
80- # Add udpate info to runtime
81- echo " Adding update information \" $UPINFO \" to runtime..."
82- ./uruntime-lite --appimage-addupdinfo " $UPINFO "
83-
84- echo " Generating AppImage..."
85- ./uruntime \
86- --appimage-mkdwarfs -f \
87- --set-owner 0 --set-group 0 \
88- --no-history --no-create-timestamp \
89- --compression zstd:level=22 -S26 -B8 \
90- --header uruntime-lite \
91- -i ./AppDir \
92- -o ./rofi-" $VERSION " -anylinux-" $ARCH " .AppImage
6+ VERSION=" $( cat ~ /version) "
7+ SHARUN=" https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/execv-hook/useful-tools/quick-sharun.sh"
8+ URUNTIME=" https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/uruntime2appimage.sh"
9+ UPDATER=" https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/self-updater.bg.hook"
10+
11+ export UPINFO=" gh-releases-zsync|${GITHUB_REPOSITORY%/* } |${GITHUB_REPOSITORY#*/ } |latest|*$ARCH .AppImage.zsync"
12+ export OUTNAME=rofi-" $VERSION " -anylinux-" $ARCH " .AppImage
13+ export DESKTOP=/usr/share/applications/rofi.desktop
14+ export ICON=/usr/share/icons/hicolor/scalable/apps/rofi.svg
15+ export URUNTIME_PRELOAD=1 # really needed here
16+ export EXEC_WRAPPER=1 # needed here since this will launch other processes
17+
18+ # ADD LIBRARIES
19+ wget --retry-connrefused --tries=30 " $SHARUN " -O ./quick-sharun
20+ chmod +x ./quick-sharun
21+ ./quick-sharun /usr/bin/rofi*
22+ echo ' unset ARGV0' > ./AppDir/.env
23+
24+ # MAKE APPIMAGE WITH URUNTIME
25+ wget --retry-connrefused --tries=30 " $URUNTIME " -O ./uruntime2appimage
26+ chmod +x ./uruntime2appimage
27+ ./uruntime2appimage
9328
9429# make appbundle
9530UPINFO=" $( echo " $UPINFO " | sed ' s#.AppImage.zsync#*.AppBundle.zsync#g' ) "
@@ -106,11 +41,10 @@ echo "Generating [dwfs]AppBundle..."
10641 --output-to ./rofi-" $VERSION " -anylinux-" $ARCH " .dwfs.AppBundle
10742
10843echo " Generating zsync file..."
109- zsyncmake ./* .AppImage -u ./* .AppImage
11044zsyncmake ./* .AppBundle -u ./* .AppBundle
11145
11246mkdir -p ./dist
113- mv -v ./* .AppImage* ./dist
47+ mv -v ./* .AppImage* ./dist
11448mv -v ./* .AppBundle* ./dist
11549
11650echo " All Done!"
0 commit comments