Gentoo Archives: gentoo-commits

From: "Miroslav Šulc" <fordfrog@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-java/antlr/
Date: Sun, 16 May 2021 19:06:17
Message-Id: 1621191970.31124a323eb568a6d382f2b062d9be254033b242.fordfrog@gentoo
1 commit: 31124a323eb568a6d382f2b062d9be254033b242
2 Author: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
3 AuthorDate: Sun May 16 19:05:47 2021 +0000
4 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
5 CommitDate: Sun May 16 19:06:10 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=31124a32
7
8 dev-java/antlr: dropped obsolete 3.2
9
10 Package-Manager: Portage-3.0.18, Repoman-3.0.3
11 Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>
12
13 dev-java/antlr/antlr-3.2.ebuild | 96 -----------------------------------------
14 1 file changed, 96 deletions(-)
15
16 diff --git a/dev-java/antlr/antlr-3.2.ebuild b/dev-java/antlr/antlr-3.2.ebuild
17 deleted file mode 100644
18 index 3efa9766028..00000000000
19 --- a/dev-java/antlr/antlr-3.2.ebuild
20 +++ /dev/null
21 @@ -1,96 +0,0 @@
22 -# Copyright 1999-2021 Gentoo Authors
23 -# Distributed under the terms of the GNU General Public License v2
24 -
25 -EAPI="5"
26 -
27 -inherit epatch java-pkg-2 java-pkg-simple
28 -
29 -DESCRIPTION="A parser generator for many languages"
30 -HOMEPAGE="https://www.antlr3.org/"
31 -SRC_URI="https://www.antlr3.org/download/${P}.tar.gz
32 - https://www.antlr3.org/download/${P}.jar" # Prebuilt version needed.
33 -LICENSE="BSD"
34 -SLOT="3"
35 -KEYWORDS="amd64 ~arm ~arm64 ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
36 -IUSE="doc test"
37 -RESTRICT="!test? ( test )"
38 -
39 -CDEPEND=">=dev-java/antlr-2.7.7-r7:0
40 - dev-java/stringtemplate:0"
41 -
42 -RDEPEND="${CDEPEND}
43 - >=virtual/jre-1.6"
44 -
45 -DEPEND="${CDEPEND}
46 - >=virtual/jdk-1.6
47 - test? ( dev-java/junit:4 )"
48 -
49 -S="${WORKDIR}/${P}"
50 -JAVA_GENTOO_CLASSPATH_EXTRA="${S}/${PN}-runtime.jar"
51 -JAVA_GENTOO_CLASSPATH="antlr,stringtemplate"
52 -
53 -src_unpack() {
54 - unpack ${P}.tar.gz
55 -}
56 -
57 -java_prepare() {
58 - java-pkg_clean
59 -
60 - # These fixes have been applied in 3.5.
61 - epatch "${FILESDIR}/${PV}-test-fixes.patch"
62 - epatch "${FILESDIR}/${PV}-java-8.patch"
63 -
64 - # Some tests fail under Java 8 in ways that probably aren't limited
65 - # to the tests. This is bad but upstream is never going to update
66 - # 3.2 even though other projects still rely on it. If any issues
67 - # arise, we can only put pressure on those projects to upgrade.
68 - if java-pkg_is-vm-version-ge 1.8; then
69 - rm -v tool/src/test/java/org/antlr/test/Test{DFAConversion,SemanticPredicates,TopologicalSort}.java || die
70 - fi
71 -
72 - # 3.2 has strange hidden files.
73 - find -type f -name "._*.*" -delete || die
74 -}
75 -
76 -src_compile() {
77 - cd "${S}/runtime/Java/src/main" || die
78 - JAVA_JAR_FILENAME="${S}/${PN}-runtime.jar" JAVA_PKG_IUSE="doc" java-pkg-simple_src_compile
79 -
80 - cd "${S}/tool/src/main" || die
81 -
82 - local G; for G in antlr codegen antlr.print assign.types buildnfa define; do # from pom.xml
83 - antlr -o antlr2/org/antlr/grammar/v2/{,${G}.g} || die
84 - done
85 -
86 - # We have applied a patch to fix this version under Java 8. Trouble
87 - # is that we need to run a prebuilt version before we can build our
88 - # own and that version doesn't have the fix applied. We work around
89 - # this by building just the offending class against the prebuilt
90 - # version and then putting them together in the classpath. That
91 - # isn't all. Due to a compiler limitation that Chewi doesn't fully
92 - # understand, this class cannot be compiled by itself without a
93 - # couple of tweaks that have been applied in the Java 8 patch.
94 - ejavac -classpath "${DISTDIR}/${P}.jar" java/org/antlr/tool/CompositeGrammar.java
95 -
96 - java -classpath "java:${DISTDIR}/${P}.jar" org.antlr.Tool $(find antlr3 -name "*.g") || die
97 - JAVA_JAR_FILENAME="${S}/${PN}-tool.jar" java-pkg-simple_src_compile
98 - java-pkg_addres "${S}/${PN}-tool.jar" resources
99 -}
100 -
101 -src_install() {
102 - java-pkg_dojar ${PN}-{runtime,tool}.jar
103 - java-pkg_dolauncher ${PN}${SLOT} --main org.antlr.Tool
104 - use doc && java-pkg_dojavadoc runtime/Java/src/main/target/api
105 -}
106 -
107 -src_test() {
108 - cd tool/src/test/java || die
109 - local CP=".:${S}/${PN}-runtime.jar:${S}/${PN}-tool.jar:$(java-pkg_getjars junit-4,${JAVA_GENTOO_CLASSPATH})"
110 -
111 - local TESTS=$(find * -name "Test*.java")
112 - TESTS="${TESTS//.java}"
113 - TESTS="${TESTS//\//.}"
114 -
115 - ejavac -classpath "${CP}" $(find -name "*.java")
116 - ejunit4 -classpath "${CP}" ${TESTS}
117 -}