From 996dbf7db3031a94900bd43ab71dba3e1e18ff52 Mon Sep 17 00:00:00 2001 From: qubitnano <146656568+qubitnano@users.noreply.github.com> Date: Sun, 25 Jan 2026 10:14:09 -0500 Subject: [PATCH 1/3] rarezip: init at 0-unstable-2023-09-05 --- pkgs/by-name/ra/rarezip/package.nix | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 pkgs/by-name/ra/rarezip/package.nix diff --git a/pkgs/by-name/ra/rarezip/package.nix b/pkgs/by-name/ra/rarezip/package.nix new file mode 100644 index 000000000000..83f780a9a831 --- /dev/null +++ b/pkgs/by-name/ra/rarezip/package.nix @@ -0,0 +1,38 @@ +{ + lib, + stdenv, + fetchFromGitHub, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "rarezip"; + version = "0-unstable-2023-09-05"; + + src = fetchFromGitHub { + owner = "MittenzHugg"; + repo = "rarezip"; + rev = "2c4ba146c1b2fec851d3db8cf455c6af090bc544"; + hash = "sha256-t4/DgDeUOZAiX3yc2FUrm5mCRIgX0THFVBFSEYOSAhI="; + }; + + buildPhase = '' + substituteInPlace gzip/zip.c \ + --replace-fail "size_t bufs_init();" "" + + mkdir c + make c + ''; + + installPhase = '' + mkdir -p $out/lib + cp c/librarezip.a $out/lib + ''; + + meta = { + description = "Library version gzip v1.2.4 with foreign function interfaces to multiple languages"; + homepage = "https://github.com/MittenzHugg/rarezip"; + license = lib.licenses.gpl2Only; + maintainers = with lib.maintainers; [ qubitnano ]; + platforms = lib.platforms.all; + }; +}) From f11d11980ee47422ae11914a935a6cf542ed4670 Mon Sep 17 00:00:00 2001 From: qubitnano <146656568+qubitnano@users.noreply.github.com> Date: Sun, 25 Jan 2026 10:10:50 -0500 Subject: [PATCH 2/3] bk_rom_compressor: init at 0-unstable-2024-09-08 --- pkgs/by-name/bk/bk_rom_compressor/package.nix | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 pkgs/by-name/bk/bk_rom_compressor/package.nix diff --git a/pkgs/by-name/bk/bk_rom_compressor/package.nix b/pkgs/by-name/bk/bk_rom_compressor/package.nix new file mode 100644 index 000000000000..6891bed5e484 --- /dev/null +++ b/pkgs/by-name/bk/bk_rom_compressor/package.nix @@ -0,0 +1,32 @@ +{ + lib, + rustPlatform, + fetchFromGitHub, + rarezip, +}: + +rustPlatform.buildRustPackage { + pname = "bk_rom_compressor"; + version = "0-unstable-2024-09-08"; + + src = fetchFromGitHub { + owner = "MittenzHugg"; + repo = "bk_rom_compressor"; + rev = "272180b527b01c0023dc2ab02bdfdfd373670906"; + hash = "sha256-lnmnoomJTy8lAjoUjXvkXWFnf9LGtAGcD4WNFTDkiPk="; + fetchSubmodules = true; + }; + + buildInputs = [ + rarezip + ]; + + cargoHash = "sha256-JxK2S0JTBepT8nTTlBsZlS9+NvL+/rIRPmreX1Kmat4="; + + meta = { + description = "Banjo-Kazooie rom compressor/decompressor"; + homepage = "https://github.com/MittenzHugg/bk_rom_compressor"; + license = lib.licenses.unfree; + maintainers = with lib.maintainers; [ qubitnano ]; + }; +} From d05d78197efe7654b3503f765a342c850d5ad4c5 Mon Sep 17 00:00:00 2001 From: qubitnano <146656568+qubitnano@users.noreply.github.com> Date: Sun, 25 Jan 2026 11:32:51 -0500 Subject: [PATCH 3/3] banjorecomp: init at 1.0.1 --- pkgs/by-name/ba/banjorecomp/package.nix | 159 ++++++++++++++++++++++++ 1 file changed, 159 insertions(+) create mode 100644 pkgs/by-name/ba/banjorecomp/package.nix diff --git a/pkgs/by-name/ba/banjorecomp/package.nix b/pkgs/by-name/ba/banjorecomp/package.nix new file mode 100644 index 000000000000..113cfd35151d --- /dev/null +++ b/pkgs/by-name/ba/banjorecomp/package.nix @@ -0,0 +1,159 @@ +{ + lib, + banjobaserom ? null, + requireFile, + fetchFromGitHub, + llvmPackages_21, + cmake, + copyDesktopItems, + installShellFiles, + makeWrapper, + ninja, + pkg-config, + wrapGAppsHook3, + SDL2, + gtk3, + vulkan-loader, + makeDesktopItem, + n64recomp, + directx-shader-compiler, + bk_rom_compressor, +}: + +let + + baseRom = + if banjobaserom != null then + banjobaserom + else + requireFile { + name = "baserom.us.v10.z64"; + message = '' + banjorecomp only supports the US 1.0 version of Banjo-Kazooie. + Please dump your copy and rename it to baserom.us.v10.z64 + and add it to the nix store using + nix-store --add-fixed sha256 baserom.us.v10.z64 + See https://dumping.guide/carts/nintendo/n64 for more details. + ''; + hash = "sha256-WYdYNbmlEouwBUMVp/kp4gccIAHlKNcL9UPh1mgObv8="; + }; + +in + +llvmPackages_21.stdenv.mkDerivation (finalAttrs: { + pname = "banjorecomp"; + version = "1.0.1"; + + src = fetchFromGitHub { + owner = "BanjoRecomp"; + repo = "BanjoRecomp"; + tag = "v${finalAttrs.version}"; + hash = "sha256-QIiSjwA0iyoGTaeKANah6WhTUwPGXv1qR26kTdg7OqU="; + fetchSubmodules = true; + }; + + strictDeps = true; + __structuredAttrs = true; + + nativeBuildInputs = [ + cmake + copyDesktopItems + installShellFiles + llvmPackages_21.lld + makeWrapper + ninja + pkg-config + wrapGAppsHook3 + ]; + + buildInputs = [ + SDL2 + gtk3 + vulkan-loader + ]; + + desktopItems = [ + (makeDesktopItem { + name = "BanjoRecompiled"; + icon = "BanjoRecompiled"; + exec = "BanjoRecompiled"; + comment = "Recompilation of Banjo-Kazooie"; + desktopName = "BanjoRecompiled"; + categories = [ "Game" ]; + }) + ]; + + preConfigure = '' + ln -s ${baseRom} ./baserom.us.v10.z64 + cp ${n64recomp}/bin/* . + cp ${bk_rom_compressor}/bin/* . + + ./bk_rom_decompress baserom.us.v10.z64 banjo.us.v10.decompressed.z64 + + ./N64Recomp banjo.us.rev0.toml + ./RSPRecomp n_aspMain.us.rev0.toml + + substituteInPlace lib/rt64/CMakeLists.txt \ + --replace-fail "\''${PROJECT_SOURCE_DIR}/src/contrib/dxc/lib/x64" "${directx-shader-compiler}/lib/" \ + --replace-fail "\''${PROJECT_SOURCE_DIR}/src/contrib/dxc/bin/x64/dxc-linux" "${directx-shader-compiler}/bin/dxc" \ + --replace-fail "\''${PROJECT_SOURCE_DIR}/src/contrib/dxc/inc" "${directx-shader-compiler.src}/include/dxc" + + substituteInPlace CMakeLists.txt \ + --replace-fail "\''${PROJECT_SOURCE_DIR}/lib/rt64/src/contrib/dxc/lib/x64" "${directx-shader-compiler}/lib/" \ + --replace-fail "\''${PROJECT_SOURCE_DIR}/lib/rt64/src/contrib/dxc/bin/x64/dxc-linux" "${directx-shader-compiler}/bin/dxc" + ''; + + # This is required or else nothing will build + hardeningDisable = [ + "format" + "pic" + "stackprotector" + "zerocallusedregs" + ]; + + installPhase = '' + runHook preInstall + + installBin BanjoRecompiled + install -Dm644 -t $out/share ../recompcontrollerdb.txt + install -Dm644 ../icons/app.png $out/share/icons/hicolor/512x512/apps/BanjoRecompiled.png + cp -r ../assets $out/share/ + ln -s $out/share/recompcontrollerdb.txt $out/bin/recompcontrollerdb.txt + ln -s $out/share/assets $out/bin/assets + + install -Dm644 -t $out/share/licenses/banjorecomp ../COPYING + install -Dm644 -t $out/share/licenses/banjorecomp/N64ModernRuntime ../lib/N64ModernRuntime/COPYING + install -Dm644 -t $out/share/licenses/banjorecomp/rt64 ../lib/rt64/LICENSE + + runHook postInstall + ''; + + preFixup = '' + gappsWrapperArgs+=( + --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ vulkan-loader ]} + ) + ''; + + # The game will segfault when not run from the same directory as the binary. + postFixup = '' + wrapProgram $out/bin/BanjoRecompiled --chdir "$out/bin/" + ''; + + meta = { + description = "PC Port of Banjo-Kazooie made using N64: Recompiled"; + homepage = "https://github.com/BanjoRecomp/BanjoRecomp"; + license = with lib.licenses; [ + # BanjoRecompiled, N64ModernRuntime + gpl3Only + + # RT64 + mit + + # reverse engineering + unfree + ]; + maintainers = with lib.maintainers; [ qubitnano ]; + mainProgram = "BanjoRecompiled"; + platforms = [ "x86_64-linux" ]; + }; +})