2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2022-12-28 21:21:41 +00:00
|
|
|
, antlr4
|
2021-12-06 16:07:01 +00:00
|
|
|
, antlr4-python3-runtime
|
|
|
|
, igraph
|
|
|
|
, pygments
|
2022-12-28 21:21:41 +00:00
|
|
|
, pytestCheckHook
|
2023-10-09 19:29:22 +00:00
|
|
|
, pythonRelaxDepsHook
|
2021-12-06 16:07:01 +00:00
|
|
|
}:
|
2021-06-04 09:07:49 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "explorerscript";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "0.1.3";
|
2021-06-04 09:07:49 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "SkyTemple";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2023-10-09 19:29:22 +00:00
|
|
|
sha256 = "sha256-0U5n7e/utmgOTBuTypkBMeHZR7lji6lFimSjbC7hVRM=";
|
2021-06-04 09:07:49 +00:00
|
|
|
};
|
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
antlr4
|
2023-10-09 19:29:22 +00:00
|
|
|
pythonRelaxDepsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonRelaxDeps = [
|
|
|
|
# antlr output is rebuilt in postPatch step.
|
|
|
|
"antlr4-python3-runtime"
|
|
|
|
# igraph > 0.10.4 was marked as incompatible by upstream
|
|
|
|
# due to regression introduced in 0.10.5, which was fixed
|
|
|
|
# in igraph 0.10.6.
|
|
|
|
#
|
|
|
|
# https://github.com/igraph/python-igraph/issues/693
|
|
|
|
"igraph"
|
2022-12-28 21:21:41 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
antlr -Dlanguage=Python3 -visitor explorerscript/antlr/{ExplorerScript,SsbScript}.g4
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
antlr4-python3-runtime
|
|
|
|
igraph
|
|
|
|
];
|
|
|
|
|
|
|
|
passthru.optional-dependencies.pygments = [
|
|
|
|
pygments
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-12-28 21:21:41 +00:00
|
|
|
pytestCheckHook
|
|
|
|
] ++ passthru.optional-dependencies.pygments;
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"explorerscript"
|
|
|
|
];
|
2021-06-04 09:07:49 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/SkyTemple/explorerscript";
|
|
|
|
description = "A programming language + compiler/decompiler for creating scripts for Pokémon Mystery Dungeon Explorers of Sky";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ xfix ];
|
|
|
|
};
|
|
|
|
}
|