commit:     909450e1de5a80651db10160a29d8d4c2266756c
Author:     Yuan Liao <liaoyuan <AT> gmail <DOT> com>
AuthorDate: Thu Jan 20 21:50:51 2022 +0000
Commit:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
CommitDate: Tue Jan 25 09:30:03 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=909450e1

dev-java/antlr-tool: Initial import

Suggested-by: Miroslav Šulc <fordfrog <AT> gentoo.org>
Bug: https://bugs.gentoo.org/742554
Signed-off-by: Yuan Liao <liaoyuan <AT> gmail.com>
Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>

 dev-java/antlr-tool/Manifest                     |  2 +
 dev-java/antlr-tool/antlr-tool-3.5.2.ebuild      | 76 ++++++++++++++++++++++++
 dev-java/antlr-tool/files/3.5.2-test-fixes.patch | 36 +++++++++++
 dev-java/antlr-tool/metadata.xml                 | 11 ++++
 4 files changed, 125 insertions(+)

diff --git a/dev-java/antlr-tool/Manifest b/dev-java/antlr-tool/Manifest
new file mode 100644
index 000000000000..5af9733be86b
--- /dev/null
+++ b/dev-java/antlr-tool/Manifest
@@ -0,0 +1,2 @@
+DIST antlr-3.5.2.tar.gz 6927126 BLAKE2B 
1907229549434dfea6ef1fa915137a2f733bd61f0a40aacb131689df619d1c92e125453ec3d1febc5d92da1841ffbde060af196cff1ca8fb6f4684600375e161
 SHA512 
e2a0520093fb2a77dcd9d44f26a9fdd612dceaffb398c53b2b8cd29f4630830647ede29e8dd55b434cb2c165b0fd1d77968ec6e6de0798f14d9cdfd9e6fccd99
+DIST antlr-tool-3.5.2-sources.jar 957096 BLAKE2B 
39b75824e129c8111f302eb71407a683c59e91e79a3fa13c5386c4ba4aa322e706deb10b36df3591ab0843faff5702091d543272ee85d63cd92cb36cc72e1ceb
 SHA512 
50fece361b69299be0c0941e6fe2bfacfc39c0b3dad3320126a9a80cd0f053fbaa6332612e2bab2872db122025d6abfe4b35a4636ef1c101e9131bbd2cdf5e28

diff --git a/dev-java/antlr-tool/antlr-tool-3.5.2.ebuild 
b/dev-java/antlr-tool/antlr-tool-3.5.2.ebuild
new file mode 100644
index 000000000000..214b8c4d199c
--- /dev/null
+++ b/dev-java/antlr-tool/antlr-tool-3.5.2.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Artifact ID for antlr-tool is 'antlr'
+# https://github.com/antlr/antlr3/blob/3.5.2/tool/pom.xml#L4
+MAVEN_ID="org.antlr:antlr:3.5.2"
+
+JAVA_PKG_IUSE="doc source test"
+JAVA_TESTING_FRAMEWORKS="junit-4"
+
+inherit java-pkg-2 java-pkg-simple
+
+MY_PN="${PN%-tool}"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="The ANTLR 3 tool"
+HOMEPAGE="https://www.antlr3.org/";
+# Maven Central sources JAR for *.java sources pre-generated from *.g files;
+# the source generation requires this package itself.
+# Tarball for resources, the test suite, and DOCS files
+SRC_URI="
+       
https://repo1.maven.org/maven2/org/antlr/antlr/${PV}/${MY_P}-sources.jar -> 
${P}-sources.jar
+       https://github.com/antlr/antlr3/archive/${PV}.tar.gz -> ${MY_P}.tar.gz
+"
+
+LICENSE="BSD"
+SLOT="3.5"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos 
~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+
+CP_DEPEND="
+       ~dev-java/antlr-runtime-${PV}:${SLOT}
+       dev-java/stringtemplate:4
+"
+
+BDEPEND="
+       app-arch/unzip
+"
+
+DEPEND="
+       >=virtual/jdk-1.8:*
+       ${CP_DEPEND}
+"
+
+RDEPEND="
+       >=virtual/jre-1.8:*
+       ${CP_DEPEND}
+"
+
+S="${WORKDIR}"
+TARBALL_S="${S}/${MY_PN}3-${PV}"
+
+JAVA_SRC_DIR="org"
+JAVA_RESOURCE_DIRS=( "${TARBALL_S}/tool/src/main/resources" )
+
+JAVA_TEST_GENTOO_CLASSPATH="junit-4"
+JAVA_TEST_SRC_DIR="${TARBALL_S}/tool/src/test/java"
+
+DOCS=( "${TARBALL_S}/tool/CHANGES.txt" )
+
+src_prepare() {
+       java-pkg_clean
+       eapply -p0 "${FILESDIR}/${PV}-test-fixes.patch"
+       java-pkg-2_src_prepare
+
+       # Some tests fail under Java 8 in ways that probably aren't limited
+       # to the tests. This is bad but upstream is never going to update
+       # 3.5. At the time of writing, we only use it to build 4 anyway.
+       rm -v 
"${JAVA_TEST_SRC_DIR}/org/antlr/test/"Test{DFAConversion,SemanticPredicates,TopologicalSort}.java
 || die
+}
+
+src_install() {
+       java-pkg-simple_src_install
+       einstalldocs # https://bugs.gentoo.org/789582
+}

diff --git a/dev-java/antlr-tool/files/3.5.2-test-fixes.patch 
b/dev-java/antlr-tool/files/3.5.2-test-fixes.patch
new file mode 100644
index 000000000000..f2609ac1f0b5
--- /dev/null
+++ b/dev-java/antlr-tool/files/3.5.2-test-fixes.patch
@@ -0,0 +1,36 @@
+diff -Naur 
antlr3-3.5.2.orig/tool/src/test/java/org/antlr/test/TestAttributes.java 
antlr3-3.5.2/tool/src/test/java/org/antlr/test/TestAttributes.java
+--- antlr3-3.5.2.orig/tool/src/test/java/org/antlr/test/TestAttributes.java    
2014-03-25 11:47:54.000000000 +0000
++++ antlr3-3.5.2/tool/src/test/java/org/antlr/test/TestAttributes.java 
2015-10-02 22:42:56.921263410 +0100
+@@ -2131,7 +2132,7 @@
+               assertEquals(expecting, found);
+       }
+ 
+-      @Test public void testRuleLabelOnTwoDifferentRulesTemplate() throws 
Exception {
++      @org.junit.Ignore @Test public void 
testRuleLabelOnTwoDifferentRulesTemplate() throws Exception {
+               String grammar =
+                       "grammar T;\n"+
+                               "options {output=template;}\n"+
+diff -Naur 
antlr3-3.5.2.orig/tool/src/test/java/org/antlr/test/TestSyntacticPredicateEvaluation.java
 
antlr3-3.5.2/tool/src/test/java/org/antlr/test/TestSyntacticPredicateEvaluation.java
+--- 
antlr3-3.5.2.orig/tool/src/test/java/org/antlr/test/TestSyntacticPredicateEvaluation.java
  2014-03-25 11:47:54.000000000 +0000
++++ 
antlr3-3.5.2/tool/src/test/java/org/antlr/test/TestSyntacticPredicateEvaluation.java
       2015-10-02 22:43:07.303105023 +0100
+@@ -339,7 +340,7 @@
+               assertEquals("b:alt 2 a:alt 1\n", found);
+       }
+ 
+-      @Test public void testSynPredWithOutputTemplate() throws Exception {
++      @org.junit.Ignore @Test public void testSynPredWithOutputTemplate() 
throws Exception {
+               // really just seeing if it will compile
+               String grammar =
+                       "grammar T;\n" +
+diff -Naur 
antlr3-3.5.2.orig/tool/src/test/java/org/antlr/test/TestTreeParsing.java 
antlr3-3.5.2/tool/src/test/java/org/antlr/test/TestTreeParsing.java
+--- antlr3-3.5.2.orig/tool/src/test/java/org/antlr/test/TestTreeParsing.java   
2014-03-25 11:47:54.000000000 +0000
++++ antlr3-3.5.2/tool/src/test/java/org/antlr/test/TestTreeParsing.java        
2015-10-02 22:41:32.235554776 +0100
+@@ -141,7 +142,7 @@
+               assertEquals("alt 1\n", found);
+       }
+ 
+-      @Test public void testTemplateOutput() throws Exception {
++      @org.junit.Ignore @Test public void testTemplateOutput() throws 
Exception {
+               String grammar =
+                       "grammar T;\n" +
+                       "options {output=AST;}\n" +

diff --git a/dev-java/antlr-tool/metadata.xml b/dev-java/antlr-tool/metadata.xml
new file mode 100644
index 000000000000..ad571d3247b8
--- /dev/null
+++ b/dev-java/antlr-tool/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="project">
+               <email>[email protected]</email>
+               <name>Java</name>
+       </maintainer>
+       <upstream>
+               <remote-id type="github">antlr/antlr3</remote-id>
+       </upstream>
+</pkgmetadata>

Reply via email to