2023-04-29 16:46:19 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, appdirs
|
|
|
|
, dungeon-eos
|
|
|
|
, explorerscript
|
|
|
|
, ndspy
|
|
|
|
, pillow
|
|
|
|
, setuptools
|
|
|
|
, skytemple-rust
|
|
|
|
, tilequant
|
|
|
|
, pyyaml
|
|
|
|
, pmdsky-debug-py
|
2024-01-02 11:29:13 +00:00
|
|
|
, range-typed-integers
|
|
|
|
, importlib-resources
|
2023-04-29 16:46:19 +00:00
|
|
|
, typing-extensions
|
|
|
|
, pythonOlder
|
|
|
|
, # optional dependancies for SpriteCollab
|
|
|
|
aiohttp
|
|
|
|
, lru-dict
|
|
|
|
, graphql-core
|
|
|
|
, gql
|
|
|
|
, armips
|
2023-07-15 17:15:38 +00:00
|
|
|
# tests
|
2023-04-29 16:46:19 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, parameterized
|
|
|
|
, xmldiff
|
2021-09-18 10:52:07 +00:00
|
|
|
}:
|
2021-06-04 09:07:49 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "skytemple-files";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "1.6.5";
|
2024-01-02 11:29:13 +00:00
|
|
|
pyproject = true;
|
2021-06-04 09:07:49 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "SkyTemple";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-y6VHRfwQNoehp06BoZXuprYtsiGgoNL4rztJw40P4FI=";
|
|
|
|
# Most patches are in submodules
|
|
|
|
fetchSubmodules = true;
|
2021-06-04 09:07:49 +00:00
|
|
|
};
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
postPatch = ''
|
2023-10-09 19:29:22 +00:00
|
|
|
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\""
|
2021-06-28 23:13:55 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [ armips ];
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
appdirs
|
|
|
|
dungeon-eos
|
|
|
|
explorerscript
|
|
|
|
ndspy
|
|
|
|
pillow
|
|
|
|
setuptools
|
|
|
|
skytemple-rust
|
|
|
|
tilequant
|
|
|
|
pyyaml
|
|
|
|
pmdsky-debug-py
|
2024-01-02 11:29:13 +00:00
|
|
|
range-typed-integers
|
2023-04-29 16:46:19 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.9") [
|
2024-01-02 11:29:13 +00:00
|
|
|
importlib-resources
|
2023-04-29 16:46:19 +00:00
|
|
|
typing-extensions
|
|
|
|
];
|
|
|
|
|
|
|
|
passthru.optional-dependencies = {
|
|
|
|
spritecollab = [
|
|
|
|
aiohttp
|
|
|
|
gql
|
|
|
|
graphql-core
|
|
|
|
lru-dict
|
|
|
|
] ++ gql.optional-dependencies.aiohttp;
|
|
|
|
};
|
|
|
|
|
|
|
|
checkInputs = [ pytestCheckHook parameterized xmldiff ] ++ passthru.optional-dependencies.spritecollab;
|
2023-07-15 17:15:38 +00:00
|
|
|
pytestFlagsArray = [ "test/" ];
|
2023-04-29 16:46:19 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
"test/skytemple_files_test/common/spritecollab/sc_online_test.py"
|
|
|
|
"test/skytemple_files_test/compression_container/atupx/atupx_test.py" # Particularly long test
|
|
|
|
];
|
2021-06-04 09:07:49 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [ "skytemple_files" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/SkyTemple/skytemple-files";
|
|
|
|
description = "Python library to edit the ROM of Pokémon Mystery Dungeon Explorers of Sky";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "skytemple_export_maps";
|
2021-06-04 09:07:49 +00:00
|
|
|
license = licenses.gpl3Plus;
|
2024-05-15 15:35:15 +00:00
|
|
|
maintainers = with maintainers; [ marius851000 ];
|
2022-05-18 14:49:53 +00:00
|
|
|
broken = stdenv.isDarwin; # pyobjc is missing
|
2021-06-04 09:07:49 +00:00
|
|
|
};
|
|
|
|
}
|