Subject: [PATCH 11/15] gnu: Add antlr4-4.1.

From: Julien Lepiller <[email-masked]>
Date: Sun, 27 Sep 2020 00:18:20 +0200

* gnu/packages/java.scm (antlr4-4.1): New variable.
---
 gnu/packages/java.scm | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 40a10be8b2..198a06c292 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -8484,6 +8484,42 @@ parse trees.")))
     (inputs
      `(("java-treelayout" ,java-treelayout)))))
 
+(define-public antlr4-4.1
+  (package
+    (inherit antlr4)
+    (version (package-version java-antlr4-runtime-4.1))
+    (source (package-source java-antlr4-runtime-4.1))
+    (arguments
+      (substitute-keyword-arguments (package-arguments antlr4)
+        ((#:test-dir _)
+         "tool/test")
+        ((#:test-exclude excludes)
+         `(list "**/TestParseErrors.java"
+                "**/TestTopologicalSort.java"
+                ,@excludes))
+        ((#:phases phases)
+         `(modify-phases ,phases
+            (delete 'generate-unicode)
+            (replace 'check
+              (lambda _
+                (invoke "ant" "check")
+                #t))
+            (add-before 'configure 'chmod
+              (lambda _
+                (chmod "build.xml" #o644)
+                #t))
+            (delete 'remove-graphemes)
+            (delete 'remove-unrelated-languages)
+            (delete 'generate-test-parsers)))))
+    (inputs
+      (map
+        (match-lambda
+          ((name package)
+           (if (equal? name "java-antlr4-runtime")
+               (list name java-antlr4-runtime-4.1)
+               (list name package))))
+        (package-inputs antlr4)))))
+
 (define-public java-commons-cli-1.2
   ;; This is a bootstrap dependency for Maven2.
   (package
-- 
2.28.0