2023-02-22 10:55:15 +00:00
|
|
|
{ lib
|
2024-01-02 11:29:13 +00:00
|
|
|
, python3
|
2023-02-22 10:55:15 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
}:
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
let
|
|
|
|
python = python3.override {
|
2024-09-19 14:19:46 +00:00
|
|
|
self = python;
|
2024-01-02 11:29:13 +00:00
|
|
|
packageOverrides = self: super: {
|
|
|
|
lark = super.lark.overridePythonAttrs (old: rec {
|
|
|
|
# gdtoolkit needs exactly this lark version
|
2024-06-20 14:57:18 +00:00
|
|
|
version = "1.1.9";
|
2024-01-02 11:29:13 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "lark-parser";
|
|
|
|
repo = "lark";
|
|
|
|
rev = version;
|
2024-06-20 14:57:18 +00:00
|
|
|
hash = "sha256-vDu+VPAXONY8J+A6oS7EiMeOMgzGms0nWpE+DKI1MVU=";
|
2024-01-02 11:29:13 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
patches = [ ];
|
|
|
|
});
|
|
|
|
};
|
2023-02-22 10:55:15 +00:00
|
|
|
};
|
|
|
|
in
|
2024-01-02 11:29:13 +00:00
|
|
|
python.pkgs.buildPythonApplication rec {
|
2023-02-22 10:55:15 +00:00
|
|
|
pname = "gdtoolkit";
|
2024-06-20 14:57:18 +00:00
|
|
|
version = "4.2.2";
|
2023-02-22 10:55:15 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Scony";
|
|
|
|
repo = "godot-gdscript-toolkit";
|
|
|
|
rev = version;
|
2024-06-20 14:57:18 +00:00
|
|
|
hash = "sha256-SvEKKuDnfxV+5AArg5ssrQzgIwRITdek4KYEs3d0n4Y=";
|
2023-02-22 10:55:15 +00:00
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
disabled = python.pythonOlder "3.7";
|
2023-02-22 10:55:15 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
propagatedBuildInputs = with python.pkgs; [
|
2023-02-22 10:55:15 +00:00
|
|
|
docopt
|
2024-01-02 11:29:13 +00:00
|
|
|
lark
|
2023-02-22 10:55:15 +00:00
|
|
|
pyyaml
|
|
|
|
setuptools
|
2024-01-02 11:29:13 +00:00
|
|
|
];
|
2023-02-22 10:55:15 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
nativeCheckInputs = with python.pkgs; [
|
2023-02-22 10:55:15 +00:00
|
|
|
pytestCheckHook
|
|
|
|
hypothesis
|
|
|
|
];
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
preCheck = ''
|
2023-02-22 10:55:15 +00:00
|
|
|
# The tests want to run the installed executables
|
|
|
|
export PATH=$out/bin:$PATH
|
|
|
|
|
|
|
|
# gdtoolkit tries to write cache variables to $HOME/.cache
|
|
|
|
export HOME=$TMP
|
|
|
|
'';
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
# The tests are not working on NixOS
|
|
|
|
disabledTestPaths = [
|
|
|
|
"tests/generated/test_expression_parsing.py"
|
|
|
|
"tests/gdradon/test_executable.py"
|
|
|
|
];
|
|
|
|
|
2023-02-22 10:55:15 +00:00
|
|
|
pythonImportsCheck = [ "gdtoolkit" "gdtoolkit.formatter" "gdtoolkit.linter" "gdtoolkit.parser" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Independent set of tools for working with Godot's GDScript - parser, linter and formatter";
|
|
|
|
homepage = "https://github.com/Scony/godot-gdscript-toolkit";
|
|
|
|
license = licenses.mit;
|
2024-06-20 14:57:18 +00:00
|
|
|
maintainers = with maintainers; [ squarepear ];
|
2023-02-22 10:55:15 +00:00
|
|
|
};
|
|
|
|
}
|