Add flatpak support (#50)

This commit is contained in:
Reonu
2026-01-07 01:10:25 +00:00
committed by GitHub
parent 0384d1ef82
commit ab9e6440cd
6 changed files with 121 additions and 0 deletions
+3
View File
@@ -16,6 +16,9 @@ build/
build-cmake/
*.o
# Flatpak build process
repo/
# Windows build output
*.exe
*.dll
+4
View File
@@ -0,0 +1,4 @@
.flatpak-builder
builddir
repo
*.flatpak
+15
View File
@@ -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
```
@@ -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
@@ -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"
]
}
}
]
}
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>io.github.banjorecomp.banjorecomp</id>
<name>Banjo: Recompiled</name>
<summary>Static recompilation of Banjo-Kazooie for PC.</summary>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0+</project_license>
<supports>
<control>pointing</control>
<control>keyboard</control>
<control>touch</control>
<control>gamepad</control>
</supports>
<description>
<p>
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
</p>
</description>
<launchable type="desktop-id">io.github.banjorecomp.banjorecomp.desktop</launchable>
</component>