summary refs log tree commit diff
path: root/pkgs/games
diff options
context:
space:
mode:
authorIvar <ivar.scholten@protonmail.com>2020-05-24 23:53:57 +0200
committerIvarWithoutBones <ivar.scholten@protonmail.com>2020-07-17 01:46:55 +0200
commit8e9c0cbe2b483bdb2d31d498b22f6518e3051b11 (patch)
tree5f9420dbf0fc9fdb677129f952f9612e54b82bfa /pkgs/games
parent5d9e9258de005b9c429be145abb1bce1906ee8c2 (diff)
downloadnixpkgs-8e9c0cbe2b483bdb2d31d498b22f6518e3051b11.tar
nixpkgs-8e9c0cbe2b483bdb2d31d498b22f6518e3051b11.tar.gz
nixpkgs-8e9c0cbe2b483bdb2d31d498b22f6518e3051b11.tar.bz2
nixpkgs-8e9c0cbe2b483bdb2d31d498b22f6518e3051b11.tar.lz
nixpkgs-8e9c0cbe2b483bdb2d31d498b22f6518e3051b11.tar.xz
nixpkgs-8e9c0cbe2b483bdb2d31d498b22f6518e3051b11.tar.zst
nixpkgs-8e9c0cbe2b483bdb2d31d498b22f6518e3051b11.zip
sm64ex: init at unstable-2020-06-19
Diffstat (limited to 'pkgs/games')
-rw-r--r--pkgs/games/sm64ex/default.nix69
1 files changed, 69 insertions, 0 deletions
diff --git a/pkgs/games/sm64ex/default.nix b/pkgs/games/sm64ex/default.nix
new file mode 100644
index 00000000000..e5aeb84fbf1
--- /dev/null
+++ b/pkgs/games/sm64ex/default.nix
@@ -0,0 +1,69 @@
+{ stdenv
+, fetchFromGitHub
+, python3
+, pkg-config
+, audiofile
+, SDL2
+, hexdump
+, requireFile
+, compileFlags ? [ ]
+, region ? "us"
+, baseRom ? requireFile {
+    name = "baserom.${region}.z64";
+    message = ''
+      This nix expression requires that baserom.${region}.z64 is
+      already part of the store. To get this file you can dump your Super Mario 64 cartridge's contents
+      and add it to the nix store with nix-store --add-fixed sha256 <FILE>.
+      Note that if you are not using a US baserom, you must overwrite the "region" attribute with either "eu" or "jp".
+    '';
+    sha256 = {
+      "us" = "17ce077343c6133f8c9f2d6d6d9a4ab62c8cd2aa57c40aea1f490b4c8bb21d91";
+      "eu" = "c792e5ebcba34c8d98c0c44cf29747c8ee67e7b907fcc77887f9ff2523f80572";
+      "jp" = "9cf7a80db321b07a8d461fe536c02c87b7412433953891cdec9191bfad2db317";
+    }.${region};
+  }
+}:
+
+stdenv.mkDerivation rec {
+  pname = "sm64ex";
+  version = "unstable-2020-06-19";
+
+  src = fetchFromGitHub {
+    owner = "sm64pc";
+    repo = "sm64ex";
+    rev = "f5005418348cf1a53bfa75ff415a513ef0b9b273";
+    sha256 = "0adyshkqk5c4lxhdxc3j6ax4svfka26486qpa5q2gl2nixwg9zxn";
+  };
+
+  nativeBuildInputs = [ python3 pkg-config ];
+  buildInputs = [ audiofile SDL2 hexdump ];
+
+  makeFlags = [ "VERSION=${region}" ] ++ compileFlags
+    ++ stdenv.lib.optionals stdenv.isDarwin [ "OSX_BUILD=1" ];
+
+  inherit baseRom;
+
+  preBuild = ''
+    patchShebangs extract_assets.py
+    cp $baseRom ./baserom.${region}.z64
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp build/${region}_pc/sm64.${region}.f3dex2e $out/bin/sm64ex
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = "https://github.com/sm64pc/sm64ex";
+    description = "Super Mario 64 port based off of decompilation";
+    longDescription = ''
+      Super Mario 64 port based off of decompilation.
+      Note that you must supply a baserom yourself to extract assets from.
+      If you are not using an US baserom, you must overwrite the "region" attribute with either "eu" or "jp".
+      If you would like to use patches sm64ex distributes as makeflags, add them to the "compileFlags" attribute.
+    '';
+    license = licenses.unfree;
+    maintainers = with maintainers; [ ivar ];
+    platforms = platforms.unix;
+  };
+}