1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 igraph,
6 pygments,
7 scikit-build-core,
8 pybind11,
9 ninja,
10 cmake,
11 pytestCheckHook,
12 setuptools,
13}:
14
15buildPythonPackage rec {
16 pname = "explorerscript";
17 version = "0.2.3";
18 pyproject = true;
19
20 src = fetchFromGitHub {
21 owner = "SkyTemple";
22 repo = "explorerscript";
23 tag = version;
24 hash = "sha256-fh40HCU12AVA3cZ5xvRott+93qo8VzHFsbPzTkoV3x4=";
25 # Include a pinned antlr4 fork used as a C++ library
26 fetchSubmodules = true;
27 };
28
29 postPatch = ''
30 substituteInPlace pyproject.toml \
31 --replace-fail "scikit-build-core>=0.10.7, < 0.11" "scikit-build-core"
32 '';
33
34 build-system = [
35 setuptools
36 scikit-build-core
37 pybind11
38 ];
39
40 nativeBuildInputs = [
41 cmake
42 ninja
43 ];
44
45 # The source include some auto-generated ANTLR code that could be recompiled, but trying that resulted in a crash while decompiling unionall.ssb.
46 # We thus do not rebuild them.
47
48 dontUseCmakeConfigure = true;
49
50 pythonRelaxDeps = [
51 "igraph"
52 ];
53
54 dependencies = [
55 igraph
56 ];
57
58 optional-dependencies.pygments = [ pygments ];
59
60 nativeCheckInputs = [ pytestCheckHook ] ++ optional-dependencies.pygments;
61
62 pythonImportsCheck = [ "explorerscript" ];
63
64 meta = {
65 homepage = "https://github.com/SkyTemple/explorerscript";
66 description = "Programming language + compiler/decompiler for creating scripts for Pokémon Mystery Dungeon Explorers of Sky";
67 license = lib.licenses.mit;
68 maintainers = with lib.maintainers; [ marius851000 ];
69 };
70}