summaryrefslogtreecommitdiff
path: root/dev-java/jflex
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-05-26 00:07:28 +0100
committerV3n3RiX <venerix@koprulu.sector>2024-05-26 00:07:28 +0100
commit994fe442814c4d169bb0f1ee9745604928006b39 (patch)
tree630f10f7414f44018095dd9d3cf9df55852a9d41 /dev-java/jflex
parentf8999218b5a6eafa151e7367030cbfdb69e045ed (diff)
gentoo auto-resync : 26:05:2024 - 00:07:27
Diffstat (limited to 'dev-java/jflex')
-rw-r--r--dev-java/jflex/Manifest3
-rw-r--r--dev-java/jflex/jflex-1.6.1-r3.ebuild135
-rw-r--r--dev-java/jflex/metadata.xml11
3 files changed, 144 insertions, 5 deletions
diff --git a/dev-java/jflex/Manifest b/dev-java/jflex/Manifest
index 1b04d71e92b7..8a944e4e5a9e 100644
--- a/dev-java/jflex/Manifest
+++ b/dev-java/jflex/Manifest
@@ -1,4 +1,5 @@
AUX icedtea-arm.patch 710 BLAKE2B dc479f8db4f1188ecb63708700d1ef0905590aba6b552b573c9fc05027e195d2dc1143542ca1998a5a6feac53af4ef64326da3f746f8aff1149b0bb01a3793a9 SHA512 9ebf22f2771672bb9ef28fcb7eff0d907e9fe4466b18b3ec3915b27caa2edb07934a47311abf41fbe124b484cccbb19ca68f69acd5bd76e46a49b029dbf275b6
DIST jflex-1.6.1.tar.gz 3027791 BLAKE2B 4262f75c16a847314db8cb175901658ff6b424469e66523b41564179fa30f0e64bcf2d7ad0e06ad918336e5a41e166a74d55f19f7451662d19fbcaa29f716dce SHA512 436840c90d906042205d27e1d3c56dec724bf62cc3d8c8d3445f217af0a50c9ca2bb56ed91f0cd3c37a930f7ca22f4cc50e8c28dbe905f02adf695c8e96fb07b
EBUILD jflex-1.6.1-r2.ebuild 3520 BLAKE2B c49021cefb11baa37387d5582b2bd54dfe26730990ea7bd6ef42c5bd2840fca430121e650648769241afb7b9796ec2c8a6b5ac12792cd3e00bdc08b7badfb17b SHA512 0f65b28f18e0d7c1985be060070754e78d3f7e7ba9972b3f43b41e035e9d1035a00dbd1cb9913f397fc360c57dd7ab910a50c179cf213d796d319c5623697063
-MISC metadata.xml 233 BLAKE2B 2b385ca77219f08b2874b3a4a91a0c836d3cb45ec44b05babb33d590c56ceb5337ecb93a8450a37f8e6bbf4cfc1455892e8142d22e0a1d527d40361e2dce350b SHA512 1acc975a7dc3344bc63282d652ca00d8245970b58353b4fd00f09a4859db3eaba2dcd85e1537d424b7174e4f9c01c2ffb10ec6d107b5c895c9ca20730666de7f
+EBUILD jflex-1.6.1-r3.ebuild 3777 BLAKE2B 1eb75b30263d99cb166ad045b408fb0b551a0f5610aa4fbb680d6ba9425622e9a27f670a223e8017bc097cee4aa3f6eb0ef8e2d969cba7fae3ee484b9d383366 SHA512 870704d70459beb6e3d60090ef236e31199b08b69422ab9ffbe2514ecdc75097ae3908aaa5ede414cd7e9d696de6952660cbbe51600603bb6dcb99d86d57f898
+MISC metadata.xml 315 BLAKE2B 65fc9f2224c07e76fa9a4b49456ec62d7b38c5d50523ecfdfa5e77241c88e1c1da8ea6947cf3fe4b0819373a712b5dd4654ed713eb67ce3e102fc64e343ee17d SHA512 7c1ef38b4952ed807c1d98dbc05635010557a440ab98a58960f590abb2589e7632df16d0a551bfcf3efe32c57c0a498492ea877a52e43c3126c3290595b7f614
diff --git a/dev-java/jflex/jflex-1.6.1-r3.ebuild b/dev-java/jflex/jflex-1.6.1-r3.ebuild
new file mode 100644
index 000000000000..ae329e176675
--- /dev/null
+++ b/dev-java/jflex/jflex-1.6.1-r3.ebuild
@@ -0,0 +1,135 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+JAVA_PKG_IUSE="doc source"
+
+inherit java-pkg-2 java-pkg-simple
+
+DESCRIPTION="JFlex is a lexical analyzer generator for Java"
+HOMEPAGE="https://www.jflex.de/"
+SRC_URI="https://${PN}.de/${P}.tar.gz"
+S="${WORKDIR}/${P}"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86 ~ppc-macos ~x64-macos"
+IUSE="ant-task examples test vim-syntax"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="test? ( ant-task )"
+
+RDEPEND="
+ >=virtual/jre-1.8:*
+ ant-task? ( >=dev-java/ant-1.10.14-r3:0 )
+ vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )
+"
+
+DEPEND="
+ >=virtual/jdk-1.8:*
+ ant-task? ( >=dev-java/ant-1.10.14-r3:0 )
+ test? ( dev-java/junit:4 )
+"
+
+PDEPEND=">=dev-java/javacup-11b_p20160615:0"
+
+JAVA_SRC_DIR="src/main/java"
+
+src_prepare() {
+ eapply_user
+ java-pkg-2_src_prepare
+
+ # See below for details.
+ eapply "${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="${JAVACUP}"
+ if use ant-task; then
+ JAVA_GENTOO_CLASSPATH_EXTRA+=":$(java-pkg_getjar --build-only ant ant.jar)"
+ else
+ rm src/main/java/jflex/anttask/JFlexTask.java || die
+ fi
+}
+
+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 using the bundled jflex.
+ 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
+ use ant-task && 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
index 6021501589e0..3c0e0377e098 100644
--- a/dev-java/jflex/metadata.xml
+++ b/dev-java/jflex/metadata.xml
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
-<maintainer type="project">
- <email>java@gentoo.org</email>
- <name>Java</name>
-</maintainer>
+ <maintainer type="project">
+ <email>java@gentoo.org</email>
+ <name>Java</name>
+ </maintainer>
+ <use>
+ <flag name="ant-task">Build and register the ant-task</flag>
+ </use>
</pkgmetadata>