22
33set -ex
44
5- export APPIMAGE_EXTRACT_AND_RUN=1
6- export ARCH=" $( uname -m) "
7-
8- REPO=" https://git.citron-emu.org/citron/emu.git"
9- LIB4BN=" https://raw.githubusercontent.com/VHSgunzo/sharun/refs/heads/main/lib4bin"
5+ ARCH=" $( uname -m) "
6+ SHARUN=" https://github.com/VHSgunzo/sharun/releases/latest/download/sharun-$ARCH -aio"
107URUNTIME=" https://github.com/VHSgunzo/uruntime/releases/latest/download/uruntime-appimage-dwarfs-$ARCH "
11-
12- if [ " $ARCH " = ' x86_64' ]; then
13- if [ " $1 " = ' v3' ]; then
14- echo " Making x86-64-v3 optimized build of citron"
15- ARCH=" ${ARCH} _v3"
16- ARCH_FLAGS=" -march=x86-64-v3 -O3"
17- else
18- echo " Making x86-64 generic build of citron"
19- ARCH_FLAGS=" -march=x86-64 -mtune=generic -O3"
20- fi
8+ URUNTIME_LITE=" https://github.com/VHSgunzo/uruntime/releases/latest/download/uruntime-appimage-dwarfs-lite-$ARCH "
9+
10+ if [ " $1 " = ' v3' ] && [ " $ARCH " = ' x86_64' ]; then
11+ echo " Making x86-64-v3 optimized build of citron..."
12+ ARCH=" ${ARCH} _v3"
13+ ARCH_FLAGS=" -march=x86-64-v3 -O3"
14+ elif [ " $ARCH " = ' x86_64' ]; then
15+ echo " Making x86-64 generic build of citron..."
16+ ARCH_FLAGS=" -march=x86-64 -mtune=generic -O3"
2117else
22- echo " Making aarch64 build of citron"
18+ echo " Making aarch64 build of citron... "
2319 ARCH_FLAGS=" -march=armv8-a -mtune=generic -O3"
2420fi
2521
2622UPINFO=" gh-releases-zsync|$( echo " $GITHUB_REPOSITORY " | tr ' /' ' |' ) |latest|*$ARCH .AppImage.zsync"
2723
2824# BUILD CITRON, fallback to mirror if upstream repo fails to clone
29- if ! git clone " $REPO " ./citron; then
30- echo " Using mirror instead..."
31- rm -rf ./citron || true
32- git clone ' https://github.com/pkgforge-community/git.citron-emu.org-Citron-Citron.git' ./citron
33- fi
34-
35- (
25+ git clone --recursive " https://git.citron-emu.org/citron/emu.git" ./citron && (
3626 cd ./citron
3727 if [ " $DEVEL " = ' true' ]; then
3828 CITRON_TAG=" $( git rev-parse --short HEAD) "
4434 git checkout " $CITRON_TAG "
4535 VERSION=" $( echo " $CITRON_TAG " | awk -F' -' ' {print $1}' ) "
4636 fi
47- git submodule update --init --recursive -j$( nproc)
4837
4938 # Upstream fixed this issue, but a newer version of boost came out and broke it again 🤣
5039 find . -type f \( -name ' *.cpp' -o -name ' *.h' \) | xargs sed -i ' s/\bboost::asio::io_service\b/boost::asio::io_context/g'
5847 mkdir build
5948 cd build
6049 cmake .. -GNinja \
61- -DCITRON_USE_BUNDLED_VCPKG=OFF \
62- -DCITRON_USE_BUNDLED_QT=OFF \
63- -DUSE_SYSTEM_QT=ON \
64- -DCITRON_USE_BUNDLED_FFMPEG=OFF \
65- -DCITRON_USE_BUNDLED_SDL2=ON \
66- -DCITRON_USE_EXTERNAL_SDL2=OFF \
67- -DCITRON_TESTS=OFF \
68- -DCITRON_CHECK_SUBMODULES=OFF \
69- -DCITRON_USE_LLVM_DEMANGLE=OFF \
70- -DCITRON_ENABLE_LTO=ON \
71- -DCITRON_USE_QT_MULTIMEDIA=OFF \
72- -DCITRON_USE_QT_WEB_ENGINE=OFF \
73- -DENABLE_QT_TRANSLATION=ON \
74- -DUSE_DISCORD_PRESENCE=OFF \
75- -DBUNDLE_SPEEX=ON \
76- -DCITRON_USE_FASTER_LD=OFF \
77- -DCMAKE_INSTALL_PREFIX=/usr \
50+ -DCITRON_USE_BUNDLED_VCPKG=OFF \
51+ -DCITRON_USE_BUNDLED_QT=OFF \
52+ -DUSE_SYSTEM_QT=ON \
53+ -DCITRON_USE_BUNDLED_FFMPEG=OFF \
54+ -DCITRON_USE_BUNDLED_SDL2=ON \
55+ -DCITRON_USE_EXTERNAL_SDL2=OFF \
56+ -DCITRON_TESTS=OFF \
57+ -DCITRON_CHECK_SUBMODULES=OFF \
58+ -DCITRON_USE_LLVM_DEMANGLE=OFF \
59+ -DCITRON_ENABLE_LTO=ON \
60+ -DCITRON_USE_QT_MULTIMEDIA=OFF \
61+ -DCITRON_USE_QT_WEB_ENGINE=OFF \
62+ -DENABLE_QT_TRANSLATION=ON \
63+ -DUSE_DISCORD_PRESENCE=OFF \
64+ -DBUNDLE_SPEEX=ON \
65+ -DCITRON_USE_FASTER_LD=OFF \
66+ -DCMAKE_INSTALL_PREFIX=/usr \
7867 -DCMAKE_CXX_FLAGS=" $ARCH_FLAGS -Wno-error -w" \
79- -DCMAKE_C_FLAGS=" $ARCH_FLAGS " \
80- -DCMAKE_SYSTEM_PROCESSOR=" $( uname -m) " \
81- -DCMAKE_BUILD_TYPE=Release \
68+ -DCMAKE_C_FLAGS=" $ARCH_FLAGS " \
69+ -DCMAKE_SYSTEM_PROCESSOR=" $( uname -m) " \
70+ -DCMAKE_BUILD_TYPE=Release \
8271 -DCMAKE_POLICY_VERSION_MINIMUM=3.5
8372 ninja
8473 sudo ninja install
@@ -91,69 +80,69 @@ VERSION="$(cat ~/version)"
9180mkdir ./AppDir
9281cd ./AppDir
9382
94- cp -v /usr/share/applications/org.citron_emu. citron.desktop ./citron.desktop
95- cp -v /usr/share/icons/hicolor/scalable/apps/org.citron_emu. citron.svg ./citron.svg
96- ln -s ./ citron.svg ./.DirIcon
83+ cp -v /usr/share/applications/* citron* .desktop ./
84+ cp -v /usr/share/icons/hicolor/scalable/apps/* citron* .svg ./
85+ cp -v /usr/share/icons/hicolor/scalable/apps/ * citron* .svg ./.DirIcon
9786
9887if [ " $DEVEL " = ' true' ]; then
99- sed -i ' s|Name=citron|Name=citron nightly|' ./citron .desktop
88+ sed -i ' s|Name=citron|Name=citron nightly|' ./* .desktop
10089 UPINFO=" $( echo " $UPINFO " | sed ' s|latest|nightly|' ) "
10190fi
10291
103- # Bundle all libs
104- wget --retry-connrefused --tries=30 " $LIB4BN " -O ./lib4bin
105- chmod +x ./lib4bin
106- xvfb-run -a -- ./lib4bin -p -v -e -s -k \
107- /usr/bin/citron* \
108- /usr/lib/lib* GL* \
109- /usr/lib/dri/* \
110- /usr/lib/vdpau/* \
111- /usr/lib/libvulkan* \
112- /usr/lib/libVkLayer* \
113- /usr/lib/libXss.so* \
114- /usr/lib/libdecor-0.so* \
115- /usr/lib/libgamemode.so* \
116- /usr/lib/qt6/plugins/audio/* \
117- /usr/lib/qt6/plugins/bearer/* \
118- /usr/lib/qt6/plugins/imageformats/* \
119- /usr/lib/qt6/plugins/iconengines/* \
120- /usr/lib/qt6/plugins/platforms/* \
121- /usr/lib/qt6/plugins/platformthemes/* \
122- /usr/lib/qt6/plugins/platforminputcontexts/* \
123- /usr/lib/qt6/plugins/styles/* \
92+ # ADD LIBRARIES
93+ wget --retry-connrefused --tries=30 " $SHARUN " -O ./sharun-aio
94+ chmod +x ./sharun-aio
95+ xvfb-run -a \
96+ ./sharun-aio l -p -v -e -s -k \
97+ /usr/bin/citron* \
98+ /usr/lib/lib* GL* \
99+ /usr/lib/dri/* \
100+ /usr/lib/vdpau/* \
101+ /usr/lib/libvulkan* \
102+ /usr/lib/libVkLayer* \
103+ /usr/lib/libXss.so* \
104+ /usr/lib/libdecor-0.so* \
105+ /usr/lib/libgamemode.so* \
106+ /usr/lib/qt6/plugins/imageformats/* \
107+ /usr/lib/qt6/plugins/iconengines/* \
108+ /usr/lib/qt6/plugins/platform* /* \
109+ /usr/lib/qt6/plugins/styles/* \
124110 /usr/lib/qt6/plugins/xcbglintegrations/* \
125- /usr/lib/qt6/plugins/wayland-* /* \
126- /usr/lib/pulseaudio/* \
127- /usr/lib/pipewire-0.3/* \
128- /usr/lib/spa-0.2/* /* \
111+ /usr/lib/qt6/plugins/wayland-* /* \
112+ /usr/lib/pulseaudio/* \
113+ /usr/lib/pipewire-0.3/* \
114+ /usr/lib/spa-0.2/* /* \
129115 /usr/lib/alsa-lib/*
130116
131117# Prepare sharun
132118if [ " $ARCH " = ' aarch64' ]; then
133- # allow the host vulkan to be used for aarch64 given the sed situation
119+ # allow the host vulkan to be used for aarch64 given the sad situation
134120 echo ' SHARUN_ALLOW_SYS_VKICD=1' > ./.env
135121fi
136122ln ./sharun ./AppRun
137123./sharun -g
138124
139125# turn appdir into appimage
140126cd ..
141- wget -q " $URUNTIME " -O ./uruntime
142- chmod +x ./uruntime
127+ wget --retry-connrefused --tries=30 " $URUNTIME " -O ./uruntime
128+ wget --retry-connrefused --tries=30 " $URUNTIME_LITE " -O ./uruntime-lite
129+ chmod +x ./uruntime*
143130
144- # Add udpate info to runtime
131+ # Add udpate info to runtime
145132echo " Adding update information \" $UPINFO \" to runtime..."
146- ./uruntime --appimage-addupdinfo " $UPINFO "
133+ ./uruntime-lite --appimage-addupdinfo " $UPINFO "
147134
148135echo " Generating AppImage..."
149- ./uruntime --appimage-mkdwarfs -f \
150- --set-owner 0 --set-group 0 \
151- --no-history --no-create-timestamp \
152- --categorize=hotness --hotness-list=citron.dwfsprof \
136+ ./uruntime \
137+ --appimage-mkdwarfs -f \
138+ --set-owner 0 --set-group 0 \
139+ --no-history --no-create-timestamp \
153140 --compression zstd:level=22 -S26 -B8 \
154- --header uruntime \
155- -i ./AppDir -o Citron-" $VERSION " -anylinux-" $ARCH " .AppImage
141+ --header uruntime-lite \
142+ -i ./AppDir \
143+ -o ./Citron-" $VERSION " -anylinux-" $ARCH " .AppImage
156144
157145echo " Generating zsync file..."
158146zsyncmake * .AppImage -u * .AppImage
147+
159148echo " All Done!"
0 commit comments