summaryrefslogtreecommitdiff
path: root/dev-java/antlr-runtime
diff options
context:
space:
mode:
Diffstat (limited to 'dev-java/antlr-runtime')
-rw-r--r--dev-java/antlr-runtime/Manifest1
-rw-r--r--dev-java/antlr-runtime/antlr-runtime-4.9.3.ebuild130
-rw-r--r--dev-java/antlr-runtime/files/4.9.3-test-fixes.patch26
3 files changed, 0 insertions, 157 deletions
diff --git a/dev-java/antlr-runtime/Manifest b/dev-java/antlr-runtime/Manifest
index b254f9f52ea6..8acf95799018 100644
--- a/dev-java/antlr-runtime/Manifest
+++ b/dev-java/antlr-runtime/Manifest
@@ -1,3 +1,2 @@
DIST antlr-4.13.2.tar.gz 4167326 BLAKE2B 709f3c18329e08a811d7a4e5258fc0183ba6fa6ab62fe83ab694360cf1ce2bb3aa3f30cc62a0339a6ff8b64dd0a766057fd6f751cfc34a4e05051e4d54a57fad SHA512 afd8ecab637a0e70cddf98f63c918eab2b907f87207624e20e80a79f885d6502d4ab734a602b1707969d61944410828b689ec2f8b09c15314fe991024cde1613
-DIST antlr-4.9.3.tar.gz 4640242 BLAKE2B fb58f5e533051cb2c439c32f0462c1d463c99df862ba7e1a37a1c61378ab36a9edb9525c2a342de5b517da6f02d8291de5976c550932314f3464aad1a778afb9 SHA512 61452404c9639b5a0908cda16605f17c0fed0c9adfc3278c7408f9971420e9d1fe8f9e974e0826c2e3e780fdd83324094c0246cd5b28fa63f5686b094ea08127
DIST antlr-runtime-3.5.3-sources.jar 204572 BLAKE2B 8f4493497cbfef613028d4847d1a68a0fdd29f5bf80c3a72b33093aa048409fb740aa95e16e7ceb279b939fabf3a617ccc8046ef6b879eafdb4ae14599951799 SHA512 fbfb656b32aa40ce731996774c9a5df28e2dbf67d097a834b39ef137555ff618c26a881af599191fb75366dc3824e281e93a32dbed65d49cc39e2017d836ae95
diff --git a/dev-java/antlr-runtime/antlr-runtime-4.9.3.ebuild b/dev-java/antlr-runtime/antlr-runtime-4.9.3.ebuild
deleted file mode 100644
index 99f84e8023e7..000000000000
--- a/dev-java/antlr-runtime/antlr-runtime-4.9.3.ebuild
+++ /dev/null
@@ -1,130 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-JAVA_PKG_IUSE="doc source test"
-MAVEN_ID="org.antlr:antlr4-runtime:4.9.3"
-JAVA_TESTING_FRAMEWORKS="junit-4"
-
-inherit java-pkg-2 java-pkg-simple
-
-MY_PN="${PN%-runtime}"
-MY_P="${MY_PN}-${PV}"
-
-DESCRIPTION="ANTLR 4 Runtime"
-HOMEPAGE="https://www.antlr.org/"
-SRC_URI="https://github.com/antlr/antlr4/archive/${PV}.tar.gz -> ${MY_P}.tar.gz"
-
-LICENSE="BSD"
-SLOT="4"
-KEYWORDS="amd64 arm64 ppc64"
-
-DEPEND="
- >=virtual/jdk-1.8:*
- test? (
- ~dev-java/antlr-tool-${PV}:${SLOT}
- dev-java/jol-core:0
- )
-"
-
-RDEPEND="
- >=virtual/jre-1.8:*
-"
-
-S="${WORKDIR}/${MY_PN}4-${PV}"
-
-JAVA_SRC_DIR="runtime/Java/src"
-
-JAVA_TEST_GENTOO_CLASSPATH="
- junit-4
- antlr-tool-${SLOT}
- jol-core
-"
-JAVA_TEST_SRC_DIR=(
- runtime-testsuite/test
- runtime-testsuite/annotations
-)
-JAVA_TEST_RESOURCE_DIRS=(
- runtime-testsuite/resources
-)
-
-src_prepare() {
- java-pkg_clean
- eapply "${FILESDIR}/${PV}-test-fixes.patch"
- java-pkg-2_src_prepare
-}
-
-src_test() {
- # Build classpath for tests
- # The JAR created during src_compile must appear in the classpath *before*
- # any dependencies to ensure that *it* is the JAR being tested; otherwise,
- # because the test suite depends on antlr-tool, which depends on this
- # package, the copy of this package's JAR installed on the system would be
- # tested instead when it appears earlier in the classpath, which might
- # cause test failures when the version being built differs from the version
- # already installed on the system, like https://bugs.gentoo.org/834138
- local CP="${S}/${JAVA_JAR_FILENAME}"
- local test_dep res_dir
- for test_dep in ${JAVA_TEST_GENTOO_CLASSPATH}; do
- CP+=":$(java-pkg_getjars --with-dependencies "${test_dep}")"
- done
- for res_dir in "${JAVA_TEST_RESOURCE_DIRS[@]}"; do
- CP+=":${res_dir}"
- done
-
- pushd "${JAVA_TEST_SRC_DIR[0]}" > /dev/null ||
- die "Failed to enter test source directory for ${PN}"
-
- einfo "Removing tests for non-Java runtimes ..."
- find org/antlr/v4/test/runtime/* -maxdepth 0 -type d \
- -not -name category -not -name descriptors -not -name java \
- -exec einfo " {}" \; -exec rm -r "{}" + ||
- die "Failed to remove tests for non-Java runtimes"
-
- einfo "Generating ANTLR 4 parsers for tests ..."
- local java_exe="$(java-config -J)"
- local g4_files=( $(find * -name "*.g4") )
- local file
- for file in "${g4_files[@]}"; do
- local java_pkg="${file%/*.g4}"
- java_pkg="${java_pkg//\//.}"
- "${java_exe}" -cp "${CP}" org.antlr.v4.Tool \
- -visitor -package "${java_pkg}" "${file}" ||
- die "Failed to generate ANTLR 4 parser from ${file}"
- done
-
- # Create a list of tests to run
- # https://github.com/antlr/antlr4/blob/4.9.3/runtime-testsuite/pom.xml#L100
- # Excluding classes with "No runnable methods"
- local TESTS=$(find * -type f -name "Test*.java" \
- -not -name "TestContext.java" \
- -not -name "TestOutputReading.java"
- )
- TESTS="${TESTS//.java}"
- TESTS="${TESTS//\//.}"
-
- popd > /dev/null || die "Failed to leave test source directory for ${PN}"
-
- local classes="target/classes"
-
- # Compile the annotation processor of @CommentHasStringValue
- # before the test sources (requires tools.jar)
- ejavac -d "${classes}" -cp "${CP}:$(java-config -t)" \
- $(find runtime-testsuite/{annotations,processors} -name "*.java")
- local processor_cp="${classes}:runtime-testsuite/processors/resources"
-
- # Compile Java test sources, and process @CommentHasStringValue
- # annotations at the same time
- local javac_extra_args=()
- if ver_test "$(java-config -g PROVIDES_VERSION)" -ge 17; then
- javac_extra_args+=(
- -J--add-opens=jdk.compiler/com.sun.tools.javac.{main,model,tree,util}=ALL-UNNAMED
- )
- fi
- ejavac -d "${classes}" -cp "${CP}:${processor_cp}" \
- "${javac_extra_args[@]}" \
- $(find "${JAVA_TEST_SRC_DIR[@]}" -name "*.java")
-
- ejunit4 -classpath "${classes}:${CP}" ${TESTS}
-}
diff --git a/dev-java/antlr-runtime/files/4.9.3-test-fixes.patch b/dev-java/antlr-runtime/files/4.9.3-test-fixes.patch
deleted file mode 100644
index 9cb6884ba194..000000000000
--- a/dev-java/antlr-runtime/files/4.9.3-test-fixes.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 3eabbddff69dcbcaf9a59f407cc8bef4be8e215b Mon Sep 17 00:00:00 2001
-From: Yuan Liao <liaoyuan@gmail.com>
-Date: Thu, 3 Feb 2022 11:51:53 -0800
-Subject: [PATCH] Use 1.8 as javac -source/-target for running tests on Java 17
-
-Signed-off-by: Yuan Liao <liaoyuan@gmail.com>
----
- .../test/org/antlr/v4/test/runtime/java/BaseJavaTest.java | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/BaseJavaTest.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/BaseJavaTest.java
-index cc03bdc11..82061135e 100644
---- a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/BaseJavaTest.java
-+++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/BaseJavaTest.java
-@@ -137,7 +137,7 @@ public class BaseJavaTest extends BaseRuntimeTestSupport implements RuntimeTestS
- fileManager.getJavaFileObjectsFromFiles(files);
-
- Iterable<String> compileOptions =
-- Arrays.asList("-g", "-source", "1.6", "-target", "1.6", "-implicit:class", "-Xlint:-options", "-d", getTempDirPath(), "-cp", getTempDirPath() + PATH_SEP + CLASSPATH);
-+ Arrays.asList("-g", "-source", "1.8", "-target", "1.8", "-implicit:class", "-Xlint:-options", "-d", getTempDirPath(), "-cp", getTempDirPath() + PATH_SEP + CLASSPATH);
-
- JavaCompiler.CompilationTask task =
- compiler.getTask(null, fileManager, null, compileOptions, null,
---
-2.34.1
-