From 8e2dfc4e18f9323d171a42526d508892596a2b5c Mon Sep 17 00:00:00 2001 From: "Volkmar W. Pogatzki" Date: Tue, 21 Nov 2023 08:57:32 +0100 Subject: [PATCH] dev-java/stringtemplate: minor style update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Volkmar W. Pogatzki Closes: https://github.com/gentoo/gentoo/pull/33606 Signed-off-by: Miroslav Ć ulc --- ...e-4.3.4-BaseTest-javac-source-target.patch | 26 +++++++++++++++++++ .../stringtemplate-4.3.4.ebuild | 23 +++++----------- 2 files changed, 32 insertions(+), 17 deletions(-) create mode 100644 dev-java/stringtemplate/files/stringtemplate-4.3.4-BaseTest-javac-source-target.patch diff --git a/dev-java/stringtemplate/files/stringtemplate-4.3.4-BaseTest-javac-source-target.patch b/dev-java/stringtemplate/files/stringtemplate-4.3.4-BaseTest-javac-source-target.patch new file mode 100644 index 0000000000000..7c31d6b5a8936 --- /dev/null +++ b/dev-java/stringtemplate/files/stringtemplate-4.3.4-BaseTest-javac-source-target.patch @@ -0,0 +1,26 @@ +From 4e12a210f2b933c92ded6ee141f6399144a866f5 Mon Sep 17 00:00:00 2001 +From: Yuan Liao +Date: Mon, 24 Jan 2022 06:17:03 -0800 +Subject: [PATCH] BaseTest.java: Change javac source/target to 1.8 for JDK 17 + +JDK 17 no longer supports 1.6 as the source or target version. + +Signed-off-by: Yuan Liao +--- + test/org/stringtemplate/v4/test/BaseTest.java | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/stringtemplate4-ST4-4.3.4/test/org/stringtemplate/v4/test/BaseTest.java ++++ b/stringtemplate4-ST4-4.3.4/test/org/stringtemplate/v4/test/BaseTest.java +@@ -258,7 +258,7 @@ public abstract class BaseTest { + fileManager.getJavaFileObjectsFromFiles(files); + + Iterable compileOptions = +- Arrays.asList("-g", "-source", "1.6", "-target", "1.6", "-implicit:class", "-Xlint:-options", "-d", workingDirName, "-cp", workingDirName+pathSep+CLASSPATH); ++ Arrays.asList("-g", "-source", "1.8", "-target", "1.8", "-implicit:class", "-Xlint:-options", "-d", workingDirName, "-cp", workingDirName+pathSep+CLASSPATH); + + JavaCompiler.CompilationTask task = + compiler.getTask(null, fileManager, null, compileOptions, null, +-- +2.34.1 + diff --git a/dev-java/stringtemplate/stringtemplate-4.3.4.ebuild b/dev-java/stringtemplate/stringtemplate-4.3.4.ebuild index 14530a5b8587e..9fff5776a1d38 100644 --- a/dev-java/stringtemplate/stringtemplate-4.3.4.ebuild +++ b/dev-java/stringtemplate/stringtemplate-4.3.4.ebuild @@ -18,6 +18,8 @@ SRC_URI=" https://repo1.maven.org/maven2/org/antlr/ST4/${PV}/ST4-${PV}-sources.jar https://github.com/antlr/stringtemplate4/archive/ST4-${PV}.tar.gz " +S="${WORKDIR}" +TARBALL_S="${S}/${PN}4-ST4-${PV}" LICENSE="BSD" SLOT="4" @@ -44,9 +46,6 @@ RDEPEND=" ${CP_DEPEND} " -S="${WORKDIR}" -TARBALL_S="${S}/${PN}4-ST4-${PV}" - JAVA_SRC_DIR="org" JAVA_TEST_GENTOO_CLASSPATH="junit-4,antlr-tool-3.5" @@ -54,18 +53,13 @@ JAVA_TEST_SRC_DIR="${TARBALL_S}/test" JAVA_TEST_RESOURCE_DIRS=( "${TARBALL_S}/test/resources" ) DOCS=( "${TARBALL_S}/"{CHANGES.txt,README.md} ) +PATCHES=( "${FILESDIR}/stringtemplate-4.3.4-BaseTest-javac-source-target.patch" ) src_prepare() { - # Do not call java-pkg_clean; otherwise, it would remove - # ${TARBALL_S}/test/test.jar, which is merely used as a - # test resource file, does not contain any *.class files, - # and is required to pass the tests as of version 4.3.2 - pushd "${TARBALL_S}" > /dev/null || - die "Failed to enter directory storing tarball contents" - eapply "${FILESDIR}/${PN}-4.3.1-BaseTest-javac-source-target.patch" - popd > /dev/null || - die "Failed to leave directory storing tarball contents" + default #780585 java-pkg-2_src_prepare + # keep test.jar - it is required to pass the tests as of version 4.3.2 + java-pkg_clean ! -path */test.jar # Some of these tests requires a graphical display. rm -v "${JAVA_TEST_SRC_DIR}/org/stringtemplate/v4/test/TestEarlyEvaluation.java" || die } @@ -100,8 +94,3 @@ src_test() { JAVA_GENTOO_CLASSPATH_EXTRA+="${new_test_cp}" java-pkg-simple_src_test } - -src_install() { - java-pkg-simple_src_install - einstalldocs # https://bugs.gentoo.org/789582 -}