diff --git a/pkgs/default.nix b/pkgs/default.nix index 79fcef5..8e8e4c4 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -6,7 +6,7 @@ ... }: { - packages = { + packages = rec { simulationcraft = pkgs.callPackage ./simulationcraft.nix { simulationcraft-src = inputs.simulationcraft; }; @@ -18,6 +18,9 @@ weakauras-companion = pkgs.callPackage ./weakauras-companion.nix { }; wow-note = pkgs.callPackage ./wow-note { }; rmc = pkgs.callPackage ./rmc.nix { }; + sarc = pkgs.callPackage ./sarc.nix { inherit rstb; }; + rstb = pkgs.callPackage ./rstb.nix { inherit oead; }; + oead = pkgs.callPackage ./oead.nix { }; }; }; } diff --git a/pkgs/oead.nix b/pkgs/oead.nix new file mode 100644 index 0000000..b717d3a --- /dev/null +++ b/pkgs/oead.nix @@ -0,0 +1,40 @@ +{ + lib, + python311, + fetchFromGitHub, + cmake, +}: + +python311.pkgs.buildPythonApplication rec { + pname = "oead"; + version = "1.2.9-4"; + pyproject = true; + + src = fetchFromGitHub { + owner = "zeldamods"; + repo = "oead"; + rev = "v${version}"; + hash = "sha256-rBzXs5OaSssCjakOmGRsvL0OSq1EApllRN59lFaRNrU="; + fetchSubmodules = true; + }; + + dontUseCmakeConfigure = true; + + build-system = [ + python311.pkgs.setuptools + python311.pkgs.wheel + cmake + ]; + + pythonImportsCheck = [ + "oead" + ]; + + meta = { + description = "Library for recent Nintendo EAD formats in first-party games"; + homepage = "https://github.com/zeldamods/oead"; + license = lib.licenses.gpl2Only; + maintainers = with lib.maintainers; [ ]; + mainProgram = "oead"; + }; +} diff --git a/pkgs/rstb.nix b/pkgs/rstb.nix new file mode 100644 index 0000000..6e986de --- /dev/null +++ b/pkgs/rstb.nix @@ -0,0 +1,42 @@ +{ + lib, + python311, + fetchFromGitHub, + oead, +}: + +python311.pkgs.buildPythonApplication rec { + pname = "rstb"; + version = "1.2.2"; + pyproject = true; + + src = fetchFromGitHub { + owner = "zeldamods"; + repo = "rstb"; + rev = "v${version}"; + hash = "sha256-wd+kR+bQqaD9VNMSO3SNkA6uUe/6SFje8VmhbkJD0xg="; + }; + + nativeBuildInputs = [ python311.pkgs.pythonRelaxDepsHook ]; + + build-system = [ + python311.pkgs.setuptools + python311.pkgs.wheel + ]; + + dependencies = [ oead ]; + + pythonRelaxDeps = [ "oead" ]; + + pythonImportsCheck = [ + "rstb" + ]; + + meta = { + description = "Utilities to modify Breath of the Wild's Resource Size Table (RSTB"; + homepage = "https://github.com/zeldamods/rstb"; + license = lib.licenses.gpl2Only; + maintainers = with lib.maintainers; [ ]; + mainProgram = "rstb"; + }; +} diff --git a/pkgs/sarc.nix b/pkgs/sarc.nix new file mode 100644 index 0000000..8326648 --- /dev/null +++ b/pkgs/sarc.nix @@ -0,0 +1,42 @@ +{ + lib, + python311, + fetchFromGitHub, + rstb, +}: + +python311.pkgs.buildPythonApplication rec { + pname = "sarc"; + version = "2.0.5"; + pyproject = true; + + src = fetchFromGitHub { + owner = "zeldamods"; + repo = "sarc"; + rev = "v${version}"; + hash = "sha256-F6ra0AOd5yGZX4lWXHUO3fk5oK1hT7j1wWzZeWSbD84="; + }; + + build-system = [ + python311.pkgs.setuptools + python311.pkgs.wheel + ]; + + nativeBuildInputs = [ python311.pkgs.pythonRelaxDepsHook ]; + + dependencies = [ rstb ]; + + pythonImportsCheck = [ + "sarc" + ]; + + pythonRelaxDeps = [ "oead" ]; + + meta = { + description = "Nintendo SARC archive reader and writer"; + homepage = "https://github.com/zeldamods/sarc"; + license = lib.licenses.gpl2Only; + maintainers = with lib.maintainers; [ ]; + mainProgram = "sarc"; + }; +}