summaryrefslogtreecommitdiff
path: root/dev-java/antlr
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-java/antlr
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-java/antlr')
-rw-r--r--dev-java/antlr/Manifest21
-rw-r--r--dev-java/antlr/antlr-2.7.7-r7.ebuild44
-rw-r--r--dev-java/antlr/antlr-2.7.7-r8.ebuild47
-rw-r--r--dev-java/antlr/antlr-3.2.ebuild95
-rw-r--r--dev-java/antlr/antlr-3.5.2.ebuild86
-rw-r--r--dev-java/antlr/antlr-4.5.1.ebuild90
-rw-r--r--dev-java/antlr/antlr-4.5.3.ebuild90
-rw-r--r--dev-java/antlr/files/3.2-java-8.patch32
-rw-r--r--dev-java/antlr/files/3.2-test-fixes.patch249
-rw-r--r--dev-java/antlr/files/3.5.2-test-fixes.patch36
-rw-r--r--dev-java/antlr/metadata.xml11
11 files changed, 801 insertions, 0 deletions
diff --git a/dev-java/antlr/Manifest b/dev-java/antlr/Manifest
new file mode 100644
index 000000000000..0cdfe9cbccc9
--- /dev/null
+++ b/dev-java/antlr/Manifest
@@ -0,0 +1,21 @@
+AUX 3.2-java-8.patch 1318 SHA256 c27c2356958175684bd175798608361ee3ba9f904b66bb4682b357a6b9f0cc00 SHA512 70c9dc23ec64ba75bfcfc0597544b13c2c35c523c6f2c9d82dbc54a44c30a5432a56b6193db74ca9c3d92235bdadc5427857c364abc4df79ffdc1d2b55221d32 WHIRLPOOL 4ea6ecc381ca01ae3514cbf2aa8da4ddb4ab5540e74589b82187bbaf92dc46e3565807c45b174e48d462aa1657ff7ac0e27423763d7564d2b971324294dd0396
+AUX 3.2-test-fixes.patch 10278 SHA256 749ffe6e13a0a3f2d649eac1f93e114205f3bddbf7e7e1a59ffc4dd6a4d91344 SHA512 b593da8fb05d8ac51b0fd72172b740aeae060bd18c58413c67ff0c5242609b419d4a1b0a4f5ae66d5a3b2103007d4511ece41da6b09dab5f12ffd5f905d45d31 WHIRLPOOL 11b7d93cd8aba51503a57b985113326e5216847fceeb190731300e71472a08297ab2c5527f7f470e7455bebdba79388fb79953d4ede931d4177802a4b9c82cd6
+AUX 3.5.2-test-fixes.patch 2093 SHA256 87ae32a7f74c62479bff31f7a6f00cd99d19ceb5d3657878ad72e5934d5bc2cb SHA512 dcdde9daabfb3379f85d831a594259b21e1cc0283f7f0972d42801cb144d6932fe5cccff576cc885614db3f9e07b98782c4932a03687658df35f698455588533 WHIRLPOOL 3252b6b7dabd2a13340b4302ee7666c901c7fd22bd05aab60cb23301a5c3e97f06bb5d901d0008695294e12840e58437cbc3e85fc35b5a9d5c9a5b603ba0c7cb
+DIST antlr-2.7.7.tar.gz 1816180 SHA256 853aeb021aef7586bda29e74a6b03006bcb565a755c86b66032d8ec31b67dbb9 SHA512 faa72d2ddcba434ef1233e70c1549e63eba67c00793966322e821cf7f015cccb804448cb92d8fbef0429f59928fad65ec954f8ffbda0acbb8e983de0806d349d WHIRLPOOL def5ac0ddfe5a65f9f7d5489d039048c5d630b46cd5626593bd12e9b393d5ec26884f90b013bcdf58511e26abbf06e0d7b3789a11298b017f7e70af2ec8dde4a
+DIST antlr-3.2.jar 1928009 SHA256 4c8737014e7ca0d2c85171edf37f5a26b2d8d8237c283357b81a3269b6848d38 SHA512 25a61404c4b41e48eeaed49d41122f9400092248a10eb776d75ce3513295870eca1acc4b06c74925284a27cc64ca0506e34de39fb91996f09727cc5cc72dd9a6 WHIRLPOOL 19d99c9f50339ee9ef31e9458ac3a44ce52aa89ed84f96be905d626e3a53d5e2bbdb2e8eb4c5ca16413e7493499b141f940dd200658f8e60e9ecbd777f83a84b
+DIST antlr-3.2.tar.gz 837320 SHA256 01548fa03ef1f0ed05a93f0749b65db8a35a191ad7ad34e1e6a6a2529ca2ef45 SHA512 8984221cd89253c033a4596dd56cd51b297393a53b4682f5ab401172745d343371bf0d45417fa286ce972add1b4e474f1f3091fa1345158dbfc040702d61607c WHIRLPOOL 40080efc13c88312aaa318cde097f240e711b477e264739ea71b6c246ede29ac48f42eccd55365af531eb428f1ca1d89386d7e5753b6bc35cad9bf937b70e6de
+DIST antlr-3.5.2-complete.jar 2456317 SHA256 26ca659f47d77384f518cf2b6463892fcd4f0b0d4d8c0de2addf697e63e7326b SHA512 560f208e38759b5e626de56816e1fce9c191c526c04ca782513859d468ac444d1e8e62c03870a68f8f9d8daee0f45fca465150e2bbfc71b46e46b952519044b1 WHIRLPOOL bdbbb081bf0aab83fa26a4a75f7f42487da688a5e3c765ea4cbd7b8c1bcb80b66e8b98bf95ee8bcd2acd60b4eacb6745f879cb899b672ea7fc4489d651a6f2e0
+DIST antlr-3.5.2.tar.gz 6927126 SHA256 529baf7d11f06b773543e25271c1a6e1735d2f8061f4866d1ea5c99a5d71ee1f SHA512 e2a0520093fb2a77dcd9d44f26a9fdd612dceaffb398c53b2b8cd29f4630830647ede29e8dd55b434cb2c165b0fd1d77968ec6e6de0798f14d9cdfd9e6fccd99 WHIRLPOOL a3a2bf81cc91a332725a4ce15dcccf10df5395b27a521656b1f3e80fed10197edc132fa2a8b9a259b2ee603320492b4b1f664692a967fdfdbb574d919b9aa20e
+DIST antlr-4.5.1-complete.jar 1478820 SHA256 9cff6c76bc5aafcbf51cac7f0974ae01e4f6119402e75436abbb97f8ab15c211 SHA512 1109087c44706694d75a7f88f6ce96e8653467d5721505db747e7e70a4f40a24469b1fb3ffcb327819bba1548b0025412e46a11a41e329b0ecf847cb1094238c WHIRLPOOL 54d8a59bbd935b84a76370645d57eb07ee9160297ad457106b7b773682f915c9632446fc818a9fb23ab37074c923b918c168a7eca98555513cfb4dfa2eb106e5
+DIST antlr-4.5.1.tar.gz 6158475 SHA256 faaaea662e7b4792fc2264bbefaf0e196e74f45ebe29ec638f978b008e6bb5ff SHA512 949306b0ee87a0c002664ee7ac0f32c43385c501b4e28f181417559ce09b07cc12a8441c3bb81f8a72feba3d4ccc693a3c03bcccad7fc81223cddb19e10468a9 WHIRLPOOL 00aeb41f8864d65d7693cf3ca4d36a10f094967fe96fefd67e4d64eb22d1502658ff2355125ab5e36f88a276d143247c0a2814cfcd990e08ec3fe6f6212ea42e
+DIST antlr-4.5.3-complete.jar 1485121 SHA256 a32de739cfdf515774e696f91aa9697d2e7731e5cb5045ca8a4b657f8b1b4fb4 SHA512 53dcadf3007c9bdbeb391ea72fb9bab7c086fa0b9d1d93b83050b2ebb726c2f52743b5ba944c68f6da513d915ab5e8721676d74d823c32484928ccad2a28f1e4 WHIRLPOOL 9547b9e18bbef393036feeff9608b14bb57916e27bb4a4e15f1842ed428a6ccbd6c3fc819cf322532876ec4500bca3e4d73194e3ed85662768240750f8db235e
+DIST antlr-4.5.3.tar.gz 6760401 SHA256 5eaf01d4994383029a7d5d9c4604d7c7dc3122b787b69c541821d0f4dc0e9f05 SHA512 d0e61baebb338e5e4e8eaf87aa6ef52a568ec51bc86bc07acf8f82be0c173ea4f0f85978dfd034c2642505888c0849663f6b6fb030c4c19e0571f29277fb54f7 WHIRLPOOL a58ccbe6b1bed2cbb77f689cc3b8a731abd480f689a2e2129eecbd68e843906ec8931f958e174c2bf463651018cd6facf97eb5eb4b7aba69ea337f26040fcdf3
+EBUILD antlr-2.7.7-r7.ebuild 1110 SHA256 1bcf1b402e126c934a67ba849ae41e51fa772d765b93011e0ae694c78f19656b SHA512 3222c36c63ca49e4eec7418192eb25b7466b2d39a9c2531ff29db22c93d9c89075fdd59c1571adcf7c3ba98ad2170e920fc30ce4eff39a25c3e02fa7ba9ac3fc WHIRLPOOL cd7eb5e70d649f88c45d1ac99fa64b09cd34498179438c7084a6aff0c970e1dabf3f48d8c79acd8bd0b2d3280194be9b64af3b5c4c9c2ab58753ed86e18dc7db
+EBUILD antlr-2.7.7-r8.ebuild 1121 SHA256 e50c8d3e950c2426ee65145ae4288324f8e50daf360cfce750e8ac8a873c5aa4 SHA512 4d2387a3ab329f37496ca8ca108708f2e53de4799bd473deeb1f1f296335370ddfae4527e05f81b3d551593285ef202fc1d57a9ed27c885ae8c6d1f819b71bf2 WHIRLPOOL c9e6f6bcf1271b1a3a369983b0155d73c1e50aade4f6f147925faa08b20d6b20483147049aac3084422e03578f82291aeed610da0d255ba2db301284da7f9e83
+EBUILD antlr-3.2.ebuild 3242 SHA256 1d19eed2f40dd803cd3ffe694d59e2e0b8d8cf57b6fb06dd1ed9e72e67c3f4e2 SHA512 38d68d796dc5ea1bf214779642e9ea40840295c6caf69017bfa92ca623289f9ac532e5262a64d48bd8ef1c709b45a1a9590da8e0636c37377649a6c335bddb5f WHIRLPOOL 1c4c5b15f1b7c2c66f0a80f992a6b7d1ea766768092ae3a7589a7b99f557073474f8d761e1fca69a93073e41724599ba3e907aec1900c21ed36f3ce1412bc991
+EBUILD antlr-3.5.2.ebuild 2995 SHA256 18970d16efe494668ce0203c73c064e8fb8e870fbfe8303e494602e18b591104 SHA512 abe140c64f10c39f82c5771acdb2a848ca0ecbfe718a0cb9514805c2109c2f4128b97ae8e5abb81f63417507dcbf5b23b42850d48f1eb826c7e0d390e64cc0e9 WHIRLPOOL 2aa8ba3f611b2f1291b82bbb0b3d7049361390342e7e4c7170ddb410adc577e99d5c6c188d1a60ae510aec850ab62bf7dde13a5ef13a4cbacd726e24ba9c252a
+EBUILD antlr-4.5.1.ebuild 2452 SHA256 63dcb0c9b77874c7b7fb16ccb562772cb4729cd06bfcd0b1311a28d85adb2f0c SHA512 ccb84e30811f01bb4d28d38117c75c79b8e0048a86d06194bdfe1aeb7de5b33b9d08e907a850a8a3714e637dcee4a7a396cd314ffc6c8472671e236220bbdee2 WHIRLPOOL fc4a22f3be9dc52c073f2091d637a51b1f2e774e1cc4dc6885c8a2d2f49fe563e233f8c42457d8c67651450f8a2916f8ece9cfd4bc86ecdebf3e41eed3444af8
+EBUILD antlr-4.5.3.ebuild 2455 SHA256 6f93a445688c94b0f235bd9d78c483c1f6283e5192121ead1631a2784b05d3ba SHA512 03e9c3c64e3c04f14ef82b3fcd5d3018778f39e8c5386da05071634c14791d6335ed3212387cd0ecd7bf4774c5a3d2a49569e566dfb61ea6a66fa71ba4857841 WHIRLPOOL 7537dd283f648fbabeb49f51a5304523754195f4073dfab139a024c060a7d5c99a91f1b5dcbed39603497d933ad1ca94934d82598eb876aa8cf2b99b5596a88a
+MISC ChangeLog 6291 SHA256 18d9aded36b61c3df7ba2e56bdc663af5306b0af4e8662ecdf2a3e02fe62311f SHA512 a30c43069262bafd75a1fdb2652f470779c351bd52411303d615caaef9a7967325bf92fdb84a6e736b044352f2906ee38cd786eb1d0c6f695ab8b8d015a4e71c WHIRLPOOL 6e3a85948dce0280cd35e784d8e6be8225cb8d6bc4f036efcc17603c81fe2d2bce2cca5fc819788fe93553303c67f304579e57b058536b9f676006ad3c69cefd
+MISC ChangeLog-2015 16936 SHA256 5dbbce05d4b62d117a5cf5672ab4ddb30c31ff3a961db968477271d8342eb7c0 SHA512 9b807d940667545f211673047baf5fca4452643575f2512fc8976d9560e718f5abe893fc65e3a03432a74fb81ba0312bb462f56834e547b04280108e2b567f65 WHIRLPOOL 0e912f06b0329ff076e0f92876d7f105bd9f43a63ef5929d21aac05e67bc9f920941674edb671f3f407fd5093368e3f0f373e7d45225832801e81270a13b9424
+MISC metadata.xml 313 SHA256 7220aba897554ea2e6acbd77a56c97512713cdb8cf7a57c414086a15d1e05954 SHA512 01f11b9e45bc3c331d445213704287f1f034087930d4b55cbde700a483dcb64260d4805a4c2ec3686a99b59f3225999409d499cb63a40b3d8278d8a2e6213f57 WHIRLPOOL 2e6b243896ceb86db3f25760af12f386135e9545ef1ebff735f59541ea4b3b2870615b8ea857ee0b0322c616b4d4598ec4488e09de0a3205ba7e3383e656e3b2
diff --git a/dev-java/antlr/antlr-2.7.7-r7.ebuild b/dev-java/antlr/antlr-2.7.7-r7.ebuild
new file mode 100644
index 000000000000..3eae09ac430b
--- /dev/null
+++ b/dev-java/antlr/antlr-2.7.7-r7.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+JAVA_PKG_IUSE="doc"
+
+inherit java-pkg-2 java-pkg-simple
+
+DESCRIPTION="A parser generator for many languages"
+HOMEPAGE="http://www.antlr2.org/"
+SRC_URI="http://www.antlr2.org/download/${P}.tar.gz"
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="amd64 ~arm ppc64 x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="examples source"
+
+RDEPEND=">=virtual/jre-1.6"
+DEPEND=">=virtual/jdk-1.6
+ source? ( app-arch/zip )"
+
+S="${WORKDIR}/${P}"
+JAVA_SRC_DIR="${S}/${PN}"
+
+java_prepare() {
+ java-pkg_clean
+
+ # Delete build files from examples.
+ find examples \( -name Makefile.in -o -name shiplist \) -delete || die
+}
+
+src_configure() {
+ : # Avoid configure script.
+}
+
+src_install() {
+ java-pkg-simple_src_install
+ java-pkg_dolauncher antlr --main antlr.Tool
+ dodoc {CHANGES,README}.txt
+
+ use doc && java-pkg_dohtml -r doc/*
+ use examples && java-pkg_doexamples examples/java
+ use source && java-pkg_dosrc antlr
+}
diff --git a/dev-java/antlr/antlr-2.7.7-r8.ebuild b/dev-java/antlr/antlr-2.7.7-r8.ebuild
new file mode 100644
index 000000000000..7b6c1b00af0e
--- /dev/null
+++ b/dev-java/antlr/antlr-2.7.7-r8.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+JAVA_PKG_IUSE="doc source"
+
+inherit java-pkg-2 java-pkg-simple
+
+DESCRIPTION="A parser generator for many languages"
+HOMEPAGE="http://www.antlr2.org/"
+SRC_URI="http://www.antlr2.org/download/${P}.tar.gz"
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="examples"
+
+RDEPEND=">=virtual/jre-1.6"
+DEPEND=">=virtual/jdk-1.6"
+
+S="${WORKDIR}/${P}"
+
+JAVA_SRC_DIR="${S}/${PN}"
+
+DOCS=( CHANGES.txt README.txt )
+
+src_prepare() {
+ default
+ java-pkg_clean
+
+ # Delete build files from examples.
+ find examples \( -name Makefile.in -o -name shiplist \) -delete || die
+}
+
+# Avoid configure script.
+src_configure() { :; }
+
+src_install() {
+ java-pkg-simple_src_install
+ java-pkg_dolauncher antlr --main antlr.Tool
+
+ use doc && java-pkg_dohtml -r doc/*
+ use examples && java-pkg_doexamples examples/java
+ use source && java-pkg_dosrc antlr
+
+ einstalldocs
+}
diff --git a/dev-java/antlr/antlr-3.2.ebuild b/dev-java/antlr/antlr-3.2.ebuild
new file mode 100644
index 000000000000..d8976fb16787
--- /dev/null
+++ b/dev-java/antlr/antlr-3.2.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils java-pkg-2 java-pkg-simple
+
+DESCRIPTION="A parser generator for many languages"
+HOMEPAGE="http://www.antlr3.org/"
+SRC_URI="http://www.antlr3.org/download/${P}.tar.gz
+ http://www.antlr3.org/download/${P}.jar" # Prebuilt version needed.
+LICENSE="BSD"
+SLOT="3"
+KEYWORDS="amd64 ~arm ~arm64 ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="doc test"
+
+CDEPEND=">=dev-java/antlr-2.7.7-r7:0
+ dev-java/stringtemplate:0"
+
+RDEPEND="${CDEPEND}
+ >=virtual/jre-1.6"
+
+DEPEND="${CDEPEND}
+ >=virtual/jdk-1.6
+ test? ( dev-java/junit:4 )"
+
+S="${WORKDIR}/${P}"
+JAVA_GENTOO_CLASSPATH_EXTRA="${S}/${PN}-runtime.jar"
+JAVA_GENTOO_CLASSPATH="antlr,stringtemplate"
+
+src_unpack() {
+ unpack ${P}.tar.gz
+}
+
+java_prepare() {
+ java-pkg_clean
+
+ # These fixes have been applied in 3.5.
+ epatch "${FILESDIR}/${PV}-test-fixes.patch"
+ epatch "${FILESDIR}/${PV}-java-8.patch"
+
+ # Some tests fail under Java 8 in ways that probably aren't limited
+ # to the tests. This is bad but upstream is never going to update
+ # 3.2 even though other projects still rely on it. If any issues
+ # arise, we can only put pressure on those projects to upgrade.
+ if java-pkg_is-vm-version-ge 1.8; then
+ rm -v tool/src/test/java/org/antlr/test/Test{DFAConversion,SemanticPredicates,TopologicalSort}.java || die
+ fi
+
+ # 3.2 has strange hidden files.
+ find -type f -name "._*.*" -delete || die
+}
+
+src_compile() {
+ cd "${S}/runtime/Java/src/main" || die
+ JAVA_JAR_FILENAME="${S}/${PN}-runtime.jar" JAVA_PKG_IUSE="doc" java-pkg-simple_src_compile
+
+ cd "${S}/tool/src/main" || die
+
+ local G; for G in antlr codegen antlr.print assign.types buildnfa define; do # from pom.xml
+ antlr -o antlr2/org/antlr/grammar/v2/{,${G}.g} || die
+ done
+
+ # We have applied a patch to fix this version under Java 8. Trouble
+ # is that we need to run a prebuilt version before we can build our
+ # own and that version doesn't have the fix applied. We work around
+ # this by building just the offending class against the prebuilt
+ # version and then putting them together in the classpath. That
+ # isn't all. Due to a compiler limitation that Chewi doesn't fully
+ # understand, this class cannot be compiled by itself without a
+ # couple of tweaks that have been applied in the Java 8 patch.
+ ejavac -classpath "${DISTDIR}/${P}.jar" java/org/antlr/tool/CompositeGrammar.java
+
+ java -classpath "java:${DISTDIR}/${P}.jar" org.antlr.Tool $(find antlr3 -name "*.g") || die
+ JAVA_JAR_FILENAME="${S}/${PN}-tool.jar" java-pkg-simple_src_compile
+ java-pkg_addres "${S}/${PN}-tool.jar" resources
+}
+
+src_install() {
+ java-pkg_dojar ${PN}-{runtime,tool}.jar
+ java-pkg_dolauncher ${PN}${SLOT} --main org.antlr.Tool
+ use doc && java-pkg_dojavadoc runtime/Java/src/main/target/api
+}
+
+src_test() {
+ cd tool/src/test/java || die
+ local CP=".:${S}/${PN}-runtime.jar:${S}/${PN}-tool.jar:$(java-pkg_getjars junit-4,${JAVA_GENTOO_CLASSPATH})"
+
+ local TESTS=$(find * -name "Test*.java")
+ TESTS="${TESTS//.java}"
+ TESTS="${TESTS//\//.}"
+
+ ejavac -classpath "${CP}" $(find -name "*.java")
+ ejunit4 -classpath "${CP}" ${TESTS}
+}
diff --git a/dev-java/antlr/antlr-3.5.2.ebuild b/dev-java/antlr/antlr-3.5.2.ebuild
new file mode 100644
index 000000000000..46c6402f4b20
--- /dev/null
+++ b/dev-java/antlr/antlr-3.5.2.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils java-pkg-2 java-pkg-simple
+
+DESCRIPTION="A parser generator for many languages"
+HOMEPAGE="http://www.antlr3.org/"
+SRC_URI="https://github.com/${PN}/${PN}3/archive/${PV}.tar.gz -> ${P}.tar.gz
+ http://www.antlr3.org/download/${P}-complete.jar" # Prebuilt version needed.
+LICENSE="BSD"
+SLOT="3.5"
+KEYWORDS="amd64 ~arm ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="doc test"
+
+CDEPEND="dev-java/stringtemplate:4"
+
+RDEPEND="${CDEPEND}
+ >=virtual/jre-1.6"
+
+DEPEND="${CDEPEND}
+ >=virtual/jdk-1.6
+ test? ( dev-java/junit:4 )"
+
+S="${WORKDIR}/${PN}3-${PV}"
+JAVA_GENTOO_CLASSPATH_EXTRA="${S}/${PN}-runtime.jar"
+JAVA_GENTOO_CLASSPATH="stringtemplate-4"
+
+src_unpack() {
+ unpack ${P}.tar.gz
+}
+
+java_prepare() {
+ java-pkg_clean
+
+ # This requires StringTemplate v3 and is only needed for
+ # output=template. Nothing in the tree currently needs that and the
+ # dependency situation is already hairy enough as it is.
+ rm -v runtime/Java/src/main/java/org/antlr/runtime/tree/DOTTreeGenerator.java || die
+
+ # Some tests have to be removed as a result.
+ rm -v tool/src/test/java/org/antlr/test/Test{RewriteTemplates,Templates}.java || die
+ epatch "${FILESDIR}/${PV}-test-fixes.patch"
+
+ # Some tests fail under Java 8 in ways that probably aren't limited
+ # to the tests. This is bad but upstream is never going to update
+ # 3.5. At the time of writing, we only use it to build 4 anyway.
+ if java-pkg_is-vm-version-ge 1.8; then
+ rm -v tool/src/test/java/org/antlr/test/Test{DFAConversion,SemanticPredicates,TopologicalSort}.java || die
+ fi
+}
+
+src_compile() {
+ cd "${S}/runtime/Java/src/main" || die
+ JAVA_JAR_FILENAME="${S}/${PN}-runtime.jar" JAVA_PKG_IUSE="doc" java-pkg-simple_src_compile
+
+ cd "${S}/tool/src/main" || die
+ java -jar "${DISTDIR}/${P}-complete.jar" $(find antlr3 -name "*.g") || die
+ JAVA_JAR_FILENAME="${S}/${PN}-tool.jar" java-pkg-simple_src_compile
+ java-pkg_addres "${S}/${PN}-tool.jar" resources
+}
+
+src_install() {
+ java-pkg_dojar ${PN}-{runtime,tool}.jar
+ java-pkg_dolauncher ${PN}${SLOT} --main org.antlr.Tool
+ use doc && java-pkg_dojavadoc runtime/Java/src/main/target/api
+}
+
+src_test() {
+ cd tool/src/test/java || die
+ local CP=".:${S}/${PN}-runtime.jar:${S}/${PN}-tool.jar:$(java-pkg_getjars junit-4,${JAVA_GENTOO_CLASSPATH})"
+
+ local TESTS=$(find * -name "Test*.java")
+ TESTS="${TESTS//.java}"
+ TESTS="${TESTS//\//.}"
+
+ ejavac -classpath "${CP}" $(find -name "*.java")
+
+ # ejunit automatically adds all registered subdependencies to the
+ # classpath, which is annoying in this case because of the cyclic
+ # dependency on stringtemplate. It will blow up when trying to find
+ # antlr-3.5 on the system before it is installed. The easiest but
+ # somewhat ugly way to avoid this is to unset JAVA_PKG_DEPEND_FILE.
+ JAVA_PKG_DEPEND_FILE= ejunit4 -classpath "${CP}" ${TESTS}
+}
diff --git a/dev-java/antlr/antlr-4.5.1.ebuild b/dev-java/antlr/antlr-4.5.1.ebuild
new file mode 100644
index 000000000000..a7c4c1ffbb73
--- /dev/null
+++ b/dev-java/antlr/antlr-4.5.1.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+JAVA_PKG_IUSE="source"
+
+inherit java-pkg-2 java-pkg-simple
+
+DESCRIPTION="A parser generator for many languages"
+HOMEPAGE="http://www.antlr.org/"
+SRC_URI="https://github.com/${PN}/${PN}4/archive/${PV}.tar.gz -> ${P}.tar.gz
+ http://www.antlr.org/download/${P}-complete.jar" # Prebuilt version needed.
+LICENSE="BSD"
+SLOT="4"
+KEYWORDS="amd64 ~arm ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="doc test"
+
+CDEPEND="dev-java/antlr:3.5
+ dev-java/stringtemplate:4
+ dev-java/treelayout:0"
+
+RDEPEND="${CDEPEND}
+ >=virtual/jre-1.6"
+
+DEPEND="${CDEPEND}
+ >=virtual/jdk-1.6
+ test? (
+ dev-java/hamcrest-core:1.3
+ dev-java/junit:4
+ )"
+
+S="${WORKDIR}/${PN}4-${PV}"
+JAVA_GENTOO_CLASSPATH="stringtemplate-4,treelayout"
+
+src_unpack() {
+ unpack ${P}.tar.gz
+}
+
+java_prepare() {
+ java-pkg_clean
+}
+
+src_configure() {
+ # TODO: Make java-config accept a jar@package query.
+ JAVA_GENTOO_CLASSPATH_EXTRA="${S}/${PN}-runtime.jar:$(java-pkg_getjar antlr-3.5 antlr-runtime.jar)"
+}
+
+src_compile() {
+ cd "${S}/runtime/Java/src"
+ local G PKG
+
+ for G in $(find * -name "*.g4"); do
+ PKG="${G%/*}"
+ PKG="${PKG//\//.}"
+ java -jar "${DISTDIR}/${P}-complete.jar" -package "${PKG}" "${G}" || die
+ done
+
+ JAVA_JAR_FILENAME="${S}/${PN}-runtime.jar" JAVA_PKG_IUSE="doc" java-pkg-simple_src_compile
+
+ cd "${S}/tool/src"
+ antlr3.5 $(find -name "*.g") || die
+ JAVA_JAR_FILENAME="${S}/${PN}-tool.jar" java-pkg-simple_src_compile
+ java-pkg_addres "${S}/${PN}-tool.jar" ../resources
+}
+
+src_install() {
+ java-pkg_dojar ${PN}-{runtime,tool}.jar
+ java-pkg_dolauncher ${PN}${SLOT} --main org.antlr.v4.Tool
+ use doc && java-pkg_dojavadoc runtime/Java/src/target/api
+ use source && java-pkg_dosrc runtime/Java/src/org tool/src/org
+}
+
+junit_suite() {
+ cd "${S}/$1-testsuite/test" || die
+ local CP=".:${S}/runtime-testsuite/test:${S}/${PN}-tool.jar:$(java-pkg_getjars hamcrest-core-1.3,junit-4,${JAVA_GENTOO_CLASSPATH}):${JAVA_GENTOO_CLASSPATH_EXTRA}"
+
+ local TESTS=$(find ${2:-*} -name "Test*.java")
+ TESTS="${TESTS//.java}"
+ TESTS="${TESTS//\//.}"
+
+ ejavac -classpath "${CP}" $(find ${2:-*} -name "*.java")
+ ejunit4 -classpath "${CP}" ${TESTS}
+}
+
+src_test() {
+ # Only run Java runtime tests as we haven't built other languages.
+ junit_suite runtime org/antlr/v4/test/runtime/java
+ junit_suite tool
+}
diff --git a/dev-java/antlr/antlr-4.5.3.ebuild b/dev-java/antlr/antlr-4.5.3.ebuild
new file mode 100644
index 000000000000..3b48b132714c
--- /dev/null
+++ b/dev-java/antlr/antlr-4.5.3.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+JAVA_PKG_IUSE="source"
+
+inherit java-pkg-2 java-pkg-simple
+
+DESCRIPTION="A parser generator for many languages"
+HOMEPAGE="http://www.antlr.org/"
+SRC_URI="https://github.com/${PN}/${PN}4/archive/${PV}.tar.gz -> ${P}.tar.gz
+ http://www.antlr.org/download/${P}-complete.jar" # Prebuilt version needed.
+LICENSE="BSD"
+SLOT="4"
+KEYWORDS="~amd64 ~arm ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="doc test"
+
+CDEPEND="dev-java/antlr:3.5
+ dev-java/stringtemplate:4
+ dev-java/treelayout:0"
+
+RDEPEND="${CDEPEND}
+ >=virtual/jre-1.6"
+
+DEPEND="${CDEPEND}
+ >=virtual/jdk-1.6
+ test? (
+ dev-java/hamcrest-core:1.3
+ dev-java/junit:4
+ )"
+
+S="${WORKDIR}/${PN}4-${PV}"
+JAVA_GENTOO_CLASSPATH="stringtemplate-4,treelayout"
+
+src_unpack() {
+ unpack ${P}.tar.gz
+}
+
+java_prepare() {
+ java-pkg_clean
+}
+
+src_configure() {
+ # TODO: Make java-config accept a jar@package query.
+ JAVA_GENTOO_CLASSPATH_EXTRA="${S}/${PN}-runtime.jar:$(java-pkg_getjar antlr-3.5 antlr-runtime.jar)"
+}
+
+src_compile() {
+ cd "${S}/runtime/Java/src"
+ local G PKG
+
+ for G in $(find * -name "*.g4"); do
+ PKG="${G%/*}"
+ PKG="${PKG//\//.}"
+ java -jar "${DISTDIR}/${P}-complete.jar" -package "${PKG}" "${G}" || die
+ done
+
+ JAVA_JAR_FILENAME="${S}/${PN}-runtime.jar" JAVA_PKG_IUSE="doc" java-pkg-simple_src_compile
+
+ cd "${S}/tool/src"
+ antlr3.5 $(find -name "*.g") || die
+ JAVA_JAR_FILENAME="${S}/${PN}-tool.jar" java-pkg-simple_src_compile
+ java-pkg_addres "${S}/${PN}-tool.jar" ../resources
+}
+
+src_install() {
+ java-pkg_dojar ${PN}-{runtime,tool}.jar
+ java-pkg_dolauncher ${PN}${SLOT} --main org.antlr.v4.Tool
+ use doc && java-pkg_dojavadoc runtime/Java/src/target/api
+ use source && java-pkg_dosrc runtime/Java/src/org tool/src/org
+}
+
+junit_suite() {
+ cd "${S}/$1-testsuite/test" || die
+ local CP=".:${S}/runtime-testsuite/test:${S}/${PN}-tool.jar:$(java-pkg_getjars hamcrest-core-1.3,junit-4,${JAVA_GENTOO_CLASSPATH}):${JAVA_GENTOO_CLASSPATH_EXTRA}"
+
+ local TESTS=$(find ${2:-*} -name "Test*.java")
+ TESTS="${TESTS//.java}"
+ TESTS="${TESTS//\//.}"
+
+ ejavac -classpath "${CP}" $(find ${2:-*} -name "*.java")
+ ejunit4 -classpath "${CP}" ${TESTS}
+}
+
+src_test() {
+ # Only run Java runtime tests as we haven't built other languages.
+ junit_suite runtime org/antlr/v4/test/runtime/java
+ junit_suite tool
+}
diff --git a/dev-java/antlr/files/3.2-java-8.patch b/dev-java/antlr/files/3.2-java-8.patch
new file mode 100644
index 000000000000..662abfe1e17f
--- /dev/null
+++ b/dev-java/antlr/files/3.2-java-8.patch
@@ -0,0 +1,32 @@
+diff -Naur antlr-3.3.orig/tool/src/main/java/org/antlr/tool/CompositeGrammar.java antlr-3.3/tool/src/main/java/org/antlr/tool/CompositeGrammar.java
+--- antlr-3.3.orig/tool/src/main/java/org/antlr/tool/CompositeGrammar.java 2010-11-30 01:54:04.000000000 +0000
++++ antlr-3.3/tool/src/main/java/org/antlr/tool/CompositeGrammar.java 2015-10-03 14:28:50.063497181 +0100
+@@ -219,7 +219,9 @@
+ public List<Grammar> getIndirectDelegates(Grammar g) {
+ List<Grammar> direct = getDirectDelegates(g);
+ List<Grammar> delegates = getDelegates(g);
+- delegates.removeAll(direct);
++ if (direct != null) {
++ delegates.removeAll(direct);
++ }
+ return delegates;
+ }
+
+@@ -389,7 +391,7 @@
+ Set<String> localRuleDefs = new HashSet<String>();
+ Set<String> overrides = new HashSet<String>();
+ // compute set of non-overridden rules for this delegate
+- for (Rule r : p.grammar.getRules()) {
++ for (Rule r : (Collection<Rule>) p.grammar.getRules()) {
+ if ( !ruleDefs.contains(r.name) ) {
+ localRuleDefs.add(r.name);
+ }
+@@ -409,7 +411,7 @@
+
+ // pass larger set of defined rules to delegates
+ if ( p.children!=null ) {
+- for (CompositeGrammarTree delegate : p.children) {
++ for (CompositeGrammarTree delegate : (List<CompositeGrammarTree>) p.children) {
+ _minimizeRuleSet(ruleDefs, delegate);
+ }
+ }
diff --git a/dev-java/antlr/files/3.2-test-fixes.patch b/dev-java/antlr/files/3.2-test-fixes.patch
new file mode 100644
index 000000000000..0544b7006170
--- /dev/null
+++ b/dev-java/antlr/files/3.2-test-fixes.patch
@@ -0,0 +1,249 @@
+--- tool/src/test/java/org/antlr/test/BaseTest.java.orig 2010-11-30 01:54:04.000000000 +0000
++++ tool/src/test/java/org/antlr/test/BaseTest.java 2015-09-24 22:25:36.872191194 +0100
+@@ -130,8 +130,8 @@
+ try {
+ Process process =
+ Runtime.getRuntime().exec(args, null, outputDir);
+- StreamVacuum stdout = new StreamVacuum(process.getInputStream());
+- StreamVacuum stderr = new StreamVacuum(process.getErrorStream());
++ StreamVacuum stdout = new StreamVacuum(process.getInputStream(), tmpdir+"/"+fileName);
++ StreamVacuum stderr = new StreamVacuum(process.getErrorStream(), tmpdir+"/"+fileName);
+ stdout.start();
+ stderr.start();
+ process.waitFor();
+@@ -406,8 +406,8 @@
+ //System.out.println("execParser: "+cmdLine);
+ Process process =
+ Runtime.getRuntime().exec(args, null, new File(tmpdir));
+- StreamVacuum stdoutVacuum = new StreamVacuum(process.getInputStream());
+- StreamVacuum stderrVacuum = new StreamVacuum(process.getErrorStream());
++ StreamVacuum stdoutVacuum = new StreamVacuum(process.getInputStream(), tmpdir+"/input");
++ StreamVacuum stderrVacuum = new StreamVacuum(process.getErrorStream(), tmpdir+"/input");
+ stdoutVacuum.start();
+ stderrVacuum.start();
+ process.waitFor();
+@@ -499,8 +499,10 @@
+ StringBuffer buf = new StringBuffer();
+ BufferedReader in;
+ Thread sucker;
+- public StreamVacuum(InputStream in) {
++ String inputFile;
++ public StreamVacuum(InputStream in, String inputFile) {
+ this.in = new BufferedReader( new InputStreamReader(in) );
++ this.inputFile = inputFile;
+ }
+ public void start() {
+ sucker = new Thread(this);
+@@ -510,6 +512,8 @@
+ try {
+ String line = in.readLine();
+ while (line!=null) {
++ if (line.startsWith(inputFile))
++ line = line.substring(inputFile.length()+1);
+ buf.append(line);
+ buf.append('\n');
+ line = in.readLine();
+--- tool/src/test/java/org/antlr/test/TestTopologicalSort.java.orig 2009-09-23 19:36:14.000000000 +0100
++++ tool/src/test/java/org/antlr/test/TestTopologicalSort.java 2010-11-30 01:54:04.000000000 +0000
+@@ -49,7 +49,7 @@
+ g.addEdge("F", "H");
+ g.addEdge("E", "F");
+
+- String expecting = "[H, F, E, D, A, G, B, C]";
++ String expecting = "[H, F, E, D, G, A, B, C]";
+ List nodes = g.sort();
+ String result = nodes.toString();
+ assertEquals(expecting, result);
+@@ -91,7 +91,7 @@
+ g.addEdge("Def.g", "Java.tokens"); // walkers feed off generated tokens
+ g.addEdge("Ref.g", "Java.tokens");
+
+- String expecting = "[MyJava.tokens, Java.g, Java.tokens, Def.g, Ref.g]";
++ String expecting = "[MyJava.tokens, Java.g, Java.tokens, Ref.g, Def.g]";
+ List nodes = g.sort();
+ String result = nodes.toString();
+ assertEquals(expecting, result);
+@@ -105,7 +105,7 @@
+ g.addEdge("Def.g", "JavaLexer.tokens");
+ g.addEdge("Ref.g", "JavaLexer.tokens");
+
+- String expecting = "[JavaLexer.g, JavaLexer.tokens, JavaParser.g, Def.g, Ref.g]";
++ String expecting = "[JavaLexer.g, JavaLexer.tokens, JavaParser.g, Ref.g, Def.g]";
+ List nodes = g.sort();
+ String result = nodes.toString();
+ assertEquals(expecting, result);
+--- tool/src/test/java/org/antlr/test/TestSemanticPredicates.java.orig 2009-09-23 19:36:12.000000000 +0100
++++ tool/src/test/java/org/antlr/test/TestSemanticPredicates.java 2015-12-05 13:52:05.923411552 +0000
+@@ -731,19 +731,23 @@
+ "c : a\n" +
+ " | b\n" +
+ " ;\n");
+- String expecting =
+- ".s0-X->.s1\n" +
+- ".s1-{((a&&c)||(b&&c))}?->:s2=>1\n" +
+- ".s1-{c}?->:s3=>2\n";
+- int[] unreachableAlts = null;
+- int[] nonDetAlts = null;
+- String ambigInput = null;
+- int[] insufficientPredAlts = null;
+- int[] danglingAlts = null;
+- int numWarnings = 0;
+- checkDecision(g, 3, expecting, unreachableAlts,
+- nonDetAlts, ambigInput, insufficientPredAlts,
+- danglingAlts, numWarnings, false);
++ try {
++ String expecting =
++ ".s0-X->.s1\n" +
++ ".s1-{((a&&c)||(b&&c))}?->:s2=>1\n" +
++ ".s1-{c}?->:s3=>2\n";
++ checkDecision(g, 3, expecting, null,
++ null, null, null,
++ null, 0, false);
++ } catch (org.junit.ComparisonFailure e) {
++ String expecting =
++ ".s0-X->.s1\n" +
++ ".s1-{((b&&c)||(a&&c))}?->:s2=>1\n" +
++ ".s1-{c}?->:s3=>2\n";
++ checkDecision(g, 3, expecting, null,
++ null, null, null,
++ null, 0, false);
++ }
+ }
+
+ @Test
+--- tool/src/test/java/org/antlr/test/TestAttributes.java.orig 2015-12-05 13:55:55.392843185 +0000
++++ tool/src/test/java/org/antlr/test/TestAttributes.java 2015-12-05 14:04:38.120599871 +0000
+@@ -439,20 +439,15 @@
+ ErrorManager.setErrorListener(equeue);
+ Grammar g = new Grammar(
+ "parser grammar t;\n"+
+- "a : x=b {"+action+"} ;\n" +
++ "a : x=b {###"+action+"!!!} ;\n" +
+ "b : B ;\n");
+ Tool antlr = newTool();
+ CodeGenerator generator = new CodeGenerator(antlr, g, "Java");
+ g.setCodeGenerator(generator);
+- generator.genRecognizer(); // forces load of templates
+- ActionTranslator translator = new ActionTranslator(generator,"a",
+- new antlr.CommonToken(ANTLRParser.ACTION,action),1);
+- String rawTranslation =
+- translator.translate();
+- StringTemplateGroup templates =
+- new StringTemplateGroup(".", AngleBracketTemplateLexer.class);
+- StringTemplate actionST = new StringTemplate(templates, rawTranslation);
+- String found = actionST.toString();
++ generator.genRecognizer(); // codegen phase sets some vars we need
++ StringTemplate codeST = generator.getRecognizerST();
++ String code = codeST.toString();
++ String found = code.substring(code.indexOf("###")+3,code.indexOf("!!!"));
+ assertEquals(expecting, found);
+
+ assertEquals("unexpected errors: "+equeue, 0, equeue.errors.size());
+@@ -1771,20 +1766,15 @@
+ Grammar g = new Grammar(
+ "parser grammar t;\n" +
+ "options {output=template;}\n"+
+- "a : {"+action+"}\n" +
++ "a : {###"+action+"!!!}\n" +
+ " ;\n");
+ Tool antlr = newTool();
+ CodeGenerator generator = new CodeGenerator(antlr, g, "Java");
+ g.setCodeGenerator(generator);
+- generator.genRecognizer(); // forces load of templates
+- ActionTranslator translator = new ActionTranslator(generator,"a",
+- new antlr.CommonToken(ANTLRParser.ACTION,action),1);
+- String rawTranslation =
+- translator.translate();
+- StringTemplateGroup templates =
+- new StringTemplateGroup(".", AngleBracketTemplateLexer.class);
+- StringTemplate actionST = new StringTemplate(templates, rawTranslation);
+- String found = actionST.toString();
++ generator.genRecognizer(); // codegen phase sets some vars we need
++ StringTemplate codeST = generator.getRecognizerST();
++ String code = codeST.toString();
++ String found = code.substring(code.indexOf("###")+3,code.indexOf("!!!"));
+ assertEquals(expecting, found);
+
+ assertEquals("unexpected errors: "+equeue, 0, equeue.errors.size());
+@@ -1869,35 +1859,21 @@
+ ErrorManager.setErrorListener(equeue);
+ Grammar g = new Grammar(
+ "grammar t;\n"+
+- "a : b {"+action+"}\n" +
+- " | c {"+action2+"}\n" +
++ "a : b {###"+action+"!!!}\n" +
++ " | c {^^^"+action2+"&&&}\n" +
+ " ;\n" +
+ "b : 'a';\n" +
+ "c : '0';\n");
+ Tool antlr = newTool();
+ CodeGenerator generator = new CodeGenerator(antlr, g, "Java");
+ g.setCodeGenerator(generator);
+- generator.genRecognizer(); // forces load of templates
+- ActionTranslator translator = new ActionTranslator(generator,"a",
+- new antlr.CommonToken(ANTLRParser.ACTION,action),1);
+- String rawTranslation =
+- translator.translate();
+- StringTemplateGroup templates =
+- new StringTemplateGroup(".", AngleBracketTemplateLexer.class);
+- StringTemplate actionST = new StringTemplate(templates, rawTranslation);
+- String found = actionST.toString();
++ generator.genRecognizer(); // codegen phase sets some vars we need
++ StringTemplate codeST = generator.getRecognizerST();
++ String code = codeST.toString();
++ String found = code.substring(code.indexOf("###")+3,code.indexOf("!!!"));
+ assertEquals(expecting, found);
+
+- assertEquals("unexpected errors: "+equeue, 0, equeue.errors.size());
+- translator = new ActionTranslator(generator,
+- "a",
+- new antlr.CommonToken(ANTLRParser.ACTION,action2),2);
+- rawTranslation =
+- translator.translate();
+- templates =
+- new StringTemplateGroup(".", AngleBracketTemplateLexer.class);
+- actionST = new StringTemplate(templates, rawTranslation);
+- found = actionST.toString();
++ found = code.substring(code.indexOf("^^^")+3,code.indexOf("&&&"));
+
+ assertEquals(expecting2, found);
+
+@@ -3208,7 +3184,7 @@
+
+ @Test public void testAssignToTreeNodeAttribute() throws Exception {
+ String action = "$tree.scope = localScope;";
+- String expecting = "(()retval.tree).scope = localScope;";
++ String expecting = "((Object)retval.tree).scope = localScope;";
+ ErrorQueue equeue = new ErrorQueue();
+ ErrorManager.setErrorListener(equeue);
+ Grammar g = new Grammar(
+@@ -3219,24 +3195,17 @@
+ " Scope localScope=null;\n" +
+ "}\n" +
+ "@after {\n" +
+- " $tree.scope = localScope;\n" +
++ " ###$tree.scope = localScope;!!!\n" +
+ "}\n" +
+ " : 'a' -> ^('a')\n" +
+ ";");
+ Tool antlr = newTool();
+ CodeGenerator generator = new CodeGenerator(antlr, g, "Java");
+ g.setCodeGenerator(generator);
+- generator.genRecognizer(); // forces load of templates
+- ActionTranslator translator = new ActionTranslator(generator,
+- "rule",
+- new antlr.CommonToken(ANTLRParser.ACTION,action),1);
+- String rawTranslation =
+- translator.translate();
+- StringTemplateGroup templates =
+- new StringTemplateGroup(".", AngleBracketTemplateLexer.class);
+- StringTemplate actionST = new StringTemplate(templates, rawTranslation);
+- String found = actionST.toString();
+- assertEquals("unexpected errors: "+equeue, 0, equeue.errors.size());
++ generator.genRecognizer(); // codegen phase sets some vars we need
++ StringTemplate codeST = generator.getRecognizerST();
++ String code = codeST.toString();
++ String found = code.substring(code.indexOf("###")+3,code.indexOf("!!!"));
+ assertEquals(expecting, found);
+ }
+
diff --git a/dev-java/antlr/files/3.5.2-test-fixes.patch b/dev-java/antlr/files/3.5.2-test-fixes.patch
new file mode 100644
index 000000000000..f2609ac1f0b5
--- /dev/null
+++ b/dev-java/antlr/files/3.5.2-test-fixes.patch
@@ -0,0 +1,36 @@
+diff -Naur antlr3-3.5.2.orig/tool/src/test/java/org/antlr/test/TestAttributes.java antlr3-3.5.2/tool/src/test/java/org/antlr/test/TestAttributes.java
+--- antlr3-3.5.2.orig/tool/src/test/java/org/antlr/test/TestAttributes.java 2014-03-25 11:47:54.000000000 +0000
++++ antlr3-3.5.2/tool/src/test/java/org/antlr/test/TestAttributes.java 2015-10-02 22:42:56.921263410 +0100
+@@ -2131,7 +2132,7 @@
+ assertEquals(expecting, found);
+ }
+
+- @Test public void testRuleLabelOnTwoDifferentRulesTemplate() throws Exception {
++ @org.junit.Ignore @Test public void testRuleLabelOnTwoDifferentRulesTemplate() throws Exception {
+ String grammar =
+ "grammar T;\n"+
+ "options {output=template;}\n"+
+diff -Naur antlr3-3.5.2.orig/tool/src/test/java/org/antlr/test/TestSyntacticPredicateEvaluation.java antlr3-3.5.2/tool/src/test/java/org/antlr/test/TestSyntacticPredicateEvaluation.java
+--- antlr3-3.5.2.orig/tool/src/test/java/org/antlr/test/TestSyntacticPredicateEvaluation.java 2014-03-25 11:47:54.000000000 +0000
++++ antlr3-3.5.2/tool/src/test/java/org/antlr/test/TestSyntacticPredicateEvaluation.java 2015-10-02 22:43:07.303105023 +0100
+@@ -339,7 +340,7 @@
+ assertEquals("b:alt 2 a:alt 1\n", found);
+ }
+
+- @Test public void testSynPredWithOutputTemplate() throws Exception {
++ @org.junit.Ignore @Test public void testSynPredWithOutputTemplate() throws Exception {
+ // really just seeing if it will compile
+ String grammar =
+ "grammar T;\n" +
+diff -Naur antlr3-3.5.2.orig/tool/src/test/java/org/antlr/test/TestTreeParsing.java antlr3-3.5.2/tool/src/test/java/org/antlr/test/TestTreeParsing.java
+--- antlr3-3.5.2.orig/tool/src/test/java/org/antlr/test/TestTreeParsing.java 2014-03-25 11:47:54.000000000 +0000
++++ antlr3-3.5.2/tool/src/test/java/org/antlr/test/TestTreeParsing.java 2015-10-02 22:41:32.235554776 +0100
+@@ -141,7 +142,7 @@
+ assertEquals("alt 1\n", found);
+ }
+
+- @Test public void testTemplateOutput() throws Exception {
++ @org.junit.Ignore @Test public void testTemplateOutput() throws Exception {
+ String grammar =
+ "grammar T;\n" +
+ "options {output=AST;}\n" +
diff --git a/dev-java/antlr/metadata.xml b/dev-java/antlr/metadata.xml
new file mode 100644
index 000000000000..f70ce39614d6
--- /dev/null
+++ b/dev-java/antlr/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>java@gentoo.org</email>
+ <name>Java</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">antlr/antlr4</remote-id>
+ </upstream>
+</pkgmetadata>