Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / skytemple-files / default.nix
blobd6a56883bc462a02c535f61a57c7a67b6cb2195f
1 { stdenv
2 , lib
3 , buildPythonPackage
4 , fetchFromGitHub
5 , appdirs
6 , dungeon-eos
7 , explorerscript
8 , ndspy
9 , pillow
10 , setuptools
11 , skytemple-rust
12 , tilequant
13 , pyyaml
14 , pmdsky-debug-py
15 , typing-extensions
16 , pythonOlder
17 , # optional dependancies for SpriteCollab
18   aiohttp
19 , lru-dict
20 , graphql-core
21 , gql
22 , armips
23   # tests
24 , pytestCheckHook
25 , parameterized
26 , xmldiff
29 buildPythonPackage rec {
30   pname = "skytemple-files";
31   version = "1.5.5";
33   src = fetchFromGitHub {
34     owner = "SkyTemple";
35     repo = pname;
36     rev = version;
37     hash = "sha256-PVHI3SuXXH+XpSaBhtSUT5I6wYK3WmwW67nJmPLKdg4=";
38     fetchSubmodules = true;
39   };
41   postPatch = ''
42     substituteInPlace skytemple_files/patch/arm_patcher.py skytemple_files/data/data_cd/armips_importer.py \
43       --replace "exec_name = os.getenv(\"SKYTEMPLE_ARMIPS_EXEC\", f\"{prefix}armips\")" "exec_name = \"${armips}/bin/armips\""
44   '';
46   buildInputs = [ armips ];
48   propagatedBuildInputs = [
49     appdirs
50     dungeon-eos
51     explorerscript
52     ndspy
53     pillow
54     setuptools
55     skytemple-rust
56     tilequant
57     pyyaml
58     pmdsky-debug-py
59   ] ++ lib.optionals (pythonOlder "3.9") [
60     typing-extensions
61   ];
63   passthru.optional-dependencies = {
64     spritecollab = [
65       aiohttp
66       gql
67       graphql-core
68       lru-dict
69     ] ++ gql.optional-dependencies.aiohttp;
70   };
72   checkInputs = [ pytestCheckHook parameterized xmldiff ] ++ passthru.optional-dependencies.spritecollab;
73   pytestFlagsArray = [ "test/" ];
74   disabledTestPaths = [
75     "test/skytemple_files_test/common/spritecollab/sc_online_test.py"
76     "test/skytemple_files_test/compression_container/atupx/atupx_test.py" # Particularly long test
77   ];
79   pythonImportsCheck = [ "skytemple_files" ];
81   meta = with lib; {
82     homepage = "https://github.com/SkyTemple/skytemple-files";
83     description = "Python library to edit the ROM of Pokémon Mystery Dungeon Explorers of Sky";
84     license = licenses.gpl3Plus;
85     maintainers = with maintainers; [ xfix marius851000 ];
86     broken = stdenv.isDarwin; # pyobjc is missing
87   };