Unverified Commit 5e64e631 authored by Peder Bergebakken Sundt's avatar Peder Bergebakken Sundt Committed by GitHub
Browse files

Merge pull request #269193 from xfix/skytemple-files-fix-build

python3Packages.skytemple-files: fix build
parents 61ef31b7 885db56d
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -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\""
+12 −1
Original line number Diff line number Diff line
@@ -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; {