diff --git a/pkgs/development/python-modules/antlr4-python2-runtime/default.nix b/pkgs/development/python-modules/antlr4-python2-runtime/default.nix index b343be1d7bbf..aa18a0fe2907 100644 --- a/pkgs/development/python-modules/antlr4-python2-runtime/default.nix +++ b/pkgs/development/python-modules/antlr4-python2-runtime/default.nix @@ -1,18 +1,21 @@ -{ stdenv, fetchPypi, buildPythonPackage, isPy3k }: +{ lib, buildPythonPackage, isPy3k, python +, antlr4 +}: buildPythonPackage rec { pname = "antlr4-python2-runtime"; - version = "4.7.2"; + inherit (antlr4.runtime.cpp) version src; disabled = isPy3k; - src = fetchPypi { - inherit pname version; - sha256 = "04ljic5wnqpizln8q3c78pqrckz6q5nb433if00j1mlyv2yja22q"; - }; + sourceRoot = "source/runtime/Python2"; - meta = { + checkPhase = '' + ${python.interpreter} tests/TestTokenStreamRewriter.py + ''; + + meta = with lib; { description = "Runtime for ANTLR"; homepage = "https://www.antlr.org/"; - license = stdenv.lib.licenses.bsd3; + license = licenses.bsd3; }; } diff --git a/pkgs/development/python-modules/antlr4-python3-runtime/default.nix b/pkgs/development/python-modules/antlr4-python3-runtime/default.nix index 3ebba9f9d385..0fade1362c9c 100644 --- a/pkgs/development/python-modules/antlr4-python3-runtime/default.nix +++ b/pkgs/development/python-modules/antlr4-python3-runtime/default.nix @@ -1,18 +1,22 @@ -{ stdenv, fetchPypi, buildPythonPackage, isPy3k }: +{ lib, buildPythonPackage, isPy3k, python +, antlr4 +}: buildPythonPackage rec { pname = "antlr4-python3-runtime"; - version = "4.7.2"; + inherit (antlr4.runtime.cpp) version src; disabled = !isPy3k; - src = fetchPypi { - inherit pname version; - sha256 = "02xm7ccsf51vh4xsnhlg6pvchm1x3ckgv9kwm222w5drizndr30n"; - }; + sourceRoot = "source/runtime/Python3"; - meta = { + checkPhase = '' + cd test + ${python.interpreter} ctest.py + ''; + + meta = with lib; { description = "Runtime for ANTLR"; homepage = "https://www.antlr.org/"; - license = stdenv.lib.licenses.bsd3; + license = licenses.bsd3; }; } diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index a610ef51d8c6..0e21f19d8bb4 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1379,9 +1379,9 @@ in { amqplib = callPackage ../development/python-modules/amqplib {}; - antlr4-python2-runtime = callPackage ../development/python-modules/antlr4-python2-runtime {}; + antlr4-python2-runtime = callPackage ../development/python-modules/antlr4-python2-runtime { antlr4 = pkgs.antlr4; }; - antlr4-python3-runtime = callPackage ../development/python-modules/antlr4-python3-runtime {}; + antlr4-python3-runtime = callPackage ../development/python-modules/antlr4-python3-runtime { antlr4 = pkgs.antlr4; }; apipkg = callPackage ../development/python-modules/apipkg {};