From ab9e6440cd8974e83825a2340a246727a0ebfab6 Mon Sep 17 00:00:00 2001 From: Reonu Date: Wed, 7 Jan 2026 01:10:25 +0000 Subject: [PATCH] Add flatpak support (#50) --- .gitignore | 3 + flatpak/.gitignore | 4 ++ flatpak/README.md | 15 +++++ .../io.github.banjorecomp.banjorecomp.desktop | 8 +++ .../io.github.banjorecomp.banjorecomp.json | 62 +++++++++++++++++++ ...ithub.banjorecomp.banjorecomp.metainfo.xml | 29 +++++++++ 6 files changed, 121 insertions(+) create mode 100644 flatpak/.gitignore create mode 100644 flatpak/README.md create mode 100644 flatpak/io.github.banjorecomp.banjorecomp.desktop create mode 100644 flatpak/io.github.banjorecomp.banjorecomp.json create mode 100644 flatpak/io.github.banjorecomp.banjorecomp.metainfo.xml diff --git a/.gitignore b/.gitignore index 8daa8d0..44456e7 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,9 @@ build/ build-cmake/ *.o +# Flatpak build process +repo/ + # Windows build output *.exe *.dll diff --git a/flatpak/.gitignore b/flatpak/.gitignore new file mode 100644 index 0000000..9edbe83 --- /dev/null +++ b/flatpak/.gitignore @@ -0,0 +1,4 @@ +.flatpak-builder +builddir +repo +*.flatpak diff --git a/flatpak/README.md b/flatpak/README.md new file mode 100644 index 0000000..e17760a --- /dev/null +++ b/flatpak/README.md @@ -0,0 +1,15 @@ +Before building the Flatpak, you must build the patches on the root directory first. **The LLVM Extension for freedesktop does not include the MIPS compiler and will fail to build the patches inside the flatpak**. +```sh +make -C patches CC=clang LD=ld.lld +``` + +Build +```sh +flatpak-builder --force-clean --user --install-deps-from=flathub --repo=repo --install builddir io.github.banjorecomp.banjorecomp.json +``` + +Bundle +```sh +flatpak build-bundle repo io.github.banjorecomp.banjorecomp.flatpak io.github.banjorecomp.banjorecomp --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo +``` + diff --git a/flatpak/io.github.banjorecomp.banjorecomp.desktop b/flatpak/io.github.banjorecomp.banjorecomp.desktop new file mode 100644 index 0000000..cf04988 --- /dev/null +++ b/flatpak/io.github.banjorecomp.banjorecomp.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=Banjo: Recompiled +Exec=/app/bin/BanjoRecompiled +Type=Application +Icon=io.github.banjorecomp.banjorecomp +Categories=Game; +Comment=Static recompilation of Banjo-Kazooie for PC. +MimeType=x-scheme-handler/banjorecomp diff --git a/flatpak/io.github.banjorecomp.banjorecomp.json b/flatpak/io.github.banjorecomp.banjorecomp.json new file mode 100644 index 0000000..84c68ac --- /dev/null +++ b/flatpak/io.github.banjorecomp.banjorecomp.json @@ -0,0 +1,62 @@ +{ + "id": "io.github.banjorecomp.banjorecomp", + "runtime": "org.freedesktop.Platform", + "runtime-version": "25.08", + "sdk": "org.freedesktop.Sdk", + "sdk-extensions" : [ "org.freedesktop.Sdk.Extension.llvm20" ], + "finish-args": [ + "--share=network", + "--socket=wayland", + "--socket=fallback-x11", + "--socket=pulseaudio", + "--device=all", + "--filesystem=host", + "--filesystem=/media", + "--filesystem=/run/media", + "--filesystem=/mnt" + ], + "modules": [ + { + "name": "BanjoRecompiled", + "buildsystem": "simple", + "build-commands": [ + "cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S lib/N64Recomp -B lib/N64Recomp/cmake-build", + "cmake --build lib/N64Recomp/cmake-build --config Release --target N64Recomp --parallel", + "cmake --build lib/N64Recomp/cmake-build --config Release --target RSPRecomp --parallel", + "cp lib/N64Recomp/cmake-build/N64Recomp N64Recomp", + "cp lib/N64Recomp/cmake-build/RSPRecomp RSPRecomp", + "./N64Recomp banjo.us.rev0.toml", + "./RSPRecomp n_aspMain.us.rev0.toml", + "cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_MAKE_PROGRAM=ninja -DPATCHES_C_COMPILER=clang -DPATCHES_LD=ld.lld -DRECOMP_FLATPAK=ON -G Ninja -S . -B cmake-build", + "cmake --build cmake-build --config Release --target BanjoRecompiled --parallel", + "rm -rf assets/scss", + "mkdir -p /app/bin", + "cp cmake-build/BanjoRecompiled /app/bin/BanjoRecompiled", + "cp recompcontrollerdb.txt /app/bin/recompcontrollerdb.txt", + "cp -R assets /app/bin/assets", + "install -Dm644 icons/app.png /app/share/icons/hicolor/512x512/apps/${FLATPAK_ID}.png", + "install -Dm644 flatpak/io.github.banjorecomp.banjorecomp.metainfo.xml /app/share/metainfo/${FLATPAK_ID}.metainfo.xml", + "install -Dm644 flatpak/io.github.banjorecomp.banjorecomp.desktop /app/share/applications/${FLATPAK_ID}.desktop" + ], + "sources": [ + { + "type": "git", + "url": "https://github.com/N64Recomp/N64Recomp.git", + "commit": "2b6f05688de2abc7d86da5b4a89b84c2c6acbabe", + "dest": "lib/N64Recomp" + }, + { + "type": "dir", + "path": "../" + } + ], + "build-options": { + "append-path": "/usr/lib/sdk/llvm20/bin", + "prepend-ld-library-path": "/usr/lib/sdk/llvm20/lib", + "build-args": [ + "--share=network" + ] + } + } + ] +} diff --git a/flatpak/io.github.banjorecomp.banjorecomp.metainfo.xml b/flatpak/io.github.banjorecomp.banjorecomp.metainfo.xml new file mode 100644 index 0000000..c6b49c3 --- /dev/null +++ b/flatpak/io.github.banjorecomp.banjorecomp.metainfo.xml @@ -0,0 +1,29 @@ + + + io.github.banjorecomp.banjorecomp + + Banjo: Recompiled + Static recompilation of Banjo-Kazooie for PC. + + CC0-1.0 + GPL-3.0+ + + + pointing + keyboard + touch + gamepad + + + +

+ Banjo: Recompiled is a project that uses N64: Recompiled to statically recompile Banjo-Kazoie into a native port with many new features and enhancements. This project uses RT64 as the rendering engine to provide some of these enhancements. + + The original game is required to run this project. + + https://github.com/BanjoRecomp/BanjoRecomp +

+
+ + io.github.banjorecomp.banjorecomp.desktop +