~ruther/guix-local

6ce5a6c2e34d5053fcd02883059ea16ca2ad5a75 — Marius Bakke 3 years ago fa0efe1
gnu: antlr4: Update to 4.10.1.

* gnu/packages/java.scm (java-antlr4-runtime): Update to 4.10.1.
[source](patches): Remove obsolete patch.
(java-antlr4-runtime-cpp): Add #:configure-flags.
(antlr4)[arguments]: Don't run tests from removed directory.  Enable one test;
exclude one file.
* gnu/packages/fontutils.scm (python-afdko)[arguments]: Add phase to build
with the C++ 17 standard.
4 files changed, 16 insertions(+), 101 deletions(-)

M gnu/local.mk
M gnu/packages/fontutils.scm
M gnu/packages/java.scm
D gnu/packages/patches/java-antlr4-fix-code-too-large.java
M gnu/local.mk => gnu/local.mk +0 -1
@@ 1330,7 1330,6 @@ dist_patch_DATA =						\
  %D%/packages/patches/jamvm-2.0.0-disable-branch-patching.patch	\
  %D%/packages/patches/jamvm-2.0.0-opcode-guard.patch		\
  %D%/packages/patches/java-antlr4-Add-standalone-generator.patch	\
  %D%/packages/patches/java-antlr4-fix-code-too-large.java	\
  %D%/packages/patches/java-tunnelvisionlabs-antlr-code-too-large.patch	\
  %D%/packages/patches/java-apache-ivy-port-to-latest-bouncycastle.patch	\
  %D%/packages/patches/java-commons-collections-fix-java8.patch \

M gnu/packages/fontutils.scm => gnu/packages/fontutils.scm +6 -0
@@ 164,6 164,12 @@ them as it goes.")
     (list
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'use-c++17
            (lambda _
              ;; ANTLR4 4.10 and later require C++ 17.
              (substitute* "CMakeLists.txt"
                (("CMAKE_CXX_STANDARD 11")
                 "CMAKE_CXX_STANDARD 17"))))
          (add-after 'unpack 'use-system-libxml2
            (lambda _
              ;; XXX: These horrifying substitutions revert this upstream

M gnu/packages/java.scm => gnu/packages/java.scm +10 -10
@@ 8701,7 8701,7 @@ actual rendering.")
(define-public java-antlr4-runtime
  (package
    (name "java-antlr4-runtime")
    (version "4.8")
    (version "4.10.1")
    (source (origin
              (method git-fetch)
              (uri (git-reference


@@ 8710,10 8710,9 @@ actual rendering.")
              (file-name (git-file-name name version))
              (sha256
               (base32
                "1qal3add26qxskm85nk7r758arladn5rcyjinmhlhznmpbbv9j8m"))
                "0ldvd9jm4nrivaw7i7wh1q40q6xgzmzirsywiakbhg8sppagqlv7"))
              (patches
                (search-patches "java-antlr4-Add-standalone-generator.patch"
                                "java-antlr4-fix-code-too-large.java"))))
                (search-patches "java-antlr4-Add-standalone-generator.patch"))))
    (build-system ant-build-system)
    (arguments
     `(#:jar-name "java-antlr4-runtime.jar"


@@ 8743,6 8742,8 @@ sources by ANTLR.")
      ;; TODO: try to run the tests under
      ;; runtime-testsuite/test/org/antlr/v4/test/runtime/cpp with antlr4.
      #:tests? #f                       ;no CMake test target
      ;; TODO: Building the tests wants to download googletest.
      #:configure-flags #~'("-DANTLR_BUILD_CPP_TESTS=OFF")
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'chdir


@@ 8771,10 8772,12 @@ generated sources by ANTLR.")))
    (arguments
     `(#:jar-name "antlr4.jar"
       #:source-dir "tool/src"
       #:test-dir "tool-testsuite/test:runtime-testsuite/test:runtime-testsuite/annotations/src"
       #:test-dir "tool-testsuite/test:runtime-testsuite/test"
       #:test-include (list "**/Test*.java")
       #:test-exclude (list
                        ;; no runnable method
                       ;; These have no runnable methods and fail because
                       ;; test-include above is too broad.
                        "**/TestContext.java"
                        "**/TestOutputReading.java"
                        ;; no @Test methods
                        "**/TestParserErrors.java"


@@ 8792,9 8795,7 @@ generated sources by ANTLR.")))
                        "**/TestFullContextParsing.java"
                        "**/TestCompositeLexers.java"
                        ;; Null pointer exception
                        "**/TestCompositeGrammars.java"
                        ;; Wrong assumption on emoji
                        "**/TestUnicodeData.java")
                        "**/TestCompositeGrammars.java")
       #:phases
       (modify-phases %standard-phases
         (add-before 'build 'fix-build.xml


@@ 8808,7 8809,6 @@ generated sources by ANTLR.")))
         (add-after 'bin-install 'check
           (lambda _
             (invoke "ant" "compile-tests")
             (invoke "ant" "check" "-Dtest.home=runtime-testsuite/annotations/src")
             (invoke "ant" "check" "-Dtest.home=runtime-testsuite/test")
             (invoke "ant" "check" "-Dtest.home=tool-testsuite/test")
             #t))

D gnu/packages/patches/java-antlr4-fix-code-too-large.java => gnu/packages/patches/java-antlr4-fix-code-too-large.java +0 -90
@@ 1,90 0,0 @@
From d22db2048534bdf3d9615117291f9d86564ff10d Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Sat, 19 Sep 2020 21:05:48 +0200
Subject: [PATCH] Separate addPropertyAliases in two methods

The quantity of data used to generate addPropertyAliases creates a big
method, that is too big for java and results in "error: code too large".
This is most likely due to added data between the expected version of
icu and the actual version of icu in Guix.
---
 .../org/antlr/v4/tool/templates/unicodedata.st | 17 ++++++++++++++---
 .../unicode/UnicodeDataTemplateController.java | 18 ++++++++++--------
 2 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/tool/resources/org/antlr/v4/tool/templates/unicodedata.st b/tool/resources/org/antlr/v4/tool/templates/unicodedata.st
index 0f22c73..3573873 100644
--- a/tool/resources/org/antlr/v4/tool/templates/unicodedata.st
+++ b/tool/resources/org/antlr/v4/tool/templates/unicodedata.st
@@ -1,4 +1,4 @@
-unicodedata(propertyCodePointRanges, propertyAliases) ::= <<
+unicodedata(propertyCodePointRanges, propertyAliasesA, propertyAliasesB) ::= <<
 package org.antlr.v4.unicode;
 
 import java.util.Arrays;
@@ -15,7 +15,7 @@ import org.antlr.v4.runtime.misc.Interval;
  */
 public abstract class UnicodeData {
        private static final Map\<String, IntervalSet\> propertyCodePointRanges = new HashMap\<\>(<length(propertyCodePointRanges)>);
-       private static final Map\<String, String\> propertyAliases = new HashMap\<\>(<length(propertyAliases)>);
+       private static final Map\<String, String\> propertyAliases = new HashMap\<\>(<length(propertyAliasesA)> + <length(propertyAliasesB)>);
 
        // Work around Java 64k bytecode method limit by splitting up static
        // initialization into one method per Unicode property
@@ -30,9 +30,20 @@ static private void addProperty<i>() {
        propertyCodePointRanges.put("<k>".toLowerCase(Locale.US), codePointRanges);
 \}}; separator="\n\n">
 
+       // Property aliases
+       static private void addPropertyAliases1() {
+              <propertyAliasesA.keys:{ k | propertyAliases.put("<k>".toLowerCase(Locale.US), "<propertyAliasesA.(k)>".toLowerCase(Locale.US)); }; separator="\n">
+       }
+
+       // Property aliases
+       static private void addPropertyAliases2() {
+              <propertyAliasesB.keys:{ k | propertyAliases.put("<k>".toLowerCase(Locale.US), "<propertyAliasesB.(k)>".toLowerCase(Locale.US)); }; separator="\n">
+       }
+
        // Property aliases
        static private void addPropertyAliases() {
-              <propertyAliases.keys:{ k | propertyAliases.put("<k>".toLowerCase(Locale.US), "<propertyAliases.(k)>".toLowerCase(Locale.US)); }; separator="\n">
+             addPropertyAliases1();
+             addPropertyAliases2();
        }
 
        // Put it all together
diff --git a/tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java b/tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java
index da244a3..dc591cb 100644
--- a/tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java
+++ b/tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java
@@ -78,17 +78,19 @@ public abstract class UnicodeDataTemplateController {
 		addTR35ExtendedPictographicPropertyCodesToCodePointRanges(propertyCodePointRanges);
 		addEmojiPresentationPropertyCodesToCodePointRanges(propertyCodePointRanges);
 
-		Map<String, String> propertyAliases = new LinkedHashMap<>();
-		addUnicodeCategoryCodesToNames(propertyAliases);
-		addUnicodeBinaryPropertyCodesToNames(propertyAliases);
-		addUnicodeScriptCodesToNames(propertyAliases);
-		addUnicodeBlocksToNames(propertyAliases);
-		addUnicodeIntPropertyCodesToNames(propertyAliases);
-		propertyAliases.put("EP", "Extended_Pictographic");
+		Map<String, String> propertyAliases1 = new LinkedHashMap<>();
+		Map<String, String> propertyAliases2 = new LinkedHashMap<>();
+		addUnicodeCategoryCodesToNames(propertyAliases1);
+		addUnicodeBinaryPropertyCodesToNames(propertyAliases1);
+		addUnicodeScriptCodesToNames(propertyAliases1);
+		addUnicodeBlocksToNames(propertyAliases2);
+		addUnicodeIntPropertyCodesToNames(propertyAliases2);
+		propertyAliases2.put("EP", "Extended_Pictographic");
 
 		Map<String, Object> properties = new LinkedHashMap<>();
 		properties.put("propertyCodePointRanges", propertyCodePointRanges);
-		properties.put("propertyAliases", propertyAliases);
+		properties.put("propertyAliasesA", propertyAliases1);
+		properties.put("propertyAliasesB", propertyAliases2);
 		return properties;
 	}
 
-- 
2.28.0