Skip to content

Commit 634e42d

Browse files
authored
refactor, use sharun-aio (#53)
1 parent 18d1343 commit 634e42d

File tree

4 files changed

+160
-171
lines changed

4 files changed

+160
-171
lines changed

.github/workflows/build-nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ concurrency:
55

66
on:
77
schedule:
8-
- cron: "0 0 * * *"
8+
- cron: "0 7 1/3 * *"
99
workflow_dispatch: {}
1010

1111
jobs:

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This repository makes builds for **aarch64**, **x86_64** (generic) and **x86_64_
66

77
* [Latest Nightly Release](https://github.com/pkgforge-dev/Citron-AppImage/releases/tag/nightly)
88

9-
---------------------------------------------------------------
9+
----
1010

1111
AppImage made using [sharun](https://github.com/VHSgunzo/sharun), which makes it extremely easy to turn any binary into a portable package without using containers or similar tricks.
1212

@@ -27,3 +27,7 @@ This appimage works without fuse2 as it can use fuse3 instead, it can also work
2727
<img src="https://github.com/user-attachments/assets/d40067a6-37d2-4784-927c-2c7f7cc6104b" alt="Inspiration Image">
2828
</a>
2929
</details>
30+
31+
---
32+
33+
More at: [AnyLinux-AppImages](https://pkgforge-dev.github.io/Anylinux-AppImages/)

citron-appimage.sh

Lines changed: 73 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,27 @@
22

33
set -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"
107
URUNTIME="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"
2117
else
22-
echo "Making aarch64 build of citron"
18+
echo "Making aarch64 build of citron..."
2319
ARCH_FLAGS="-march=armv8-a -mtune=generic -O3"
2420
fi
2521

2622
UPINFO="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)"
@@ -44,7 +34,6 @@ fi
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'
@@ -58,27 +47,27 @@ fi
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)"
9180
mkdir ./AppDir
9281
cd ./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

9887
if [ "$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|')"
10190
fi
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
132118
if [ "$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
135121
fi
136122
ln ./sharun ./AppRun
137123
./sharun -g
138124

139125
# turn appdir into appimage
140126
cd ..
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
145132
echo "Adding update information \"$UPINFO\" to runtime..."
146-
./uruntime --appimage-addupdinfo "$UPINFO"
133+
./uruntime-lite --appimage-addupdinfo "$UPINFO"
147134

148135
echo "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

157145
echo "Generating zsync file..."
158146
zsyncmake *.AppImage -u *.AppImage
147+
159148
echo "All Done!"

0 commit comments

Comments
 (0)