2022-08-12 12:06:08 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2023-10-09 19:29:22 +00:00
|
|
|
, setuptools
|
2022-08-12 12:06:08 +00:00
|
|
|
, python
|
2023-10-09 19:29:22 +00:00
|
|
|
, antlr4
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "antlr4-python3-runtime";
|
|
|
|
inherit (antlr4.runtime.cpp) version src;
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
format = "pyproject";
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
disabled = python.pythonOlder "3.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
sourceRoot = "${src.name}/runtime/Python3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace tests/TestIntervalSet.py \
|
|
|
|
--replace "assertEquals" "assertEqual"
|
|
|
|
'';
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
# We use an asterisk because this expression is used also for old antlr
|
|
|
|
# versions, where there the tests directory is `test` and not `tests`.
|
|
|
|
# See e.g in package `baserow`.
|
2020-04-24 23:36:52 +00:00
|
|
|
checkPhase = ''
|
2024-01-13 08:15:51 +00:00
|
|
|
runHook preCheck
|
|
|
|
|
|
|
|
pushd tests
|
2022-12-28 21:21:41 +00:00
|
|
|
${python.interpreter} run.py
|
2024-01-13 08:15:51 +00:00
|
|
|
popd
|
|
|
|
|
|
|
|
runHook postCheck
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Runtime for ANTLR";
|
|
|
|
homepage = "https://www.antlr.org/";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
};
|
|
|
|
}
|