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
|
2021-12-06 16:07:01 +00:00
|
|
|
}:
|
2021-06-04 09:07:49 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "explorerscript";
|
2023-04-29 16:46:19 +00:00
|
|
|
version = "0.1.2";
|
2021-06-04 09:07:49 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "SkyTemple";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2023-04-29 16:46:19 +00:00
|
|
|
sha256 = "sha256-REQYyxB2sb/gG54+OkMw+M4Agg9SWfAyqAhiSNnd3tE=";
|
2021-06-04 09:07:49 +00:00
|
|
|
};
|
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
antlr4
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i "s/antlr4-python3-runtime.*/antlr4-python3-runtime',/" setup.py
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|