@@ -4,54 +4,79 @@ set -ex
4
4
script_dir=" $( dirname " $0 " ) "
5
5
toplvl_dir=" $( realpath " $script_dir /../../" ) "
6
6
bin_dir=" $toplvl_dir /Bin/AppImage" # RMG should be installed here
7
+ lib_dir=" /usr/lib64"
8
+
9
+ XVFB_RUN=" xvfb-run -a --"
7
10
UPINFO=" gh-releases-zsync|$( echo " $GITHUB_REPOSITORY " | tr ' /' ' |' ) |latest|*.AppImage.zsync"
8
- LIB4BN=" https://raw.githubusercontent.com/VHSgunzo/sharun/refs/heads/main/lib4bin"
9
- APPIMAGETOOL=" https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
11
+ LIB4BIN_URL=" https://raw.githubusercontent.com/VHSgunzo/sharun/refs/heads/main/lib4bin"
12
+ APPIMAGETOOL_URL=" https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
13
+ SHARUN_URL=" https://github.com/VHSgunzo/sharun/releases/latest/download/sharun-x86_64"
10
14
11
- export ARCH=" $( uname -m) "
15
+ export ARCH=$( uname -m)
12
16
export APPIMAGE_EXTRACT_AND_RUN=1
13
17
export VERSION=" $( git describe --tags --always) "
14
18
export OUTPUT=" $bin_dir /../RMG-Portable-Linux64-$VERSION .AppImage"
15
- export LD_LIBRARY_PATH=" $toplvl_dir /Build/AppImage/Source/RMG-Core" # hack
19
+ export LD_LIBRARY_PATH=" $toplvl_dir /Build/AppImage/Source/RMG-Core" # hack
20
+ export SHARUN=" $script_dir /sharun"
16
21
17
- cp " $bin_dir " /usr/share/applications/com.github.Rosalie241.RMG.desktop " $bin_dir "
18
- cp " $bin_dir " /usr/share/icons/hicolor/scalable/apps/com.github.Rosalie241.RMG.svg " $bin_dir "
19
- ln -s ./com.github.Rosalie241.RMG.svg " $bin_dir " /.DirIcon
20
- mv " $bin_dir " /usr/share " $bin_dir " /share
21
- mv " $bin_dir " /usr " $bin_dir " /shared
22
+ if [[ ! -f " $script_dir /lib4bin" ]]
23
+ then
24
+ curl -L " $LIB4BIN_URL " -o " $script_dir /lib4bin"
25
+ chmod +x " $script_dir /lib4bin"
26
+ fi
27
+
28
+ if [[ ! -f " $script_dir /appimagetool" ]]
29
+ then
30
+ curl -L " $APPIMAGETOOL_URL " -o " $script_dir /appimagetool"
31
+ chmod +x " $script_dir /appimagetool"
32
+ fi
33
+
34
+ if [[ ! -f " $script_dir /sharun" ]]
35
+ then
36
+ curl -L " $SHARUN_URL " -o " $script_dir /sharun"
37
+ chmod +x " $script_dir /sharun"
38
+ fi
39
+
40
+ if [[ " x$DISPLAY " != " x" ]]
41
+ then
42
+ XVFB_RUN=" "
43
+ fi
22
44
23
- if [ ! -f " ./lib4bin " ]; then
24
- curl -L " $LIB4BN " -o ./lib4bin
25
- chmod +x ./lib4bin
45
+ if [[ -d " /usr/lib/x86_64-linux-gnu/ " ]]
46
+ then
47
+ lib_dir= " /usr/lib/x86_64-linux-gnu/ "
26
48
fi
27
49
28
- xvfb-run -a -- ./lib4bin --dst-dir " $bin_dir " -p -v -r -s -k -e \
29
- " $bin_dir " /shared/bin/RMG \
30
- /usr/lib/x86_64-linux-gnu/libSDL* \
31
- /usr/lib/x86_64-linux-gnu/libGL* \
32
- /usr/lib/x86_64-linux-gnu/libEGL* \
33
- /usr/lib/x86_64-linux-gnu/libvulkan* \
34
- /usr/lib/x86_64-linux-gnu/dri/* \
35
- /usr/lib/x86_64-linux-gnu/libssl.so* \
36
- /usr/lib/x86_64-linux-gnu/qt6/plugins/iconengines/* \
37
- /usr/lib/x86_64-linux-gnu/qt6/plugins/imageformats/* \
38
- /usr/lib/x86_64-linux-gnu/qt6/plugins/platforms/* \
39
- /usr/lib/x86_64-linux-gnu/qt6/plugins/platformthemes/* \
40
- /usr/lib/x86_64-linux-gnu/qt6/plugins/styles/* \
41
- /usr/lib/x86_64-linux-gnu/qt6/plugins/xcbglintegrations/* \
42
- /usr/lib/x86_64-linux-gnu/qt6/plugins/tls/* \
43
- /usr/lib/x86_64-linux-gnu/qt6/plugins/wayland-* /*
50
+ cp " $bin_dir /usr/share/applications/com.github.Rosalie241.RMG.desktop" " $bin_dir "
51
+ cp " $bin_dir /usr/share/icons/hicolor/scalable/apps/com.github.Rosalie241.RMG.svg" " $bin_dir "
52
+ ln -s ./com.github.Rosalie241.RMG.svg " $bin_dir " /.DirIcon
53
+ mv " $bin_dir /usr/share" " $bin_dir /share"
54
+ mv " $bin_dir /usr" " $bin_dir /shared"
55
+
56
+ $XVFB_RUN " $script_dir /lib4bin" --dst-dir " $bin_dir " \
57
+ --hard-links --patch-rpath --strip \
58
+ --with-hooks --strace-mode --with-sharun \
59
+ " $bin_dir /shared/bin/RMG" \
60
+ " $lib_dir " /libSDL* \
61
+ " $lib_dir " /libGL* \
62
+ " $lib_dir " /libEGL* \
63
+ " $lib_dir " /libvulkan* \
64
+ " $lib_dir " /dri/* \
65
+ " $lib_dir " /libssl.so* \
66
+ " $lib_dir " /qt6/plugins/iconengines/* \
67
+ " $lib_dir " /qt6/plugins/imageformats/* \
68
+ " $lib_dir " /qt6/plugins/platforms/* \
69
+ " $lib_dir " /qt6/plugins/platformthemes/* \
70
+ " $lib_dir " /qt6/plugins/styles/* \
71
+ " $lib_dir " /qt6/plugins/xcbglintegrations/* \
72
+ " $lib_dir " /qt6/plugins/tls/* \
73
+ " $lib_dir " /qt6/plugins/wayland-* /*
44
74
45
75
# Prepare sharun
46
- " $bin_dir " /sharun -g
47
- cp -v " $script_dir /AppRun" " $bin_dir "
48
- chmod +x " $bin_dir " /AppRun
76
+ " $bin_dir /sharun" -g
77
+ cp " $script_dir /AppRun" " $bin_dir "
49
78
50
79
# make appimage
51
- if [ ! -f " ./appimagetool" ]; then
52
- curl -L " $APPIMAGETOOL " -o ./appimagetool
53
- chmod +x ./appimagetool
54
- fi
55
- ./appimagetool --comp zstd \
80
+ " $script_dir /appimagetool" --comp zstd \
56
81
--mksquashfs-opt -Xcompression-level --mksquashfs-opt 22 \
57
82
-n -u " $UPINFO " " $bin_dir " " $OUTPUT "
0 commit comments