From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 0CU7HwXAb19VagAA0tVLHw (envelope-from ) for ; Sat, 26 Sep 2020 22:26:13 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id gPkkGwXAb19EWQAAbx9fmQ (envelope-from ) for ; Sat, 26 Sep 2020 22:26:13 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 30FC8940D36 for ; Sat, 26 Sep 2020 22:21:13 +0000 (UTC) Received: from localhost ([::1]:35722 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMIZ6-0008W8-4j for larch@yhetil.org; Sat, 26 Sep 2020 18:21:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35596) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMIY1-0007sa-Oi for guix-patches@gnu.org; Sat, 26 Sep 2020 18:20:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36416) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kMIY1-0003yW-Ap for guix-patches@gnu.org; Sat, 26 Sep 2020 18:20:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kMIY1-0004SE-71 for guix-patches@gnu.org; Sat, 26 Sep 2020 18:20:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43639] [PATCH 12/15] gnu: Add java-tunnelvisionlabs-antlr4-runtime-annotations. Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 26 Sep 2020 22:20:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43639 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 43639@debbugs.gnu.org Received: via spool by 43639-submit@debbugs.gnu.org id=B43639.160115875217007 (code B ref 43639); Sat, 26 Sep 2020 22:20:05 +0000 Received: (at 43639) by debbugs.gnu.org; 26 Sep 2020 22:19:12 +0000 Received: from localhost ([127.0.0.1]:47955 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMIX8-0004Q7-Jk for submit@debbugs.gnu.org; Sat, 26 Sep 2020 18:19:12 -0400 Received: from lepiller.eu ([89.234.186.109]:49480) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMIWs-0004Lo-EL for 43639@debbugs.gnu.org; Sat, 26 Sep 2020 18:18:59 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 6b0e94ce for <43639@debbugs.gnu.org>; Sat, 26 Sep 2020 22:18:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=pL2M3xDJEpC1qlylcDSOD0L3S 7WZqsaBbVsRLbO2I1w=; b=FswHTDfu3ndKdxU5LIIjLPAELJAXZONhqdctLaxRg iUv/ZyHCXR6EDuU1mx1lls/dvnkdbi6sT/ynbrrQoxZsXcP/gNM6F5xjvvfdtePT DWcM01PKjvOr9BUAn00JvT7gGy6buNfJS8ey4f58tK6ibG0OWPDcp8n/ojBcFsCf Mk3PmduYP7G0C/8dTt1iUUpyGTHavcCuHc1+/nHUWP1uffF3mEN9FGFcOn4S8WrQ Pvr1tNw/3xzR8naHBnFPJnuhZXtrTvN/TqKTj+f20DRGFs4/+ljK2cC92eN7HXCv R7iMTJLM/3CusscvXQywHRsN8fuGNk//Rqs1awjvf6eCA== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 3057480b (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <43639@debbugs.gnu.org>; Sat, 26 Sep 2020 22:18:46 +0000 (UTC) From: Julien Lepiller Date: Sun, 27 Sep 2020 00:18:21 +0200 Message-Id: <20200926221824.20925-12-julien@lepiller.eu> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200926221824.20925-1-julien@lepiller.eu> References: <20200927001335.40c2409a@tachikoma.lepiller.eu> <20200926221824.20925-1-julien@lepiller.eu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-TUID: 0hyBI5MrX41t * gnu/packages/java.scm (java-tunnelvisionlabs-antlr4-runtime-annotations): New variable. * gnu/packages/patches/java-tunnelvisionlabs-antlr-code-too-large.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + gnu/packages/java.scm | 38 ++++++++ ...unnelvisionlabs-antlr-code-too-large.patch | 87 +++++++++++++++++++ 3 files changed, 126 insertions(+) create mode 100644 gnu/packages/patches/java-tunnelvisionlabs-antlr-code-too-large.patch diff --git a/gnu/local.mk b/gnu/local.mk index 8e2f1976bf..01a825721d 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1161,6 +1161,7 @@ dist_patch_DATA = \ %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 \ %D%/packages/patches/java-jeromq-fix-tests.patch \ diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 198a06c292..73a5fbd693 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -8520,6 +8520,44 @@ parse trees."))) (list name package)))) (package-inputs antlr4))))) +(define-public java-tunnelvisionlabs-antlr4-runtime-annotations + (package + (inherit java-antlr4-runtime) + (name "java-tunnelvisionlabs-antlr4-runtime-annotations") + (version "4.7.4") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/tunnelvisionlabs/antlr4") + (commit (string-append version "-opt")))) + (file-name (git-file-name "java-tunnelvisionlabs-antlr4" version)) + (sha256 + (base32 + "1mf2lvvsszpialsk23ma83pwp50nd32lrbjpa847zlm5gmranbr8")) + (patches + (search-patches "java-antlr4-Add-standalone-generator.patch" + "java-tunnelvisionlabs-antlr-code-too-large.patch")))) + (arguments + `(#:jar-name "java-antlr4-runtime-annotations.jar" + #:source-dir "runtime/JavaAnnotations/src" + #:tests? #f; no tests + #:phases + (modify-phases %standard-phases + (add-after 'build 'copy-resources + (lambda _ + (copy-recursively "runtime/JavaAnnotations/resources" + "build/classes") + #t)) + (add-after 'copy-resources 'rebuild-jar + (lambda _ + (invoke "ant" "jar") + #t))))) + (inputs '()) + (native-inputs '()) + (synopsis "Annotations for ANTLR's runtime library") + (description "This package contains annotations used during the build of +the runtime library of ANTLR."))) + (define-public java-commons-cli-1.2 ;; This is a bootstrap dependency for Maven2. (package diff --git a/gnu/packages/patches/java-tunnelvisionlabs-antlr-code-too-large.patch b/gnu/packages/patches/java-tunnelvisionlabs-antlr-code-too-large.patch new file mode 100644 index 0000000000..7bdf05eb9c --- /dev/null +++ b/gnu/packages/patches/java-tunnelvisionlabs-antlr-code-too-large.patch @@ -0,0 +1,87 @@ +From 56ae699a27eca52cc0bb14cbc9944b62136be52b Mon Sep 17 00:00:00 2001 +From: Julien Lepiller +Date: Sun, 20 Sep 2020 21:07:29 +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 | 15 ++++++++++++--- + .../unicode/UnicodeDataTemplateController.java | 18 ++++++++++-------- + 2 files changed, 22 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 f5052b7..125d15b 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; +@@ -17,7 +17,7 @@ public enum UnicodeData { + ; + + private static final Map\ propertyCodePointRanges = new HashMap\(); +- private static final Map\ propertyAliases = new HashMap\(); ++ private static final Map\ propertyAliases = new HashMap\( + ); + + // Work around Java 64k bytecode method limit by splitting up static + // initialization into one method per Unicode property +@@ -33,8 +33,17 @@ static private void addProperty() { + \}}; separator="\n\n"> + + // Property aliases ++ static private void addPropertyAliasesA() { ++ ".toLowerCase(Locale.US), "".toLowerCase(Locale.US)); }; separator="\n"> ++ } ++ ++ static private void addPropertyAliasesB() { ++ ".toLowerCase(Locale.US), "".toLowerCase(Locale.US)); }; separator="\n"> ++ } ++ + static private void addPropertyAliases() { +- ".toLowerCase(Locale.US), "".toLowerCase(Locale.US)); }; separator="\n"> ++ addPropertyAliasesA(); ++ addPropertyAliasesB(); + } + + // 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 570190c..692cee0 100644 +--- a/tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java ++++ b/tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java +@@ -74,17 +74,19 @@ public abstract class UnicodeDataTemplateController { + addTR35ExtendedPictographicPropertyCodesToCodePointRanges(propertyCodePointRanges); + addEmojiPresentationPropertyCodesToCodePointRanges(propertyCodePointRanges); + +- Map propertyAliases = new LinkedHashMap(); +- addUnicodeCategoryCodesToNames(propertyAliases); +- addUnicodeBinaryPropertyCodesToNames(propertyAliases); +- addUnicodeScriptCodesToNames(propertyAliases); +- addUnicodeBlocksToNames(propertyAliases); +- addUnicodeIntPropertyCodesToNames(propertyAliases); +- propertyAliases.put("EP", "Extended_Pictographic"); ++ Map propertyAliasesA = new LinkedHashMap(); ++ Map propertyAliasesB = new LinkedHashMap(); ++ addUnicodeCategoryCodesToNames(propertyAliasesA); ++ addUnicodeBinaryPropertyCodesToNames(propertyAliasesA); ++ addUnicodeScriptCodesToNames(propertyAliasesA); ++ addUnicodeBlocksToNames(propertyAliasesB); ++ addUnicodeIntPropertyCodesToNames(propertyAliasesB); ++ propertyAliasesB.put("EP", "Extended_Pictographic"); + + Map properties = new LinkedHashMap(); + properties.put("propertyCodePointRanges", propertyCodePointRanges); +- properties.put("propertyAliases", propertyAliases); ++ properties.put("propertyAliasesA", propertyAliasesA); ++ properties.put("propertyAliasesB", propertyAliasesB); + return properties; + } + +-- +2.28.0 + -- 2.28.0