2024-06-05 15:53:02 +00:00
|
|
|
|
{
|
|
|
|
|
lib,
|
|
|
|
|
buildPythonPackage,
|
|
|
|
|
fetchFromGitHub,
|
|
|
|
|
igraph,
|
|
|
|
|
pygments,
|
2024-10-11 05:15:48 +00:00
|
|
|
|
scikit-build-core,
|
|
|
|
|
pybind11,
|
|
|
|
|
ninja,
|
|
|
|
|
ruff,
|
|
|
|
|
cmake,
|
2024-06-05 15:53:02 +00:00
|
|
|
|
pytestCheckHook,
|
|
|
|
|
setuptools,
|
2021-12-06 16:07:01 +00:00
|
|
|
|
}:
|
2021-06-04 09:07:49 +00:00
|
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
|
pname = "explorerscript";
|
2024-10-11 05:15:48 +00:00
|
|
|
|
version = "0.2.1.post2";
|
2024-02-29 20:09:43 +00:00
|
|
|
|
pyproject = true;
|
2021-06-04 09:07:49 +00:00
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "SkyTemple";
|
|
|
|
|
repo = pname;
|
|
|
|
|
rev = version;
|
2024-10-11 05:15:48 +00:00
|
|
|
|
hash = "sha256-cKEceWr7XmZbuomPOmjQ32ptAjz3LZDQBWAgZEFadDY=";
|
|
|
|
|
# Include a pinned antlr4 fork used as a C++ library
|
|
|
|
|
fetchSubmodules = true;
|
2021-06-04 09:07:49 +00:00
|
|
|
|
};
|
|
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
|
nativeBuildInputs = [
|
2024-02-29 20:09:43 +00:00
|
|
|
|
setuptools
|
2024-10-11 05:15:48 +00:00
|
|
|
|
scikit-build-core
|
|
|
|
|
ninja
|
|
|
|
|
cmake
|
|
|
|
|
ruff
|
2023-10-09 19:29:22 +00:00
|
|
|
|
];
|
|
|
|
|
|
2024-10-11 05:15:48 +00:00
|
|
|
|
# The source include some auto-generated ANTLR code that could be recompiled, but trying that resulted in a crash while decompiling unionall.ssb.
|
|
|
|
|
# We thus do not rebuild them.
|
2022-12-28 21:21:41 +00:00
|
|
|
|
|
|
|
|
|
postPatch = ''
|
2024-10-11 05:15:48 +00:00
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
|
--replace-fail ./generate_parser_bindings.py "python3 ./generate_parser_bindings.py"
|
|
|
|
|
|
|
|
|
|
# Doesn’t detect that package for some reason
|
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
|
--replace-fail "\"scikit-build-core<=0.9.8\"," ""
|
2022-12-28 21:21:41 +00:00
|
|
|
|
'';
|
|
|
|
|
|
2024-10-11 05:15:48 +00:00
|
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
|
igraph
|
2024-10-11 05:15:48 +00:00
|
|
|
|
pybind11
|
2022-12-28 21:21:41 +00:00
|
|
|
|
];
|
|
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
|
optional-dependencies.pygments = [ pygments ];
|
2022-12-28 21:21:41 +00:00
|
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
|
nativeCheckInputs = [ pytestCheckHook ] ++ optional-dependencies.pygments;
|
2022-12-28 21:21:41 +00:00
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
|
pythonImportsCheck = [ "explorerscript" ];
|
2021-06-04 09:07:49 +00:00
|
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
|
homepage = "https://github.com/SkyTemple/explorerscript";
|
2024-06-20 14:57:18 +00:00
|
|
|
|
description = "Programming language + compiler/decompiler for creating scripts for Pokémon Mystery Dungeon Explorers of Sky";
|
2021-06-04 09:07:49 +00:00
|
|
|
|
license = licenses.mit;
|
2024-05-15 15:35:15 +00:00
|
|
|
|
maintainers = with maintainers; [ marius851000 ];
|
2021-06-04 09:07:49 +00:00
|
|
|
|
};
|
|
|
|
|
}
|