Skip to content

Commit 31f3b74

Browse files
authored
temp fix™ using AUR package to build citron (#61)
1 parent 45a2a3f commit 31f3b74

File tree

3 files changed

+75
-129
lines changed

3 files changed

+75
-129
lines changed

.github/workflows/build-stable.yml

Lines changed: 20 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -23,84 +23,51 @@ jobs:
2323
optimized: true
2424
name: "Citron Build (Optimized)"
2525
arch: x86_64
26-
- runs-on: ubuntu-24.04-arm
27-
name: "Citron build (Normal)"
28-
optimized: false
29-
arch: aarch64
26+
# - runs-on: ubuntu-24.04-arm
27+
# name: "Citron build (Normal)"
28+
# optimized: false
29+
# arch: aarch64
3030
container: ghcr.io/pkgforge-dev/archlinux:latest
3131
steps:
3232
- uses: actions/checkout@v4
33-
with:
34-
persist-credentials: false
35-
36-
- name: Install dependencies
37-
if: always()
38-
run: chmod +x ./get-dependencies.sh && ./get-dependencies.sh
3933

4034
- name: Compile Citron (Normal)
4135
if: ${{ matrix.optimized == false }}
42-
run: |
43-
chmod +x ./citron-appimage.sh && ./citron-appimage.sh
44-
mkdir -p dist
45-
mv *.AppImage* dist/
36+
run: chmod +x ./get-dependencies.sh && ./get-dependencies.sh
4637

4738
- name: Compile Citron (Optimized)
4839
if: ${{ matrix.optimized == true }}
49-
run: |
50-
rm -rf ./AppDir || true
51-
sudo pacman -R --noconfirm citron || true
52-
chmod +x ./citron-appimage.sh && ./citron-appimage.sh v3
53-
mkdir -p dist
54-
mv *.AppImage* dist/
40+
run: chmod +x ./get-dependencies.sh && ./get-dependencies.sh v3
5541

56-
- name: Upload artifact
57-
uses: actions/[email protected]
58-
with:
59-
name: citron-${{ matrix.optimized && 'optimized' || 'normal' }}-appimage-${{ matrix.arch }}
60-
path: "dist"
61-
62-
- name: Check version file
42+
- name: Make AppImage (Normal)
6343
if: ${{ matrix.optimized == false }}
64-
run: |
65-
cat ~/version
66-
echo "APP_VERSION=$(cat ~/version)" >> "${GITHUB_ENV}"
44+
run: chmod +x ./citron-appimage.sh && ./citron-appimage.sh
6745

68-
- name: Upload version file
46+
- name: Make AppImage (Optimized)
47+
if: ${{ matrix.optimized == true }}
48+
run: chmod +x ./citron-appimage.sh && ./citron-appimage.sh v3
49+
50+
- name: Upload artifact
6951
uses: actions/[email protected]
7052
with:
71-
name: version
72-
path: ~/version
73-
overwrite: true
53+
name: AppImage-${{ matrix.optimized && 'optimized' || 'normal' }}-${{ matrix.arch }}
54+
path: "dist"
7455

7556
release:
7657
if: ${{ github.ref_name == 'main' }}
77-
name: "release"
7858
needs: [build]
79-
permissions:
80-
actions: read
81-
security-events: write
82-
contents: write
59+
permissions: write-all
8360
runs-on: ubuntu-latest
8461
steps:
8562
- uses: actions/[email protected]
8663
with:
87-
name: citron-optimized-appimage-x86_64
88-
89-
- uses: actions/[email protected]
90-
with:
91-
name: citron-normal-appimage-x86_64
92-
93-
- uses: actions/[email protected]
94-
with:
95-
name: citron-normal-appimage-aarch64
96-
97-
- uses: actions/[email protected]
98-
with:
99-
name: version
64+
pattern: AppImage-*
65+
merge-multiple: true
10066

10167
- name: Read version and Get date
10268
run: |
103-
echo "VERSION=$(cat version)" >> "${GITHUB_ENV}"
69+
cat ./version
70+
echo "VERSION=$(cat ./version)" >> "${GITHUB_ENV}"
10471
echo "DATE=$(date +'%Y-%m-%d_%s')" >> "${GITHUB_ENV}"
10572
10673
- name: Release Artifacts

citron-appimage.sh

Lines changed: 10 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -3,74 +3,9 @@
33
set -ex
44

55
ARCH="$(uname -m)"
6-
76
if [ "$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"
178
fi
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
749
VERSION="$(cat ~/version)"
7510
URUNTIME="https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/uruntime2appimage.sh"
7611
SHARUN="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
8823
wget --retry-connrefused --tries=30 "$SHARUN" -O ./quick-sharun
8924
chmod +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

9231
if [ "$DEVEL" = 'true' ]; then
9332
sed -i 's|Name=citron|Name=citron nightly|' ./AppDir/*.desktop
@@ -103,3 +42,8 @@ fi
10342
wget --retry-connrefused --tries=30 "$URUNTIME" -O ./uruntime2appimage
10443
chmod +x ./uruntime2appimage
10544
./uruntime2appimage
45+
46+
mkdir -p ./dist
47+
mv -v ./*.AppImage* ./dist
48+
mv -v ~/version ./dist
49+
echo "All done!"

get-dependencies.sh

Lines changed: 45 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,18 @@ pacman -Syu --noconfirm \
1111
catch2 \
1212
cmake \
1313
curl \
14-
enet \
1514
fmt \
1615
gamemode \
1716
gcc \
1817
git \
19-
glslang \
20-
glu \
21-
hidapi \
22-
libdecor \
23-
libvpx \
2418
libxi \
2519
libxkbcommon-x11 \
2620
libxss \
2721
mbedtls2 \
2822
mesa \
29-
nasm \
3023
ninja \
31-
nlohmann-json \
32-
numactl \
3324
openal \
25+
pipewire-audio \
3426
pulseaudio \
3527
pulseaudio-alsa \
3628
qt6-base \
@@ -55,4 +47,47 @@ echo "Installing debloated packages..."
5547
echo "---------------------------------------------------------------"
5648
wget --retry-connrefused --tries=30 "$EXTRA_PACKAGES" -O ./get-debloated-pkgs.sh
5749
chmod +x ./get-debloated-pkgs.sh
58-
./get-debloated-pkgs.sh --add-common intel-media-driver
50+
./get-debloated-pkgs.sh --add-mesa qt6-base-mini llvm-libs-nano opus-nano
51+
52+
echo "Building citron..."
53+
echo "---------------------------------------------------------------"
54+
sed -i 's|EUID == 0|EUID == 69|g' /usr/bin/makepkg
55+
sed -i 's|-O2|-O3|; s|MAKEFLAGS=.*|MAKEFLAGS="-j$(nproc)"|; s|#MAKEFLAGS|MAKEFLAGS|' /etc/makepkg.conf
56+
cat /etc/makepkg.conf
57+
58+
if [ "$1" = 'v3' ] && [ "$ARCH" = 'x86_64' ]; then
59+
echo "Making x86-64-v3 optimized build of citron..."
60+
ARCH_FLAGS="-march=x86-64-v3 -O3"
61+
elif [ "$ARCH" = 'x86_64' ]; then
62+
echo "Making x86-64 generic build of citron..."
63+
ARCH_FLAGS="-march=x86-64 -mtune=generic -O3"
64+
else
65+
echo "Making aarch64 build of citron..."
66+
ARCH_FLAGS="-march=armv8-a -mtune=generic -O3"
67+
fi
68+
69+
if [ "$DEVEL" = 'true' ]; then
70+
citronpkg=citron-git
71+
echo "Making nightly build..."
72+
else
73+
citronpkg=citron
74+
echo "Making stable build..."
75+
fi
76+
77+
git clone https://aur.archlinux.org/"$citronpkg".git ./citron
78+
cd ./citron
79+
80+
sed -i \
81+
-e "s|x86_64|$ARCH|g" \
82+
-e 's|DISCORD_PRESENCE=ON|DISCORD_PRESENCE=OFF|' \
83+
-e 's|USE_QT_MULTIMEDIA=ON|USE_QT_MULTIMEDIA=OFF|' \
84+
-e 's|BUILD_TYPE=None|BUILD_TYPE=Release|' \
85+
-e "s|\$CXXFLAGS|$ARCH_FLAGS|g" \
86+
-e "s|\$CFLAGS|$ARCH_FLAGS|g" \
87+
./PKGBUILD
88+
cat ./PKGBUILD
89+
90+
makepkg -fs --noconfirm --skippgpcheck
91+
ls -la .
92+
pacman --noconfirm -U ./*.pkg.tar.*
93+
pacman -Q "$citronpkg" | awk '{print $2; exit}' > ~/version

0 commit comments

Comments
 (0)