diff --git a/.github/workflows/build-nightly.yml b/.github/workflows/build-nightly.yml index 0014f57..bd6ebce 100644 --- a/.github/workflows/build-nightly.yml +++ b/.github/workflows/build-nightly.yml @@ -5,7 +5,7 @@ concurrency: on: schedule: - - cron: "0 0 * * *" + - cron: "0 7 1/3 * *" workflow_dispatch: {} jobs: diff --git a/README.md b/README.md index 14e54de..4e579d1 100644 --- a/README.md +++ b/README.md @@ -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. @@ -27,3 +27,7 @@ This appimage works without fuse2 as it can use fuse3 instead, it can also work Inspiration Image + +--- + +More at: [AnyLinux-AppImages](https://pkgforge-dev.github.io/Anylinux-AppImages/) diff --git a/citron-appimage.sh b/citron-appimage.sh index 6bc1f23..70e01a9 100755 --- a/citron-appimage.sh +++ b/citron-appimage.sh @@ -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)" @@ -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' @@ -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 @@ -91,46 +80,43 @@ 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 @@ -138,22 +124,25 @@ ln ./sharun ./AppRun # 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!" diff --git a/get-dependencies.sh b/get-dependencies.sh index 94d88f0..a32e80e 100644 --- a/get-dependencies.sh +++ b/get-dependencies.sh @@ -1,104 +1,100 @@ #!/bin/sh set -ex +ARCH="$(uname -m)" -sed -i 's/DownloadUser/#DownloadUser/g' /etc/pacman.conf +pacman -Syu --noconfirm \ + aom \ + base-devel \ + boost \ + boost-libs \ + catch2 \ + clang \ + cmake \ + curl \ + dav1d \ + doxygen \ + enet \ + ffmpeg \ + ffmpeg4.4 \ + fmt \ + gamemode \ + gcc \ + git \ + gcc \ + glslang \ + glu \ + hidapi \ + libass \ + libdecor \ + libfdk-aac \ + libopusenc \ + libva \ + libvpx \ + libxi \ + libxkbcommon-x11 \ + libxss \ + mbedtls2 \ + mesa \ + meson \ + nasm \ + ninja \ + nlohmann-json \ + numactl \ + pipewire-audio \ + pulseaudio \ + pulseaudio-alsa \ + qt6-base \ + qt6ct \ + qt6-multimedia \ + qt6-tools \ + qt6-wayland \ + sdl2 \ + unzip \ + vulkan-headers \ + vulkan-mesa-layers \ + vulkan-nouveau \ + vulkan-radeon \ + wget \ + x264 \ + x265 \ + xcb-util-cursor \ + xcb-util-image \ + xcb-util-renderutil \ + xcb-util-wm \ + xorg-server-xvfb \ + zip \ + zsync -if [ "$(uname -m)" = 'x86_64' ]; then - PKG_TYPE='x86_64.pkg.tar.zst' -else - PKG_TYPE='aarch64.pkg.tar.xz' -fi + +case "$ARCH" in + 'x86_64') + PKG_TYPE='x86_64.pkg.tar.zst' + pacman -Syu --noconfirm vulkan-intel haskell-gnutls svt-av1 + ;; + 'aarch64') + PKG_TYPE='aarch64.pkg.tar.xz' + pacman -Syu --noconfirm vulkan-freedreno vulkan-panfrost + ;; + ''|*) + echo "Unknown cpu arch: $ARCH" + exit 1 + ;; +esac LLVM_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/continuous/llvm-libs-nano-$PKG_TYPE" FFMPEG_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/continuous/ffmpeg-mini-$PKG_TYPE" QT6_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/continuous/qt6-base-iculess-$PKG_TYPE" LIBXML_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/continuous/libxml2-iculess-$PKG_TYPE" OPUS_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/continuous/opus-nano-$PKG_TYPE" -MESA_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/continuous/mesa-mini-$PKG_TYPE" - -echo "Installing build dependencies..." -echo "---------------------------------------------------------------" -pacman -Syu --noconfirm \ - aom \ - base-devel \ - boost \ - boost-libs \ - catch2 \ - clang \ - cmake \ - curl \ - dav1d \ - desktop-file-utils \ - doxygen \ - enet \ - ffmpeg \ - ffmpeg4.4 \ - fmt \ - gamemode \ - git \ - glslang \ - glu \ - hidapi \ - libass \ - libdecor \ - libfdk-aac \ - libopusenc \ - libva \ - libvpx \ - libxi \ - libxkbcommon-x11 \ - libxss \ - libzip \ - mbedtls \ - mbedtls2 \ - mesa \ - meson \ - nasm \ - ninja \ - nlohmann-json \ - numactl \ - patchelf \ - pipewire-audio \ - pulseaudio \ - pulseaudio-alsa \ - python-pip \ - qt6-base \ - qt6ct \ - qt6-multimedia \ - qt6-tools \ - qt6-wayland \ - sdl2 \ - strace \ - unzip \ - vulkan-headers \ - vulkan-mesa-layers \ - vulkan-nouveau \ - vulkan-radeon \ - wget \ - x264 \ - x265 \ - xcb-util-cursor \ - xcb-util-image \ - xcb-util-renderutil \ - xcb-util-wm \ - xorg-server-xvfb \ - zip \ - zsync - -if [ "$(uname -m)" = 'x86_64' ]; then - pacman -Syu --noconfirm vulkan-intel haskell-gnutls gcc14 svt-av1 -else - pacman -Syu --noconfirm vulkan-freedreno vulkan-panfrost -fi echo "Installing debloated pckages..." echo "---------------------------------------------------------------" -wget --retry-connrefused --tries=30 "$LLVM_URL" -O ./llvm-libs.pkg.tar.zst -wget --retry-connrefused --tries=30 "$QT6_URL" -O ./qt6-base-iculess.pkg.tar.zst +wget --retry-connrefused --tries=30 "$LLVM_URL" -O ./llvm-libs.pkg.tar.zst +wget --retry-connrefused --tries=30 "$QT6_URL" -O ./qt6-base-iculess.pkg.tar.zst wget --retry-connrefused --tries=30 "$LIBXML_URL" -O ./libxml2-iculess.pkg.tar.zst wget --retry-connrefused --tries=30 "$FFMPEG_URL" -O ./ffmpeg-mini.pkg.tar.zst -wget --retry-connrefused --tries=30 "$OPUS_URL" -O ./opus-nano.pkg.tar.zst +wget --retry-connrefused --tries=30 "$OPUS_URL" -O ./opus-nano.pkg.tar.zst pacman -U --noconfirm ./*.pkg.tar.zst rm -f ./*.pkg.tar.zst