Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{ lib
, python3
, fetchFromGitHub
, godot3-server
}:

let
Expand All @@ -23,15 +22,15 @@ let
};
in
python.pkgs.buildPythonApplication rec {
pname = "gdtoolkit";
version = "3.3.1";
pname = "gdtoolkit3";
version = "3.5.0";

# If we try to get using fetchPypi it requires GeoIP (but the package dont has that dep!?)
src = fetchFromGitHub {
owner = "Scony";
repo = "godot-gdscript-toolkit";
rev = version;
sha256 = "13nnpwy550jf5qnm9ixpxl1bwfnhhbiys8vqfd25g3aim4bm3gnn";
hash = "sha256-cMGD5Xdf9ElS1NT7Q0NPB//EvUO0MI0VTtps5JRisZ4=";
};

disabled = python.pythonOlder "3.7";
Expand All @@ -48,35 +47,18 @@ python.pkgs.buildPythonApplication rec {
nativeCheckInputs = with python.pkgs; [
pytestCheckHook
hypothesis
godot3-server
];

preCheck =
let
godotServerMajorVersion = lib.versions.major godot3-server.version;
gdtoolkitMajorVersion = lib.versions.major version;
msg = ''
gdtoolkit major version ${gdtoolkitMajorVersion} does not match godot-server major version ${godotServerMajorVersion}!
gdtoolkit needs a matching godot-server for its tests.
If you see this error, you can either:
- disable doCheck for gdtoolkit, or
- provide a compatible godot-server version to gdtoolkit"
'';
in lib.throwIf (godotServerMajorVersion != gdtoolkitMajorVersion) msg ''
# The tests want to run the installed executables
export PATH=$out/bin:$PATH
preCheck = ''
# 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
# gdtoolkit tries to write cache variables to $HOME/.cache
export HOME=$TMP
'';

# Work around https://github.com/godotengine/godot/issues/20503
# Without this, Godot will complain about a missing project file
touch project.godot

# Remove broken test case
# (hard to skip via disabledTests since the test name contains an absolute path)
rm tests/potential-godot-bugs/multiline-subscription-expression.gd
'';
# The tests are not working on NixOS
disabledTests = [ "test_cc_on_empty_file_succeeds" "test_cc_on_file_with_single_function_succeeds" ];

pythonImportsCheck = [ "gdtoolkit" "gdtoolkit.formatter" "gdtoolkit.linter" "gdtoolkit.parser" ];

Expand Down
73 changes: 73 additions & 0 deletions pkgs/by-name/gd/gdtoolkit_4/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{ lib
, python3
, fetchFromGitHub
}:

let
python = python3.override {
packageOverrides = self: super: {
lark = super.lark.overridePythonAttrs (old: rec {
# gdtoolkit needs exactly this lark version
version = "1.1.9";
src = fetchFromGitHub {
owner = "lark-parser";
repo = "lark";
rev = version;
hash = "sha256-vDu+VPAXONY8J+A6oS7EiMeOMgzGms0nWpE+DKI1MVU=";
fetchSubmodules = true;
};
patches = [ ];
});
};
};
in
python.pkgs.buildPythonApplication rec {
pname = "gdtoolkit";
version = "4.2.2";

src = fetchFromGitHub {
owner = "Scony";
repo = "godot-gdscript-toolkit";
rev = version;
hash = "sha256-SvEKKuDnfxV+5AArg5ssrQzgIwRITdek4KYEs3d0n4Y=";
};

disabled = python.pythonOlder "3.7";

propagatedBuildInputs = with python.pkgs; [
docopt
lark
pyyaml
setuptools
];

doCheck = true;

nativeCheckInputs = with python.pkgs; [
pytestCheckHook
hypothesis
];

preCheck = ''
# 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
'';

# The tests are not working on NixOS
disabledTestPaths = [
"tests/generated/test_expression_parsing.py"
"tests/gdradon/test_executable.py"
];

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;
maintainers = with maintainers; [ squarepear ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/aliases.nix
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,8 @@ mapAliases ({
godot-headless = throw "godot-headless has been renamed to godot3-headless to distinguish from version 4"; # Added 2023-07-16
godot-server = throw "godot-server has been renamed to godot3-server to distinguish from version 4"; # Added 2023-07-16

gdtoolkit = throw "gdtoolkit has been renamed to gdtoolkit_3 to distinguish from version 4"; # Added 2024-02-17
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whats the justification for now having this toplevel attribute ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like with the package name, I followed how this was implemented for Godot 3 and 4.

godot = throw "godot has been renamed to godot3 to distinguish from version 4"; # Added 2023-07-16


google-chrome-beta = throw "'google-chrome-beta' has been removed due to the lack of maintenance in nixpkgs. Consider using 'google-chrome' instead."; # Added 2023-10-18
google-chrome-dev = throw "'google-chrome-dev' has been removed due to the lack of maintenance in nixpkgs. Consider using 'google-chrome' instead."; # Added 2023-10-18
google-gflags = throw "'google-gflags' has been renamed to/replaced by 'gflags'"; # Converted to throw 2023-09-10
Expand Down
2 changes: 0 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8423,8 +8423,6 @@ with pkgs;

gdmap = callPackage ../tools/system/gdmap { };

gdtoolkit = callPackage ../development/tools/gdtoolkit { };

gef = callPackage ../development/tools/misc/gef { };

gelasio = callPackage ../data/fonts/gelasio { };
Expand Down