From 885db56d0e8a0fd755920293f352727d2c6e1880 Mon Sep 17 00:00:00 2001 From: Kamila Borowska Date: Wed, 22 Nov 2023 15:07:42 +0100 Subject: [PATCH] python3Packages.skytemple-files: fix build --- .../python-modules/skytemple-files/default.nix | 15 +++++++++++++++ .../python-modules/skytemple-rust/default.nix | 13 ++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/skytemple-files/default.nix b/pkgs/development/python-modules/skytemple-files/default.nix index d6a56883bc46..a02b04675b1e 100644 --- a/pkgs/development/python-modules/skytemple-files/default.nix +++ b/pkgs/development/python-modules/skytemple-files/default.nix @@ -2,6 +2,7 @@ , lib , buildPythonPackage , fetchFromGitHub +, fetchpatch , appdirs , dungeon-eos , explorerscript @@ -38,6 +39,20 @@ buildPythonPackage rec { fetchSubmodules = true; }; + patches = [ + # Necessary for skytemple-files to work with Pillow 10.1.0. + # https://github.com/SkyTemple/skytemple-files/issues/449 + (fetchpatch { + url = "https://github.com/SkyTemple/skytemple-files/commit/5dc6477d5411b43b80ba79cdaf3521d75d924233.patch"; + hash = "sha256-0511IRjOcQikhnbu3FkXn92mLAkO+kV9J94Z3f7EBcU="; + includes = ["skytemple_files/graphics/kao/_model.py"]; + }) + (fetchpatch { + url = "https://github.com/SkyTemple/skytemple-files/commit/9548f7cf3b1d834555b41497cfc0bddab10fd3f6.patch"; + hash = "sha256-a3GeR5IxXRIKY7I6rhKbOcQnoKxtH7Xf3Wx/BRFQHSc="; + }) + ]; + postPatch = '' substituteInPlace skytemple_files/patch/arm_patcher.py skytemple_files/data/data_cd/armips_importer.py \ --replace "exec_name = os.getenv(\"SKYTEMPLE_ARMIPS_EXEC\", f\"{prefix}armips\")" "exec_name = \"${armips}/bin/armips\"" diff --git a/pkgs/development/python-modules/skytemple-rust/default.nix b/pkgs/development/python-modules/skytemple-rust/default.nix index ddf1866a1056..d10ad3b7d18d 100644 --- a/pkgs/development/python-modules/skytemple-rust/default.nix +++ b/pkgs/development/python-modules/skytemple-rust/default.nix @@ -3,6 +3,7 @@ , buildPythonPackage , cargo , fetchFromGitHub +, fetchpatch , libiconv , Foundation , rustPlatform @@ -28,13 +29,23 @@ buildPythonPackage rec { hash = "sha256-KQA8dfHnuysx9EUySJXZ/52Hfq6AbALwkBp3B1WJJuc="; }; + patches = [ + # Necessary for python3Packages.skytemple-files tests to pass. + # https://github.com/SkyTemple/skytemple-files/issues/449 + (fetchpatch { + url = "https://github.com/SkyTemple/skytemple-rust/commit/eeeac215c58eda2375dc499aaa1950df0e859802.patch"; + hash = "sha256-9oUrwI+ZMI0Pg8F/nzLkf0YNkO9WSMkUAqDk4GuGfQo="; + includes = [ "src/st_kao.rs" ]; + }) + ]; + buildInputs = lib.optionals stdenv.isDarwin [ libiconv Foundation ]; nativeBuildInputs = [ setuptools-rust rustPlatform.cargoSetupHook cargo rustc ]; propagatedBuildInputs = [ range-typed-integers ]; GETTEXT_SYSTEM = true; - doCheck = false; # there are no tests + doCheck = false; # tests for this package are in skytemple-files package pythonImportsCheck = [ "skytemple_rust" ]; meta = with lib; {