2024-09-24 19:24:18 +00:00
|
|
|
{
|
|
|
|
pname,
|
|
|
|
version,
|
|
|
|
src,
|
|
|
|
extraNativeBuildInputs ? [ ],
|
|
|
|
extraBuildInputs ? [ ],
|
|
|
|
extraMeta ? { },
|
|
|
|
compileFlags ? [ ],
|
|
|
|
postInstall ? "",
|
|
|
|
region ? "us",
|
2022-05-26 15:46:45 +00:00
|
|
|
|
2024-09-24 19:24:18 +00:00
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
python3,
|
|
|
|
pkg-config,
|
|
|
|
audiofile,
|
|
|
|
SDL2,
|
|
|
|
hexdump,
|
|
|
|
sm64baserom,
|
2022-05-26 15:46:45 +00:00
|
|
|
}:
|
2024-09-24 19:24:18 +00:00
|
|
|
let
|
|
|
|
baseRom = (sm64baserom.override { inherit region; }).romPath;
|
|
|
|
in
|
2022-05-26 15:46:45 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2024-09-24 19:24:18 +00:00
|
|
|
inherit
|
|
|
|
pname
|
|
|
|
version
|
|
|
|
src
|
|
|
|
postInstall
|
|
|
|
;
|
2022-05-26 15:46:45 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
python3
|
|
|
|
pkg-config
|
|
|
|
hexdump
|
|
|
|
] ++ extraNativeBuildInputs;
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
audiofile
|
|
|
|
SDL2
|
2022-09-18 19:33:03 +00:00
|
|
|
] ++ extraBuildInputs;
|
2022-05-26 15:46:45 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2024-09-24 19:24:18 +00:00
|
|
|
makeFlags =
|
|
|
|
[
|
|
|
|
"VERSION=${region}"
|
|
|
|
]
|
|
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
|
|
|
"OSX_BUILD=1"
|
|
|
|
]
|
|
|
|
++ compileFlags;
|
2022-05-26 15:46:45 +00:00
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
patchShebangs extract_assets.py
|
|
|
|
ln -s ${baseRom} ./baserom.${region}.z64
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp build/${region}_pc/sm64.${region}.f3dex2e $out/bin/sm64ex
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2024-09-24 19:24:18 +00:00
|
|
|
meta =
|
|
|
|
with lib;
|
|
|
|
{
|
|
|
|
longDescription = ''
|
|
|
|
${extraMeta.description or "Super Mario 64 port based off of decompilation"}
|
|
|
|
|
2022-05-26 15:46:45 +00:00
|
|
|
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.
|
|
|
|
'';
|
2024-09-24 19:24:18 +00:00
|
|
|
mainProgram = "sm64ex";
|
|
|
|
license = licenses.unfree;
|
|
|
|
maintainers = [ ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
}
|
|
|
|
// extraMeta;
|
2022-05-26 15:46:45 +00:00
|
|
|
}
|