Skip to content

Commit

Permalink
dev-java/antlr: Version bump to 4.5.3
Browse files Browse the repository at this point in the history
Package-Manager: portage-2.3.1
  • Loading branch information
chewi committed Oct 7, 2016
1 parent 2142438 commit 88321ee
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dev-java/antlr/Manifest
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ DIST antlr-3.5.2-complete.jar 2456317 SHA256 26ca659f47d77384f518cf2b6463892fcd4
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
91 changes: 91 additions & 0 deletions dev-java/antlr/antlr-4.5.3.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

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 ~x64-freebsd ~x86-freebsd ~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
}

0 comments on commit 88321ee

Please sign in to comment.