From 913c3ecd4e31361b5408e22b119977cf72b4a3c9 Mon Sep 17 00:00:00 2001 From: "Volkmar W. Pogatzki" Date: Fri, 29 Mar 2024 16:10:28 +0100 Subject: dev-java/antlr-tool: 3.5.3-java21.patch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes: https://bugs.gentoo.org/919481 Signed-off-by: Volkmar W. Pogatzki Closes: https://github.com/gentoo/gentoo/pull/35984 Signed-off-by: Miroslav Ć ulc --- dev-java/antlr-tool/antlr-tool-3.5.3-r1.ebuild | 77 ++++++++++++++++++++++ dev-java/antlr-tool/antlr-tool-3.5.3.ebuild | 75 --------------------- .../antlr-tool/files/antlr-tool-3.5.3-java21.patch | 11 ++++ 3 files changed, 88 insertions(+), 75 deletions(-) create mode 100644 dev-java/antlr-tool/antlr-tool-3.5.3-r1.ebuild delete mode 100644 dev-java/antlr-tool/antlr-tool-3.5.3.ebuild create mode 100644 dev-java/antlr-tool/files/antlr-tool-3.5.3-java21.patch diff --git a/dev-java/antlr-tool/antlr-tool-3.5.3-r1.ebuild b/dev-java/antlr-tool/antlr-tool-3.5.3-r1.ebuild new file mode 100644 index 000000000000..1997ce8c081f --- /dev/null +++ b/dev-java/antlr-tool/antlr-tool-3.5.3-r1.ebuild @@ -0,0 +1,77 @@ +# Copyright 1999-2024 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.3/tool/pom.xml#L4 +MAVEN_ID="org.antlr:antlr:3.5.3" + +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 ~x64-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" ) +PATCHES=( "${FILESDIR}/antlr-tool-3.5.3-java21.patch" ) + +src_prepare() { + java-pkg_clean + default #780585 + 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/antlr-tool-3.5.3.ebuild b/dev-java/antlr-tool/antlr-tool-3.5.3.ebuild deleted file mode 100644 index 0d99b11e44be..000000000000 --- a/dev-java/antlr-tool/antlr-tool-3.5.3.ebuild +++ /dev/null @@ -1,75 +0,0 @@ -# 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.3/tool/pom.xml#L4 -MAVEN_ID="org.antlr:antlr:3.5.3" - -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 ~x64-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 - 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/antlr-tool-3.5.3-java21.patch b/dev-java/antlr-tool/files/antlr-tool-3.5.3-java21.patch new file mode 100644 index 000000000000..2e196df96ef9 --- /dev/null +++ b/dev-java/antlr-tool/files/antlr-tool-3.5.3-java21.patch @@ -0,0 +1,11 @@ +bug #919481 +--- a/org/antlr/codegen/templates/Java/ST.stg ++++ b/org/antlr/codegen/templates/Java/ST.stg +@@ -32,6 +32,7 @@ + @outputFile.imports() ::= << + <@super.imports()> + import org.antlr.stringtemplate.*; ++import org.antlr.stringtemplate.StringTemplate; + import org.antlr.stringtemplate.language.*; + import java.util.HashMap; + >> -- cgit v1.2.3-65-gdbad