Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ concurrency:

on:
schedule:
- cron: "0 0 * * *"
- cron: "0 7 1/3 * *"
workflow_dispatch: {}

jobs:
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This repository makes builds for **aarch64**, **x86_64** (generic) and **x86_64_

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

---------------------------------------------------------------
----

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.

Expand All @@ -27,3 +27,7 @@ This appimage works without fuse2 as it can use fuse3 instead, it can also work
<img src="https://github.com/user-attachments/assets/d40067a6-37d2-4784-927c-2c7f7cc6104b" alt="Inspiration Image">
</a>
</details>

---

More at: [AnyLinux-AppImages](https://pkgforge-dev.github.io/Anylinux-AppImages/)
157 changes: 73 additions & 84 deletions citron-appimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,27 @@

set -ex

export APPIMAGE_EXTRACT_AND_RUN=1
export ARCH="$(uname -m)"

REPO="https://git.citron-emu.org/citron/emu.git"
LIB4BN="https://raw.githubusercontent.com/VHSgunzo/sharun/refs/heads/main/lib4bin"
ARCH="$(uname -m)"
SHARUN="https://github.com/VHSgunzo/sharun/releases/latest/download/sharun-$ARCH-aio"
URUNTIME="https://github.com/VHSgunzo/uruntime/releases/latest/download/uruntime-appimage-dwarfs-$ARCH"

if [ "$ARCH" = 'x86_64' ]; then
if [ "$1" = 'v3' ]; then
echo "Making x86-64-v3 optimized build of citron"
ARCH="${ARCH}_v3"
ARCH_FLAGS="-march=x86-64-v3 -O3"
else
echo "Making x86-64 generic build of citron"
ARCH_FLAGS="-march=x86-64 -mtune=generic -O3"
fi
URUNTIME_LITE="https://github.com/VHSgunzo/uruntime/releases/latest/download/uruntime-appimage-dwarfs-lite-$ARCH"

if [ "$1" = 'v3' ] && [ "$ARCH" = 'x86_64' ]; then
echo "Making x86-64-v3 optimized build of citron..."
ARCH="${ARCH}_v3"
ARCH_FLAGS="-march=x86-64-v3 -O3"
elif [ "$ARCH" = 'x86_64' ]; then
echo "Making x86-64 generic build of citron..."
ARCH_FLAGS="-march=x86-64 -mtune=generic -O3"
else
echo "Making aarch64 build of citron"
echo "Making aarch64 build of citron..."
ARCH_FLAGS="-march=armv8-a -mtune=generic -O3"
fi

UPINFO="gh-releases-zsync|$(echo "$GITHUB_REPOSITORY" | tr '/' '|')|latest|*$ARCH.AppImage.zsync"

# BUILD CITRON, fallback to mirror if upstream repo fails to clone
if ! git clone "$REPO" ./citron; then
echo "Using mirror instead..."
rm -rf ./citron || true
git clone 'https://github.com/pkgforge-community/git.citron-emu.org-Citron-Citron.git' ./citron
fi

(
git clone --recursive "https://git.citron-emu.org/citron/emu.git" ./citron && (
cd ./citron
if [ "$DEVEL" = 'true' ]; then
CITRON_TAG="$(git rev-parse --short HEAD)"
Expand All @@ -44,7 +34,6 @@ fi
git checkout "$CITRON_TAG"
VERSION="$(echo "$CITRON_TAG" | awk -F'-' '{print $1}')"
fi
git submodule update --init --recursive -j$(nproc)

# Upstream fixed this issue, but a newer version of boost came out and broke it again 🤣
find . -type f \( -name '*.cpp' -o -name '*.h' \) | xargs sed -i 's/\bboost::asio::io_service\b/boost::asio::io_context/g'
Expand All @@ -58,27 +47,27 @@ fi
mkdir build
cd build
cmake .. -GNinja \
-DCITRON_USE_BUNDLED_VCPKG=OFF \
-DCITRON_USE_BUNDLED_QT=OFF \
-DUSE_SYSTEM_QT=ON \
-DCITRON_USE_BUNDLED_FFMPEG=OFF \
-DCITRON_USE_BUNDLED_SDL2=ON \
-DCITRON_USE_EXTERNAL_SDL2=OFF \
-DCITRON_TESTS=OFF \
-DCITRON_CHECK_SUBMODULES=OFF \
-DCITRON_USE_LLVM_DEMANGLE=OFF \
-DCITRON_ENABLE_LTO=ON \
-DCITRON_USE_QT_MULTIMEDIA=OFF \
-DCITRON_USE_QT_WEB_ENGINE=OFF \
-DENABLE_QT_TRANSLATION=ON \
-DUSE_DISCORD_PRESENCE=OFF \
-DBUNDLE_SPEEX=ON \
-DCITRON_USE_FASTER_LD=OFF \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCITRON_USE_BUNDLED_VCPKG=OFF \
-DCITRON_USE_BUNDLED_QT=OFF \
-DUSE_SYSTEM_QT=ON \
-DCITRON_USE_BUNDLED_FFMPEG=OFF \
-DCITRON_USE_BUNDLED_SDL2=ON \
-DCITRON_USE_EXTERNAL_SDL2=OFF \
-DCITRON_TESTS=OFF \
-DCITRON_CHECK_SUBMODULES=OFF \
-DCITRON_USE_LLVM_DEMANGLE=OFF \
-DCITRON_ENABLE_LTO=ON \
-DCITRON_USE_QT_MULTIMEDIA=OFF \
-DCITRON_USE_QT_WEB_ENGINE=OFF \
-DENABLE_QT_TRANSLATION=ON \
-DUSE_DISCORD_PRESENCE=OFF \
-DBUNDLE_SPEEX=ON \
-DCITRON_USE_FASTER_LD=OFF \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_CXX_FLAGS="$ARCH_FLAGS -Wno-error -w" \
-DCMAKE_C_FLAGS="$ARCH_FLAGS" \
-DCMAKE_SYSTEM_PROCESSOR="$(uname -m)" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_FLAGS="$ARCH_FLAGS" \
-DCMAKE_SYSTEM_PROCESSOR="$(uname -m)" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
ninja
sudo ninja install
Expand All @@ -91,69 +80,69 @@ VERSION="$(cat ~/version)"
mkdir ./AppDir
cd ./AppDir

cp -v /usr/share/applications/org.citron_emu.citron.desktop ./citron.desktop
cp -v /usr/share/icons/hicolor/scalable/apps/org.citron_emu.citron.svg ./citron.svg
ln -s ./citron.svg ./.DirIcon
cp -v /usr/share/applications/*citron*.desktop ./
cp -v /usr/share/icons/hicolor/scalable/apps/*citron*.svg ./
cp -v /usr/share/icons/hicolor/scalable/apps/*citron*.svg ./.DirIcon

if [ "$DEVEL" = 'true' ]; then
sed -i 's|Name=citron|Name=citron nightly|' ./citron.desktop
sed -i 's|Name=citron|Name=citron nightly|' ./*.desktop
UPINFO="$(echo "$UPINFO" | sed 's|latest|nightly|')"
fi

# Bundle all libs
wget --retry-connrefused --tries=30 "$LIB4BN" -O ./lib4bin
chmod +x ./lib4bin
xvfb-run -a -- ./lib4bin -p -v -e -s -k \
/usr/bin/citron* \
/usr/lib/lib*GL* \
/usr/lib/dri/* \
/usr/lib/vdpau/* \
/usr/lib/libvulkan* \
/usr/lib/libVkLayer* \
/usr/lib/libXss.so* \
/usr/lib/libdecor-0.so* \
/usr/lib/libgamemode.so* \
/usr/lib/qt6/plugins/audio/* \
/usr/lib/qt6/plugins/bearer/* \
/usr/lib/qt6/plugins/imageformats/* \
/usr/lib/qt6/plugins/iconengines/* \
/usr/lib/qt6/plugins/platforms/* \
/usr/lib/qt6/plugins/platformthemes/* \
/usr/lib/qt6/plugins/platforminputcontexts/* \
/usr/lib/qt6/plugins/styles/* \
# ADD LIBRARIES
wget --retry-connrefused --tries=30 "$SHARUN" -O ./sharun-aio
chmod +x ./sharun-aio
xvfb-run -a \
./sharun-aio l -p -v -e -s -k \
/usr/bin/citron* \
/usr/lib/lib*GL* \
/usr/lib/dri/* \
/usr/lib/vdpau/* \
/usr/lib/libvulkan* \
/usr/lib/libVkLayer* \
/usr/lib/libXss.so* \
/usr/lib/libdecor-0.so* \
/usr/lib/libgamemode.so* \
/usr/lib/qt6/plugins/imageformats/* \
/usr/lib/qt6/plugins/iconengines/* \
/usr/lib/qt6/plugins/platform*/* \
/usr/lib/qt6/plugins/styles/* \
/usr/lib/qt6/plugins/xcbglintegrations/* \
/usr/lib/qt6/plugins/wayland-*/* \
/usr/lib/pulseaudio/* \
/usr/lib/pipewire-0.3/* \
/usr/lib/spa-0.2/*/* \
/usr/lib/qt6/plugins/wayland-*/* \
/usr/lib/pulseaudio/* \
/usr/lib/pipewire-0.3/* \
/usr/lib/spa-0.2/*/* \
/usr/lib/alsa-lib/*

# Prepare sharun
if [ "$ARCH" = 'aarch64' ]; then
# allow the host vulkan to be used for aarch64 given the sed situation
# allow the host vulkan to be used for aarch64 given the sad situation
echo 'SHARUN_ALLOW_SYS_VKICD=1' > ./.env
fi
ln ./sharun ./AppRun
./sharun -g

# turn appdir into appimage
cd ..
wget -q "$URUNTIME" -O ./uruntime
chmod +x ./uruntime
wget --retry-connrefused --tries=30 "$URUNTIME" -O ./uruntime
wget --retry-connrefused --tries=30 "$URUNTIME_LITE" -O ./uruntime-lite
chmod +x ./uruntime*

#Add udpate info to runtime
# Add udpate info to runtime
echo "Adding update information \"$UPINFO\" to runtime..."
./uruntime --appimage-addupdinfo "$UPINFO"
./uruntime-lite --appimage-addupdinfo "$UPINFO"

echo "Generating AppImage..."
./uruntime --appimage-mkdwarfs -f \
--set-owner 0 --set-group 0 \
--no-history --no-create-timestamp \
--categorize=hotness --hotness-list=citron.dwfsprof \
./uruntime \
--appimage-mkdwarfs -f \
--set-owner 0 --set-group 0 \
--no-history --no-create-timestamp \
--compression zstd:level=22 -S26 -B8 \
--header uruntime \
-i ./AppDir -o Citron-"$VERSION"-anylinux-"$ARCH".AppImage
--header uruntime-lite \
-i ./AppDir \
-o ./Citron-"$VERSION"-anylinux-"$ARCH".AppImage

echo "Generating zsync file..."
zsyncmake *.AppImage -u *.AppImage

echo "All Done!"
Loading