33set -ex
44
55ARCH=" $( uname -m) "
6-
76if [ " $1 " = ' v3' ] && [ " $ARCH " = ' x86_64' ]; then
8- echo " Making x86-64-v3 optimized build of citron..."
97 ARCH=" ${ARCH} _v3"
10- ARCH_FLAGS=" -march=x86-64-v3 -O3"
11- elif [ " $ARCH " = ' x86_64' ]; then
12- echo " Making x86-64 generic build of citron..."
13- ARCH_FLAGS=" -march=x86-64 -mtune=generic -O3"
14- else
15- echo " Making aarch64 build of citron..."
16- ARCH_FLAGS=" -march=armv8-a -mtune=generic -O3"
178fi
18-
19- # BUILD CITRON, fallback to mirror if upstream repo fails to clone
20- git clone --recursive " https://git.citron-emu.org/citron/emulator.git" ./citron && (
21- cd ./citron
22- if [ " $DEVEL " = ' true' ]; then
23- CITRON_TAG=" $( git rev-parse --short HEAD) "
24- echo " Making nightly \" $CITRON_TAG \" build"
25- VERSION=" $CITRON_TAG "
26- else
27- CITRON_TAG=$( git describe --tags)
28- echo " Making stable \" $CITRON_TAG \" build"
29- git checkout " $CITRON_TAG "
30- VERSION=" $( echo " $CITRON_TAG " | awk -F' -' ' {print $1}' ) "
31- fi
32-
33- # Upstream fixed this issue, but a newer version of boost came out and broke it again 🤣
34- find . -type f \( -name ' *.cpp' -o -name ' *.h' \) | xargs sed -i ' s/\bboost::asio::io_service\b/boost::asio::io_context/g'
35- find . -type f \( -name ' *.cpp' -o -name ' *.h' \) | xargs sed -i ' s/\bboost::asio::io_service::strand\b/boost::asio::strand<boost::asio::io_context::executor_type>/g'
36- find . -type f \( -name ' *.cpp' -o -name ' *.h' \) | xargs sed -i ' s|#include *<boost/process/async_pipe.hpp>|#include <boost/process/v1/async_pipe.hpp>|g'
37- find . -type f \( -name ' *.cpp' -o -name ' *.h' \) | xargs sed -i ' s/\bboost::process::async_pipe\b/boost::process::v1::async_pipe/g'
38-
39- # remove mysterious sse2neon library dependency
40- sed -i ' /sse2neon/d' ./src/video_core/CMakeLists.txt
41-
42- mkdir build
43- cd build
44- cmake .. -GNinja \
45- -DCITRON_USE_BUNDLED_VCPKG=OFF \
46- -DCITRON_USE_BUNDLED_QT=OFF \
47- -DUSE_SYSTEM_QT=ON \
48- -DCITRON_USE_BUNDLED_FFMPEG=OFF \
49- -DCITRON_USE_BUNDLED_SDL2=ON \
50- -DCITRON_USE_EXTERNAL_SDL2=OFF \
51- -DCITRON_TESTS=OFF \
52- -DCITRON_CHECK_SUBMODULES=OFF \
53- -DCITRON_USE_LLVM_DEMANGLE=OFF \
54- -DCITRON_ENABLE_LTO=ON \
55- -DCITRON_USE_QT_MULTIMEDIA=OFF \
56- -DCITRON_USE_QT_WEB_ENGINE=OFF \
57- -DENABLE_QT_TRANSLATION=ON \
58- -DUSE_DISCORD_PRESENCE=OFF \
59- -DBUNDLE_SPEEX=ON \
60- -DCITRON_USE_FASTER_LD=OFF \
61- -DCMAKE_INSTALL_PREFIX=/usr \
62- -DCMAKE_CXX_FLAGS=" $ARCH_FLAGS -Wno-error -w" \
63- -DCMAKE_C_FLAGS=" $ARCH_FLAGS " \
64- -DCMAKE_SYSTEM_PROCESSOR=" $( uname -m) " \
65- -DCMAKE_BUILD_TYPE=Release \
66- -DCMAKE_POLICY_VERSION_MINIMUM=3.5
67- ninja
68- sudo ninja install
69- echo " $VERSION " > ~/version
70- )
71- rm -rf ./citron
72-
73- # Deploy AppImage
749VERSION=" $( cat ~ /version) "
7510URUNTIME=" https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/uruntime2appimage.sh"
7611SHARUN=" https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/quick-sharun.sh"
@@ -87,7 +22,11 @@ export DEPLOY_PIPEWIRE=1
8722# ADD LIBRARIES
8823wget --retry-connrefused --tries=30 " $SHARUN " -O ./quick-sharun
8924chmod +x ./quick-sharun
90- ./quick-sharun /usr/bin/citron* /usr/lib/libgamemode.so*
25+ ./quick-sharun /usr/bin/citron* /usr/lib/libgamemode.so* /usr/lib/libpulse.so*
26+
27+ # TODO: remove me once we can build citron again without qt6-webengine nonsense
28+ cp -rv /usr/share/qt6/resources ./AppDir/shared/lib/qt6
29+ cp -rv /usr/share/qt6/translations ./AppDir/shared/lib/qt6
9130
9231if [ " $DEVEL " = ' true' ]; then
9332 sed -i ' s|Name=citron|Name=citron nightly|' ./AppDir/* .desktop
10342wget --retry-connrefused --tries=30 " $URUNTIME " -O ./uruntime2appimage
10443chmod +x ./uruntime2appimage
10544./uruntime2appimage
45+
46+ mkdir -p ./dist
47+ mv -v ./* .AppImage* ./dist
48+ mv -v ~ /version ./dist
49+ echo " All done!"
0 commit comments