summaryrefslogtreecommitdiff
path: root/dev-java/jflex
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/jflex
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-java/jflex')
-rw-r--r--dev-java/jflex/Manifest6
-rw-r--r--dev-java/jflex/files/icedtea-arm.patch18
-rw-r--r--dev-java/jflex/jflex-1.6.1.ebuild120
-rw-r--r--dev-java/jflex/metadata.xml12
4 files changed, 156 insertions, 0 deletions
diff --git a/dev-java/jflex/Manifest b/dev-java/jflex/Manifest
new file mode 100644
index 000000000000..05aee61a80fe
--- /dev/null
+++ b/dev-java/jflex/Manifest
@@ -0,0 +1,6 @@
+AUX icedtea-arm.patch 710 SHA256 b3d588f1f9906a75b2c7a730ada19aecc23169a21d951fd415e640b977fa0099 SHA512 9ebf22f2771672bb9ef28fcb7eff0d907e9fe4466b18b3ec3915b27caa2edb07934a47311abf41fbe124b484cccbb19ca68f69acd5bd76e46a49b029dbf275b6 WHIRLPOOL 83fcca1bfd1c5f8f9b89cba83030312609c777a27d321301a5ac0a371d5ef678ef199206ce652841de2bc8a1735f27cb4c21c3dce06a7390ea88ee10f330246e
+DIST jflex-1.6.1.tar.gz 3027791 SHA256 9879fb4ea7b286af3c3439cf148f5739dfa722edbd978f2f798268b2e016f8c0 SHA512 436840c90d906042205d27e1d3c56dec724bf62cc3d8c8d3445f217af0a50c9ca2bb56ed91f0cd3c37a930f7ca22f4cc50e8c28dbe905f02adf695c8e96fb07b WHIRLPOOL 27e2769b1b1dc720cee71718eca024905fd9e200c53771c2db293471b0190d9a3c9d2245fbbc5ab76a1f22e1496053d35d625a34c09819b1e367f78840152666
+EBUILD jflex-1.6.1.ebuild 3548 SHA256 ee139795063e11f2e616322461762c782362554d97f89c474e11979c941a7ac2 SHA512 cb21aefd34f42052dc666747ed7aa397d2e0c7f97683db135274838ec45f0887e15b69b18dd8b8da3ec91998d6642818c37566f374c185bb03f84fd8e482b4c7 WHIRLPOOL ec200b5fec4c1d7288ed7c79ff3903da641b19d37f4e7e2a6004a2c07c672c2781870251161e179e187950ec3db55700dbe13ec2750a5c0a957a9be0126f9e19
+MISC ChangeLog 5814 SHA256 d27f0e9c3319655842a6b5aa622178b32920900c4b5abe7a471be160157ef22d SHA512 792c9113ba384ccee8bc5685e23cd61a896649842828f063a3d051676087645c473b3d3e65ae04416f6a388761afb9b1611f74dbc3e7d254cd051ca90620fb6f WHIRLPOOL bc15817208631d611c6355a68833c9cae937c0a5a4a6dc5871bf5c63474e13ced5e469375568206b898d0a3aad76f3377195441a271d071157fb749cdc449885
+MISC ChangeLog-2015 3651 SHA256 6aec9e999bf54155d66ecf1c09b4faf1200f7b32221f9625ad575bf3a8a340b6 SHA512 7c7f5254603ae88ccced92bf54c76643b3888707c88395eef739c71225509f84d1b8f6f6f1c5ee5b5f77a897c5993069eb0687c181b00a1491e9669dd682a00a WHIRLPOOL beacb1486b91c1136353ef7c58758a4b38a63f564d51802e9b656474b5d172b6cc3a5815003e6ffa0295c8be668ad987bb586daaa0a8483cfc5433738067a7a5
+MISC metadata.xml 365 SHA256 4a7143211c51874add1713c29b122c94e4b70135d578ef3d22f5d0ce7eb4eebf SHA512 cb20e2901f90975ffa7722c69edbc884b0f6ebc7500636e6ea41668754e8d8dd4732a71774dbb74a7d38240b2fbd6c1941adfc092fe83154e1ee70f6ab89e379 WHIRLPOOL afbb589cd83ad96b92bf14ffff4d60a8e1e3ddeaab12a2d067390c41dc28fa25ce1dc9feb21da9f17398707e0b77a744b670da9b98fb5051098a6f70abff83f3
diff --git a/dev-java/jflex/files/icedtea-arm.patch b/dev-java/jflex/files/icedtea-arm.patch
new file mode 100644
index 000000000000..acefd9b553e2
--- /dev/null
+++ b/dev-java/jflex/files/icedtea-arm.patch
@@ -0,0 +1,18 @@
+http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2678
+
+diff -Naur jflex-1.6.1.orig/src/main/java/jflex/Emitter.java jflex-1.6.1/src/main/java/jflex/Emitter.java
+--- jflex-1.6.1.orig/src/main/java/jflex/Emitter.java 2015-03-16 17:27:31.000000000 +0000
++++ jflex-1.6.1/src/main/java/jflex/Emitter.java 2015-10-25 23:33:35.784487747 +0000
+@@ -1304,8 +1304,10 @@
+
+ for (int i = 0; i < dfa.numStates; i++) {
+ char j = 0;
+- while ( !isTransition[i] && j < dfa.numInput )
+- isTransition[i] = dfa.table[i][j++] != DFA.NO_TARGET;
++ while ( !isTransition[i] && j < dfa.numInput ) {
++ isTransition[i] = dfa.table[i][j] != DFA.NO_TARGET;
++ j++;
++ }
+ }
+ }
+
diff --git a/dev-java/jflex/jflex-1.6.1.ebuild b/dev-java/jflex/jflex-1.6.1.ebuild
new file mode 100644
index 000000000000..a9b7189a0559
--- /dev/null
+++ b/dev-java/jflex/jflex-1.6.1.ebuild
@@ -0,0 +1,120 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+JAVA_PKG_IUSE="doc source"
+
+inherit eutils java-pkg-2 java-pkg-simple
+
+DESCRIPTION="JFlex is a lexical analyzer generator for Java"
+HOMEPAGE="http://www.jflex.de/"
+SRC_URI="http://${PN}.de/${P}.tar.gz"
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~arm64 ppc64 x86 ~amd64-fbsd ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="examples test vim-syntax"
+
+CDEPEND="dev-java/ant-core:0"
+
+RDEPEND=">=virtual/jre-1.6
+ vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )
+ ${CDEPEND}"
+
+DEPEND=">=virtual/jdk-1.6
+ test? ( dev-java/junit:4 )
+ ${CDEPEND}"
+
+PDEPEND=">=dev-java/javacup-0.11b_p20151001:0"
+
+S="${WORKDIR}/${P}"
+JAVA_SRC_DIR="src/main/java"
+
+java_prepare() {
+ # See below for details.
+ epatch "${FILESDIR}/icedtea-arm.patch"
+
+ # We need the bundled jflex.jar.
+ rm -rv ${JAVA_SRC_DIR}/java_cup examples/pom.xml || die
+
+ # Remove the bundled java-cup.jar if unneeded.
+ if has_version ${PDEPEND}; then
+ rm -v lib/java-cup-*.jar || die
+ fi
+}
+
+src_configure() {
+ # javacup is a cyclic dependency. Use the package if we have it,
+ # otherwise use the bundled version and install the package later.
+ if has_version ${PDEPEND}; then
+ # Use PORTAGE_QUIET to suppress a QA warning that is spurious
+ # thanks to has_version above. This is Portage-specific but
+ # showing the warning elsewhere isn't the end of the world.
+ JAVACUP=$(PORTAGE_QUIET=1 java-pkg_getjar --build-only javacup javacup.jar)
+ else
+ JAVACUP=$(echo lib/java-cup-*.jar)
+ fi
+
+ JAVA_GENTOO_CLASSPATH_EXTRA="$(java-pkg_getjars --build-only ant-core):${JAVACUP}"
+}
+
+jflex_compile() {
+ java "${@}" jflex.Main -d ${JAVA_SRC_DIR}/${PN} --skel src/main/${PN}/skeleton.nested src/main/${PN}/LexScan.flex || die
+ java-pkg-simple_src_compile
+ java-pkg_addres ${PN}.jar src/main/resources
+}
+
+src_compile() {
+ java -jar "${JAVACUP}" -destdir ${JAVA_SRC_DIR}/${PN} -package ${PN} -parser LexParse -interface src/main/cup/LexParse.cup || die
+
+ # The IcedTea ARM HotSpot port (as of 2.6.1) hangs when running
+ # jflex. We have patched jflex to fix it but we have to run the
+ # bundled version first. -Xint works around the problem. See
+ # http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2678.
+ use arm && local JFLEX_ARGS="-Xint"
+
+ # First compile (without doc/source) using the bundled jflex.
+ JAVA_PKG_IUSE= jflex_compile -cp "lib/${P}.jar:${JAVACUP}" ${JFLEX_ARGS}
+
+ # Then recompile using the fresh jflex.
+ jflex_compile -cp "${PN}.jar:${JAVACUP}"
+}
+
+src_install() {
+ java-pkg-simple_src_install
+ java-pkg_dolauncher ${PN} --main ${PN}.Main
+
+ java-pkg_register-dependency javacup javacup-runtime.jar
+ java-pkg_register-ant-task
+
+ use examples && java-pkg_doexamples examples
+ dodoc {changelog,README}.md
+
+ if use doc; then
+ dodoc doc/*.pdf
+ docinto html
+ dodoc doc/*.{css,html,png} doc/COPYRIGHT
+ fi
+
+ if use vim-syntax; then
+ insinto /usr/share/vim/vimfiles/syntax
+ doins lib/${PN}.vim
+ fi
+}
+
+src_test() {
+ if use arm && java-pkg_current-vm-matches oracle-jdk-bin-1.8; then
+ # This results in a StackOverflowError as of 1.8.0.65 but works
+ # fine on icedtea:7. Don't know about icedtea:8 yet.
+ rm -v src/test/java/jflex/EmitterTest.java || die
+ fi
+
+ local CP="src/test/java:${PN}.jar:${JAVA_GENTOO_CLASSPATH_EXTRA}:$(java-pkg_getjars junit-4)"
+
+ local TESTS=$(find src/test/java -name "*Test*.java" -printf "%P\n")
+ TESTS="${TESTS//.java}"
+ TESTS="${TESTS//\//.}"
+
+ ejavac -classpath "${CP}" $(find src/test/java -name "*.java")
+ ejunit4 -classpath "${CP}" ${TESTS}
+}
diff --git a/dev-java/jflex/metadata.xml b/dev-java/jflex/metadata.xml
new file mode 100644
index 000000000000..ac2a2c1b2b7b
--- /dev/null
+++ b/dev-java/jflex/metadata.xml
@@ -0,0 +1,12 @@
+<?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>
+<longdescription lang="en">
+JFlex is a lexical analyzer generator (also known as scanner generator) for
+Java(tm).
+</longdescription>
+</pkgmetadata>