summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolkmar W. Pogatzki <gentoo@pogatzki.net>2023-09-12 15:54:27 +0200
committerMiroslav Šulc <fordfrog@gentoo.org>2024-05-25 11:21:24 +0200
commit4779f92b3f235075a4e876b88a32e1d7f314eabc (patch)
tree794ca50eed83e917264865764ecd6478403b531e /dev-java/javacup
parentdev-ruby/elasticsearch-transport: drop 7.17.7 (diff)
downloadgentoo-4779f92b3f235075a4e876b88a32e1d7f314eabc.tar.gz
gentoo-4779f92b3f235075a4e876b88a32e1d7f314eabc.tar.bz2
gentoo-4779f92b3f235075a4e876b88a32e1d7f314eabc.zip
dev-java/javacup: add 11b_p20160615
Closes: https://bugs.gentoo.org/588824 Signed-off-by: Volkmar W. Pogatzki <gentoo@pogatzki.net> Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
Diffstat (limited to 'dev-java/javacup')
-rw-r--r--dev-java/javacup/Manifest1
-rw-r--r--dev-java/javacup/javacup-11b_p20160615.ebuild92
-rw-r--r--dev-java/javacup/metadata.xml3
3 files changed, 96 insertions, 0 deletions
diff --git a/dev-java/javacup/Manifest b/dev-java/javacup/Manifest
index e86cdb7e2e96..5bb555f43821 100644
--- a/dev-java/javacup/Manifest
+++ b/dev-java/javacup/Manifest
@@ -1 +1,2 @@
DIST java-cup-src-11b-20151001.tar.gz 313405 BLAKE2B 126944916d120dd2150e4a665fea6d216f3d55e002a72b581621df726e4bf0e0664f9ff925189c97162582277c08a4f121e056299ea5a3f5c10cc31d7c0feb9c SHA512 70bb6a0e13fe52694980040205fcf5b3e904c4a07e50c7740c55cc3bb481496c5c071377757b94f59807b936b8c4fdde5423d78cc2d12a7ada1870f71cd9f47e
+DIST java-cup-src-11b-20160615.tar.gz 313847 BLAKE2B 0031cdb73471512162f69fff6ed47e91d78769c5162f37d4fdcef1c4b4be17ec9e950eda973a8842ae95423840be6c43a335180584b81c4618ea43cbfa926972 SHA512 532a8169f8e1ed2c637c66e7e21cc90eea363732870fbf4e3d66acbff03de3ba0583cefb7b4e7b8f8cb0c9bf1ca92dd5a59111860612bc7544e8beab87f5fbda
diff --git a/dev-java/javacup/javacup-11b_p20160615.ebuild b/dev-java/javacup/javacup-11b_p20160615.ebuild
new file mode 100644
index 000000000000..a66896a46441
--- /dev/null
+++ b/dev-java/javacup/javacup-11b_p20160615.ebuild
@@ -0,0 +1,92 @@
+# 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="CUP Parser Generator for Java"
+HOMEPAGE="https://www2.cs.tum.edu/projects/cup/"
+SRC_URI="https://www2.cs.tum.edu/projects/cup/releases/java-cup-src-${PV/_p/-}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
+IUSE="ant-task"
+
+DEPEND="${CP_DEPEND}
+ >=dev-java/jflex-1.6.1-r3:0
+ >=virtual/jdk-1.8:*
+ ant-task? ( >=dev-java/ant-1.10.14-r3:0 )"
+RDEPEND="${CP_DEPEND}
+ >=virtual/jre-1.8:*
+ ant-task? ( >=dev-java/ant-1.10.14-r3:0 )"
+
+DOCS=( changelog.txt )
+HTML_DOCS=( manual.html )
+
+JAVA_MAIN_CLASS="java_cup/Main"
+JAVA_SRC_DIR=( "src" "java" )
+
+src_prepare() {
+ java-pkg-2_src_prepare
+ if use ant-task; then
+ JAVA_GENTOO_CLASSPATH+="ant"
+ else
+ rm src/java_cup/anttask/CUPTask.java || die
+ fi
+}
+
+src_compile() {
+ if has_version \>=${CATEGORY}/${PN}-11b:${SLOT}; then
+ einfo "Get path of installed JAVACUP"
+ CP_CUP="$(java-pkg_getjar --build-only javacup javacup.jar)"
+ else
+ einfo "Get path of bundled JAVACUP"
+ CP_CUP="$(echo bin/java-cup-*.jar)"
+ fi
+ einfo "Path to JAVACUP is ${CP_CUP}"
+
+ einfo "Get path to jflex"
+ CP_FLEX="$(java-pkg_getjars --build-only jflex)"
+ einfo "Path to jflex is ${CP_FLEX}"
+
+ einfo "Generate parser with: ${CP_CUP}"
+ "$(java-config -J)" -jar "${CP_CUP}" \
+ -interface -destdir "java" -parser "parser" -symbols "sym" \
+ cup/parser.cup || die
+
+ einfo "Generate lexer"
+ # https://jflex.de/manual.html#running-jflex
+ $(java-config -J) -cp "${CP_CUP}:${CP_FLEX}" jflex.Main \
+ flex/Lexer.jflex -d java/javacup || die
+
+ einfo "Build intermediate jar"
+ JAVA_JAR_FILENAME="seco.jar"
+ java-pkg-simple_src_compile
+
+ einfo "Remove classes and generated code"
+ rm -rv java/* target/classes/ || die
+
+ einfo "Regenerate parser with intermediate jar file"
+ "$(java-config -J)" -jar ./seco.jar \
+ -interface -destdir "java" -parser "parser" -symbols "sym" \
+ cup/parser.cup || die
+
+ einfo "Regenerate lexer with intermediate jar file"
+ $(java-config -J) -cp "$(echo ./seco.jar):${CP_FLEX}" jflex.Main \
+ flex/Lexer.jflex -d java/javacup || die
+
+ einfo "Build final jar with regenerated parser and lexer"
+ JAVA_JAR_FILENAME="${PN}.jar"
+ java-pkg-simple_src_compile
+ "$(java-config --jar)" cvf "${PN}-runtime.jar" -C target/classes java_cup/runtime || die
+}
+
+src_install() {
+ java-pkg-simple_src_install
+ java-pkg_dojar "${PN}.jar" "${PN}-runtime.jar"
+ use ant-task && java-pkg_register-ant-task
+}
diff --git a/dev-java/javacup/metadata.xml b/dev-java/javacup/metadata.xml
index afa5d3dcd5d1..565315fe27ec 100644
--- a/dev-java/javacup/metadata.xml
+++ b/dev-java/javacup/metadata.xml
@@ -8,4 +8,7 @@
<upstream>
<remote-id type="github">ultimate-pa/javacup</remote-id>
</upstream>
+ <use>
+ <flag name="ant-task">Build and register the ant-task</flag>
+ </use>
</pkgmetadata>