summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolkmar W. Pogatzki <gentoo@pogatzki.net>2021-05-21 11:56:04 +0200
committerMiroslav Šulc <fordfrog@gentoo.org>2021-05-22 11:01:04 +0200
commit0c02779c69d493fceacb37797e865377bc71e406 (patch)
treed227a99e77ddd3282d17ae6d2755a0a662366c6d /dev-java
parentwww-client/microsoft-edge-beta: remove old (diff)
downloadgentoo-0c02779c69d493fceacb37797e865377bc71e406.tar.gz
gentoo-0c02779c69d493fceacb37797e865377bc71e406.tar.bz2
gentoo-0c02779c69d493fceacb37797e865377bc71e406.zip
dev-java/stringtemplate: (slot :4) min java 1.8
Problem described in https://bugs.gentoo.org/742554#c4 persists Package-Manager: Portage-3.0.18, Repoman-3.0.2 Signed-off-by: Volkmar W. Pogatzki <gentoo@pogatzki.net> Closes: https://github.com/gentoo/gentoo/pull/20907 Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
Diffstat (limited to 'dev-java')
-rw-r--r--dev-java/stringtemplate/files/4.0.8-r1-test-fixes.patch73
-rw-r--r--dev-java/stringtemplate/stringtemplate-4.0.8-r1.ebuild74
2 files changed, 147 insertions, 0 deletions
diff --git a/dev-java/stringtemplate/files/4.0.8-r1-test-fixes.patch b/dev-java/stringtemplate/files/4.0.8-r1-test-fixes.patch
new file mode 100644
index 000000000000..0834ccf9bcce
--- /dev/null
+++ b/dev-java/stringtemplate/files/4.0.8-r1-test-fixes.patch
@@ -0,0 +1,73 @@
+--- a/test/org/stringtemplate/v4/test/TestGroups.java 2014-03-25 11:55:55.000000000 +0000
++++ b/test/org/stringtemplate/v4/test/TestGroups.java 2015-09-13 11:01:07.999800299 +0100
+@@ -29,6 +29,7 @@
+
+ import org.junit.Assert;
+ import org.junit.Test;
++import org.junit.Ignore;
+ import org.stringtemplate.v4.ST;
+ import org.stringtemplate.v4.STErrorListener;
+ import org.stringtemplate.v4.STGroup;
+@@ -527,6 +528,7 @@
+ assertEquals(expected, result);
+ }
+
++ @Ignore
+ @Test public void testUnknownNamedArg() throws Exception {
+ String dir = getRandomDir();
+ String groupFile =
+--- a/test/org/stringtemplate/v4/test/TestGroupSyntaxErrors.java 2014-03-25 11:55:55.000000000 +0000
++++ b/test/org/stringtemplate/v4/test/TestGroupSyntaxErrors.java 2015-09-13 11:01:05.011850826 +0100
+@@ -28,6 +28,7 @@
+ package org.stringtemplate.v4.test;
+
+ import org.junit.Test;
++import org.junit.Ignore;
+ import org.stringtemplate.v4.STErrorListener;
+ import org.stringtemplate.v4.STGroup;
+ import org.stringtemplate.v4.STGroupFile;
+@@ -36,6 +37,7 @@
+ import static org.junit.Assert.assertEquals;
+
+ public class TestGroupSyntaxErrors extends BaseTest {
++ @Ignore
+ @Test public void testMissingImportString() throws Exception {
+ String templates =
+ "import\n" +
+--- a/test/org/stringtemplate/v4/test/TestRenderers.java
++++ b/test/org/stringtemplate/v4/test/TestRenderers.java
+@@ -59,7 +59,7 @@ public class TestRenderers extends BaseTest {
+ group.registerRenderer(GregorianCalendar.class, new DateRenderer());
+ ST st = group.getInstanceOf("dateThing");
+ st.add("created", new GregorianCalendar(2005, 07-1, 05));
+- String expecting = "datetime: 7/5/05 12:00 AM";
++ String expecting = "datetime: 7/5/05, 12:00 AM";
+ String result = st.render();
+ assertEquals(expecting, result);
+ }
+@@ -85,7 +85,7 @@ public class TestRenderers extends BaseTest {
+ group.registerRenderer(GregorianCalendar.class, new DateRenderer());
+ ST st = group.getInstanceOf("dateThing");
+ st.add("created", new GregorianCalendar(2005, 07-1, 05));
+- String expecting = " datetime: 7/5/05 12:00 AM ";
++ String expecting = " datetime: 7/5/05, 12:00 AM ";
+ String result = st.render();
+ assertEquals(expecting, result);
+ }
+@@ -102,7 +102,7 @@ public class TestRenderers extends BaseTest {
+ // set Timezone to "PDT"
+ TimeZone.setDefault(TimeZone.getTimeZone("America/Los_Angeles"));
+ st.add("created", new GregorianCalendar(2005, 07-1, 05));
+- String expecting = " datetime: Tuesday, July 5, 2005 12:00:00 AM PDT ";
++ String expecting = " datetime: Tuesday, July 5, 2005 at 12:00:00 AM Pacific Daylight Time ";
+ String result = st.render();
+ assertEquals(expecting, result);
+ } finally {
+@@ -358,6 +358,6 @@ public class TestRenderers extends BaseTest {
+ cal.set(2012, Calendar.JUNE, 12);
+ st.add("date", cal);
+
+- assertEquals("12 de Junho de 2012", st.render(new Locale("pt")));
++ assertEquals("12 de junho de 2012", st.render(new Locale("pt")));
+ }
+ }
diff --git a/dev-java/stringtemplate/stringtemplate-4.0.8-r1.ebuild b/dev-java/stringtemplate/stringtemplate-4.0.8-r1.ebuild
new file mode 100644
index 000000000000..c2fba7061b02
--- /dev/null
+++ b/dev-java/stringtemplate/stringtemplate-4.0.8-r1.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+ANTLR3="3.5.2"
+JAVA_PKG_IUSE="doc source test"
+JAVA_TESTING_FRAMEWORKS="junit-4"
+
+inherit java-pkg-2 java-pkg-simple
+
+DESCRIPTION="A Java template engine"
+HOMEPAGE="https://www.stringtemplate.org/"
+SRC_URI="https://github.com/antlr/${PN}4/archive/${PV}.tar.gz -> ${P}.tar.gz
+ https://www.antlr3.org/download/antlr-${ANTLR3}-complete.jar"
+
+LICENSE="BSD"
+SLOT="4"
+KEYWORDS="amd64 ~arm ~arm64 ppc64 x86 ~amd64-linux ~x86-linux ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+RESTRICT="!test? ( test )"
+
+DEPEND=">=virtual/jdk-1.8:*"
+RDEPEND=">=virtual/jre-1.8:*"
+
+# StringTemplate has a cyclic dependency on ANTLR 3. The runtime classes
+# are needed at build time and runtime and the tool is also needed at
+# build time. To break out of this, we use a prebuilt copy of ANTLR 3 at
+# build time and manually register a dependency on the package, which
+# will be present at runtime thanks to this PDEPEND. No prebuilt
+# software is actually installed onto the system.
+PDEPEND=">=dev-java/antlr-${ANTLR3}:3.5"
+
+S="${WORKDIR}/${PN}4-${PV}"
+JAVA_GENTOO_CLASSPATH_EXTRA="${DISTDIR}/antlr-${ANTLR3}-complete.jar"
+JAVA_SRC_DIR="src"
+
+PATCHES=(
+ # These tests are broken but are probably fixed in current master.
+ "${FILESDIR}/4.0.8-r1-test-fixes.patch"
+)
+
+src_unpack() {
+ unpack ${P}.tar.gz
+}
+
+src_prepare() {
+ default
+
+ # Some of these tests requires a graphical display.
+ rm -v test/org/stringtemplate/v4/test/TestEarlyEvaluation.java || die
+}
+
+src_compile() {
+ java -jar "${JAVA_GENTOO_CLASSPATH_EXTRA}" -lib ${JAVA_SRC_DIR}/org/stringtemplate/v4/compiler $(find ${JAVA_SRC_DIR} -name "*.g") || die
+ java-pkg-simple_src_compile
+}
+
+src_test() {
+ cd test || die
+ local CP=".:${S}/${PN}.jar:$(java-pkg_getjars junit-4):${JAVA_GENTOO_CLASSPATH_EXTRA}"
+
+ local TESTS=$(find * -name "Test*.java")
+ TESTS="${TESTS//.java}"
+ TESTS="${TESTS//\//.}"
+
+ ejavac -classpath "${CP}" $(find -name "*.java")
+ ejunit4 -classpath "${CP}" ${TESTS}
+}
+
+src_install() {
+ java-pkg-simple_src_install
+ java-pkg_register-dependency antlr-3.5 antlr-runtime.jar
+ dodoc {CHANGES,contributors,README}.txt
+}