diff options
author | V3n3RiX <venerix@koprulu.sector> | 2022-03-20 00:40:44 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2022-03-20 00:40:44 +0000 |
commit | 4cbcc855382a06088e2f016f62cafdbcb7e40665 (patch) | |
tree | 356496503d52354aa6d9f2d36126302fed5f3a73 /dev-java/antlr-tool | |
parent | fcc5224904648a8e6eb528d7603154160a20022f (diff) |
gentoo resync : 20.03.2022
Diffstat (limited to 'dev-java/antlr-tool')
-rw-r--r-- | dev-java/antlr-tool/Manifest | 8 | ||||
-rw-r--r-- | dev-java/antlr-tool/antlr-tool-3.5.2.ebuild | 2 | ||||
-rw-r--r-- | dev-java/antlr-tool/antlr-tool-4.9.3.ebuild | 142 | ||||
-rw-r--r-- | dev-java/antlr-tool/files/4.9.3-test-fixes.patch | 26 | ||||
-rw-r--r-- | dev-java/antlr-tool/metadata.xml | 1 |
5 files changed, 176 insertions, 3 deletions
diff --git a/dev-java/antlr-tool/Manifest b/dev-java/antlr-tool/Manifest index b2db4e7789c5..b2ee337367d6 100644 --- a/dev-java/antlr-tool/Manifest +++ b/dev-java/antlr-tool/Manifest @@ -1,5 +1,9 @@ AUX 3.5.2-test-fixes.patch 2093 BLAKE2B 4016d770a226f1fb86f7f6e630df38c0d2ed0b4a025991f6b88e88506d2a44838c17097fc4ad5f63e506a839ebce0fcfa8e57f22415f777b0bd4c37afc93a0b1 SHA512 dcdde9daabfb3379f85d831a594259b21e1cc0283f7f0972d42801cb144d6932fe5cccff576cc885614db3f9e07b98782c4932a03687658df35f698455588533 +AUX 4.9.3-test-fixes.patch 1399 BLAKE2B 719571607153951b6a44a7bed7c405b6e217f7a458667388d89ca15683342a5d9849155ad03771eb0f7d326af31fd0cf6e0ab9ddfbd385e189b33f0c842ab53e SHA512 b0aed6d54873ffd841ae5ac6ce1afb5d037fdde6e322903e250e46b38b84fd29ca87668f8b1f38a5c6b0ec4ad99953021d4260b67515158accbc37fd325e98eb DIST antlr-3.5.2.tar.gz 6927126 BLAKE2B 1907229549434dfea6ef1fa915137a2f733bd61f0a40aacb131689df619d1c92e125453ec3d1febc5d92da1841ffbde060af196cff1ca8fb6f4684600375e161 SHA512 e2a0520093fb2a77dcd9d44f26a9fdd612dceaffb398c53b2b8cd29f4630830647ede29e8dd55b434cb2c165b0fd1d77968ec6e6de0798f14d9cdfd9e6fccd99 +DIST antlr-4.9.3.tar.gz 4640242 BLAKE2B fb58f5e533051cb2c439c32f0462c1d463c99df862ba7e1a37a1c61378ab36a9edb9525c2a342de5b517da6f02d8291de5976c550932314f3464aad1a778afb9 SHA512 61452404c9639b5a0908cda16605f17c0fed0c9adfc3278c7408f9971420e9d1fe8f9e974e0826c2e3e780fdd83324094c0246cd5b28fa63f5686b094ea08127 DIST antlr-tool-3.5.2-sources.jar 957096 BLAKE2B 39b75824e129c8111f302eb71407a683c59e91e79a3fa13c5386c4ba4aa322e706deb10b36df3591ab0843faff5702091d543272ee85d63cd92cb36cc72e1ceb SHA512 50fece361b69299be0c0941e6fe2bfacfc39c0b3dad3320126a9a80cd0f053fbaa6332612e2bab2872db122025d6abfe4b35a4636ef1c101e9131bbd2cdf5e28 -EBUILD antlr-tool-3.5.2.ebuild 1983 BLAKE2B 9bda797c081b361738b42c6092f567bcee6673479cdfd9e1324b4d15c97f1c4dc1135a4db57f41705804294560cc5f4b708056ecf6502cc9a111ad236ee6aaa0 SHA512 dc692632192d2998c28488574ad4478247d12efeb1744389750a2583ecb0988c75b851df4c0e5dc4cdf12fa0a64df39a011f215491fa7cc38744156d061624cc -MISC metadata.xml 314 BLAKE2B 44614e69318b15302910048bed9f1a4acd92a1eb737e1861563d855aeec4e6f8f1a201f0bcbc039420a820e17f15d7deef68fb54b104d0c621def437c0457da3 SHA512 d03626431b434fe0b4fbbaaf7c860fd55390a1511c1f93f95747cc6a058795f166b73846b038bba3e843b6afdde2655ac3b7776a33276230efbaaa6d7b469d84 +DIST antlr-tool-4.9.3-sources.jar 961749 BLAKE2B 294c7ba6dff9a1039d3e570d7d49f46a564302d1e7a25ac9f662a2c293cbabadd6a5a4a94d026c4e5fcca37c407e104956badbd1cbbf71b957e464dc67cf823e SHA512 7d70e80714b673eb8301def5e66a7133b2ac477e3cc219e37877ef9df673e0599a1148a8c1929ca8eab081d4e7375c9079241765a1f38832b21cfe8608ef4429 +EBUILD antlr-tool-3.5.2.ebuild 1979 BLAKE2B 8a50f774daf5cf0f89963b1ca66444dff7e5f23b087c9049d065cceedf4c64fca5a2ee7d2f8ad6fe24367b97f467808bef8123e0b579d2c3e9398a056fb4cf3b SHA512 4fba8468420a8bfaea0800d3269cbb7ffe75465571d6523b118d40088e43eb723f0af78ff1cdace480d9c57313528011d6518767004c123d4060522b03f05781 +EBUILD antlr-tool-4.9.3.ebuild 3753 BLAKE2B 761078ed141755b481e74bc16685b731371afe062e93e0f60f44ed72a7491836d507d86306ad96208fafd693a76fea4d802a5818d66d85fdaf10d8857774f9d7 SHA512 676f88674a0b05b5b4a20172a5dfeab54a329f274a0e23c8e2b0f02fc740a1ba284db401f99d6388c92a687490eaa478ca99578a8d99a6f1c9245d764b25557a +MISC metadata.xml 366 BLAKE2B 134ea633a45f3e33d57f4761afb1ff2d7f7778d06d66ff6e2e77a0c5777d48e8009697f64a4d50780b84b6672f352f4714a2b61d206cd158fcddd50902485caa SHA512 5b0bb774c494f1e7bbc486732abcea66922e65cd209df3d9fa090d71dabbc9aae59d437c340a5d78941d730388c95554fa80fb9852c8c0ceed05c9197d236301 diff --git a/dev-java/antlr-tool/antlr-tool-3.5.2.ebuild b/dev-java/antlr-tool/antlr-tool-3.5.2.ebuild index 214b8c4d199c..b6a32d34d18f 100644 --- a/dev-java/antlr-tool/antlr-tool-3.5.2.ebuild +++ b/dev-java/antlr-tool/antlr-tool-3.5.2.ebuild @@ -27,7 +27,7 @@ SRC_URI=" 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" +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} diff --git a/dev-java/antlr-tool/antlr-tool-4.9.3.ebuild b/dev-java/antlr-tool/antlr-tool-4.9.3.ebuild new file mode 100644 index 000000000000..835e4633d53d --- /dev/null +++ b/dev-java/antlr-tool/antlr-tool-4.9.3.ebuild @@ -0,0 +1,142 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +# Artifact ID for antlr-tool is 'antlr4' +# https://github.com/antlr/antlr4/blob/4.9.3/tool/pom.xml#L14 +MAVEN_ID="org.antlr:antlr4:4.9.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 4 grammar compiler" +HOMEPAGE="https://www.antlr.org/" +# Maven Central sources JAR for tool/src/org/antlr/v4/unicode/UnicodeData.java, +# which requires string-template-maven-plugin to generate; tarball for the rest +SRC_URI=" + https://github.com/antlr/antlr4/archive/${PV}.tar.gz -> ${MY_P}.tar.gz + https://repo1.maven.org/maven2/org/antlr/antlr4/${PV}/antlr4-${PV}-sources.jar -> ${P}-sources.jar +" + +LICENSE="BSD" +SLOT="4" +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/antlr-runtime:3.5 + dev-java/jakarta-json-api:1 + dev-java/icu4j:70 + dev-java/stringtemplate:4 + dev-java/treelayout:0 +" + +DEPEND=" + >=virtual/jdk-1.8:* + ${CP_DEPEND} + dev-java/antlr-tool:3.5 + test? ( + dev-java/jol-core:0 + ) +" + +RDEPEND=" + >=virtual/jre-1.8:* + ${CP_DEPEND} +" + +S="${WORKDIR}/${MY_PN}4-${PV}" + +JAVA_SRC_DIR=( + tool/src + ../src/org # For UnicodeData.java +) +JAVA_RESOURCE_DIRS=( tool/resources ) + +JAVA_TEST_GENTOO_CLASSPATH="junit-4,jol-core" +JAVA_TEST_SRC_DIR=( + tool-testsuite/test + # The runtime test suite is used as a library for tool test suite + runtime-testsuite/{annotations,test} +) +JAVA_TEST_RESOURCE_DIRS=( + # Some resources are mixed with test source files + "${JAVA_TEST_SRC_DIR[0]}" +) + +pkg_setup() { + java-pkg-2_pkg_setup + MY_JAVA="$(java-config -J)" +} + +src_prepare() { + java-pkg_clean + eapply "${FILESDIR}/${PV}-test-fixes.patch" + java-pkg-2_src_prepare +} + +src_compile() { + ebegin "Generating ANTLR 3 parsers" + "${MY_JAVA}" -cp "$(java-pkg_getjars \ + --build-only --with-dependencies antlr-tool-3.5)" \ + org.antlr.Tool $(find "${JAVA_SRC_DIR[@]}" -name "*.g") || + die "Failed to generate ANTLR 3 parsers" + java-pkg-simple_src_compile +} + +src_test() { + # Build classpath for tests + local test_deps=( + "${JAVA_TEST_GENTOO_CLASSPATH}" + antlr-runtime-${SLOT} + antlr-runtime-3.5 + jakarta-json-api-1 + icu4j-70 + stringtemplate-4 + treelayout + ) + local CP="${S}/${JAVA_JAR_FILENAME}" + for test_dep in "${test_deps[@]}"; do + CP+=":$(java-pkg_getjars --with-dependencies "${test_dep}")" + done + for res_dir in "${JAVA_TEST_RESOURCE_DIRS[@]}"; do + CP+=":${res_dir}" + done + + ebegin "Generating ANTLR 4 parsers for tests" + pushd runtime-testsuite/test > /dev/null || + die "Failed to enter runtime test source directory" + g4_files=( $(find * -name "*.g4") ) + for file in "${g4_files[@]}"; do + java_pkg="${file%/*.g4}" + java_pkg="${java_pkg//\//.}" + "${MY_JAVA}" -cp "${CP}" org.antlr.v4.Tool \ + -visitor -package "${java_pkg}" "${file}" || + die "Failed to generate ANTLR 4 parser from ${file}" + done + popd > /dev/null || die "Failed to leave runtime test source directory" + + # Compile Java test sources + local classes="target/classes" + ejavac -d "${classes}" -cp "${CP}" \ + $(find "${JAVA_TEST_SRC_DIR[@]}" -name "*.java") + + # Create a list of tests to run + pushd "${JAVA_TEST_SRC_DIR[0]}" > /dev/null || + die "Failed to enter test source directory for ${PN}" + local TESTS=$(find * -type f \ + \( -name "Test*.java" -o -name "*Test.java" \) \ + -not -name "BaseJavaToolTest.java" # No runnable methods + ) + TESTS="${TESTS//.java}" + TESTS="${TESTS//\//.}" + popd > /dev/null || die "Failed to leave test source directory for ${PN}" + + ejunit4 -classpath "${classes}:${CP}" ${TESTS} +} diff --git a/dev-java/antlr-tool/files/4.9.3-test-fixes.patch b/dev-java/antlr-tool/files/4.9.3-test-fixes.patch new file mode 100644 index 000000000000..9cb6884ba194 --- /dev/null +++ b/dev-java/antlr-tool/files/4.9.3-test-fixes.patch @@ -0,0 +1,26 @@ +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 + diff --git a/dev-java/antlr-tool/metadata.xml b/dev-java/antlr-tool/metadata.xml index ad571d3247b8..61e37d49ba13 100644 --- a/dev-java/antlr-tool/metadata.xml +++ b/dev-java/antlr-tool/metadata.xml @@ -6,6 +6,7 @@ <name>Java</name> </maintainer> <upstream> + <remote-id type="github">antlr/antlr4</remote-id> <remote-id type="github">antlr/antlr3</remote-id> </upstream> </pkgmetadata> |