From 4a0fefa62c63ade30b58bc05514c2fae9e45b36a Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 27 Dec 2022 20:48:03 +0100 Subject: [PATCH] python3Packages.explorerscript: unpin antlr4-python3-runtime and regenerate required antlr files with out antlr4 package. Co-Authored-By: Konrad Borowski --- .../python-modules/explorerscript/default.nix | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/explorerscript/default.nix b/pkgs/development/python-modules/explorerscript/default.nix index a77c31e26a63..4a79dc31c195 100644 --- a/pkgs/development/python-modules/explorerscript/default.nix +++ b/pkgs/development/python-modules/explorerscript/default.nix @@ -2,9 +2,11 @@ , buildPythonPackage , fetchFromGitHub , fetchpatch +, antlr4 , antlr4-python3-runtime , igraph , pygments +, pytestCheckHook }: buildPythonPackage rec { @@ -18,6 +20,10 @@ buildPythonPackage rec { sha256 = "1vzyliiyrxx8l9sfbqcyr4xn5swd7znkxy69kn0vb5rban8hm9c1"; }; + nativeBuildInputs = [ + antlr4 + ]; + patches = [ # https://github.com/SkyTemple/ExplorerScript/pull/17 (fetchpatch { @@ -26,8 +32,27 @@ buildPythonPackage rec { }) ]; - propagatedBuildInputs = [ antlr4-python3-runtime igraph ]; - checkInputs = [ pygments ]; + postPatch = '' + sed -i "s/antlr4-python3-runtime.*/antlr4-python3-runtime',/" setup.py + antlr -Dlanguage=Python3 -visitor explorerscript/antlr/{ExplorerScript,SsbScript}.g4 + ''; + + propagatedBuildInputs = [ + antlr4-python3-runtime + igraph + ]; + + passthru.optional-dependencies.pygments = [ + pygments + ]; + + checkInputs = [ + pytestCheckHook + ] ++ passthru.optional-dependencies.pygments; + + pythonImportsCheck = [ + "explorerscript" + ]; meta = with lib; { homepage = "https://github.com/SkyTemple/explorerscript";