forked from mirrors/nixpkgs
python3Packages.hydra-core: unpin antlr4-python3-runtime
This commit is contained in:
parent
47967562fa
commit
b71ad92137
13
pkgs/development/python-modules/hydra-core/antlr4.patch
Normal file
13
pkgs/development/python-modules/hydra-core/antlr4.patch
Normal file
|
@ -0,0 +1,13 @@
|
|||
diff --git a/build_helpers/build_helpers.py b/build_helpers/build_helpers.py
|
||||
index 7159d22615..73db312bbe 100644
|
||||
--- a/build_helpers/build_helpers.py
|
||||
+++ b/build_helpers/build_helpers.py
|
||||
@@ -185,7 +185,7 @@ class ANTLRCommand(Command): # type: ignore
|
||||
command = [
|
||||
"java",
|
||||
"-jar",
|
||||
- join(root_dir, "bin/antlr-4.9.3-complete.jar"),
|
||||
+ "@antlr_jar@",
|
||||
"-Dlanguage=Python3",
|
||||
"-o",
|
||||
join(project_root, "hydra/grammar/gen/"),
|
|
@ -1,5 +1,6 @@
|
|||
{ stdenv
|
||||
, lib
|
||||
, antlr4
|
||||
, antlr4-python3-runtime
|
||||
, buildPythonPackage
|
||||
, fetchFromGitHub
|
||||
|
@ -8,6 +9,7 @@
|
|||
, omegaconf
|
||||
, pytestCheckHook
|
||||
, pythonOlder
|
||||
, substituteAll
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
|
@ -24,6 +26,21 @@ buildPythonPackage rec {
|
|||
hash = "sha256-4FOh1Jr+LM8ffh/xcAqMqKudKbXb2DZdxU+czq2xwxs=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
(substituteAll {
|
||||
src = ./antlr4.patch;
|
||||
antlr_jar = "${antlr4.out}/share/java/antlr-${antlr4.version}-complete.jar";
|
||||
})
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
# We substitute the path to the jar with the one from our antlr4
|
||||
# package, so this file becomes unused
|
||||
rm -v build_helpers/bin/antlr*-complete.jar
|
||||
|
||||
sed -i 's/antlr4-python3-runtime==.*/antlr4-python3-runtime/' requirements/requirements.txt
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
jre_headless
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue