1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, antlr4
5, antlr4-python3-runtime
6, igraph
7, pygments
8, pytestCheckHook
9}:
10
11buildPythonPackage rec {
12 pname = "explorerscript";
13 version = "0.1.2";
14
15 src = fetchFromGitHub {
16 owner = "SkyTemple";
17 repo = pname;
18 rev = version;
19 sha256 = "sha256-REQYyxB2sb/gG54+OkMw+M4Agg9SWfAyqAhiSNnd3tE=";
20 };
21
22 nativeBuildInputs = [
23 antlr4
24 ];
25
26 postPatch = ''
27 sed -i "s/antlr4-python3-runtime.*/antlr4-python3-runtime',/" setup.py
28 antlr -Dlanguage=Python3 -visitor explorerscript/antlr/{ExplorerScript,SsbScript}.g4
29 '';
30
31 propagatedBuildInputs = [
32 antlr4-python3-runtime
33 igraph
34 ];
35
36 passthru.optional-dependencies.pygments = [
37 pygments
38 ];
39
40 nativeCheckInputs = [
41 pytestCheckHook
42 ] ++ passthru.optional-dependencies.pygments;
43
44 pythonImportsCheck = [
45 "explorerscript"
46 ];
47
48 meta = with lib; {
49 homepage = "https://github.com/SkyTemple/explorerscript";
50 description = "A programming language + compiler/decompiler for creating scripts for Pokémon Mystery Dungeon Explorers of Sky";
51 license = licenses.mit;
52 maintainers = with maintainers; [ xfix ];
53 };
54}