mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 09:23:01 +00:00
python3Packages.omegaconf: relax antlr4 version
This commit is contained in:
parent
56918eebba
commit
47967562fa
13
pkgs/development/python-modules/omegaconf/antlr4.patch
Normal file
13
pkgs/development/python-modules/omegaconf/antlr4.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/build_helpers/build_helpers.py b/build_helpers/build_helpers.py
|
||||
index 6419e26..9e6c21c 100644
|
||||
--- a/build_helpers/build_helpers.py
|
||||
+++ b/build_helpers/build_helpers.py
|
||||
@@ -30,7 +30,7 @@ class ANTLRCommand(Command): # type: ignore # pragma: no cover
|
||||
command = [
|
||||
"java",
|
||||
"-jar",
|
||||
- str(build_dir / "bin" / "antlr-4.9.3-complete.jar"),
|
||||
+ "@antlr_jar@",
|
||||
"-Dlanguage=Python3",
|
||||
"-o",
|
||||
str(project_root / "omegaconf" / "grammar" / "gen"),
|
@ -1,4 +1,5 @@
|
||||
{ lib
|
||||
, antlr4
|
||||
, antlr4-python3-runtime
|
||||
, buildPythonPackage
|
||||
, fetchFromGitHub
|
||||
@ -8,6 +9,7 @@
|
||||
, pytestCheckHook
|
||||
, pythonOlder
|
||||
, pyyaml
|
||||
, substituteAll
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
@ -24,6 +26,21 @@ buildPythonPackage rec {
|
||||
hash = "sha256-Qxa4uIiX5TAyQ5rFkizdev60S4iVAJ08ES6FpNqf8zI=";
|
||||
};
|
||||
|
||||
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/base.txt
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
jre_minimal
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user