diff options
author | Volkmar W. Pogatzki <gentoo@pogatzki.net> | 2024-08-22 16:12:49 +0200 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2024-08-30 14:05:15 +0300 |
commit | 298330291285a9c1a536ba983612883b62eb39ea (patch) | |
tree | 46b71d7d02fe56f81b57812fc52cddc31122b4ba /dev-java | |
parent | dev-java/xalan: for x86 use precompiled java-cup (diff) | |
download | gentoo-298330291285a9c1a536ba983612883b62eb39ea.tar.gz gentoo-298330291285a9c1a536ba983612883b62eb39ea.tar.bz2 gentoo-298330291285a9c1a536ba983612883b62eb39ea.zip |
dev-java/qdox: for x86 use precompiled jflex
Signed-off-by: Volkmar W. Pogatzki <gentoo@pogatzki.net>
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'dev-java')
-rw-r--r-- | dev-java/qdox/Manifest | 1 | ||||
-rw-r--r-- | dev-java/qdox/qdox-1.12.1-r6.ebuild | 114 |
2 files changed, 115 insertions, 0 deletions
diff --git a/dev-java/qdox/Manifest b/dev-java/qdox/Manifest index 85413229dd93..b9d0d34f0f66 100644 --- a/dev-java/qdox/Manifest +++ b/dev-java/qdox/Manifest @@ -1,2 +1,3 @@ +DIST jflex-1.6.1.jar 1050749 BLAKE2B 71c68bf368a239217cbf928a7c6fbf7325cc069beddfaf92fbad3f0542bf83aa5606b2e15cfb4bdbd62a54c53d8439773ba3a7f60370ef5e2501ffe2561f9945 SHA512 882e73231b6e4f12e746282bac894e79dd3ee6fcfd0317a988709f3a3b472634415031209aa96c200c65ce382c90b5dff3f6d31d5e39c2feaff90dcf30a142f4 DIST qdox-1.12.1.tar.gz 519833 BLAKE2B 83a732f1582b714cf943ede61bacc5216804c00cfbb642a479afb74739564f4fdbcd923dd7cb84a9626a97c5ad0a0f04895e0ae68252891cb25299e1fe1c9c72 SHA512 17ac933854ebd0560921805ea4339c151a7fd095bf8d50d5d71e656afda77ba30efac7926cfcc7543e4a8420b12d1eb75cdd305c50d1c28ad8cd6b0f4d95f5c5 DIST qdox-2.0.1.tar.gz 528305 BLAKE2B ff2f4b59d650b93a466eae6cc69239b059f7786ea609c18c56414e7e849d711d5316664a376b2c2c6e0021a21e7577cc21c9f5cfd215c4af612100a4c81da758 SHA512 db9d9ed8e8cf38c74e35be493aebcca54ba9d2c43a92c066d1964777293ad3af8e3212fcb8c20e9453b93e9bbe868c988dab69f936e7df41450183ce385137fa diff --git a/dev-java/qdox/qdox-1.12.1-r6.ebuild b/dev-java/qdox/qdox-1.12.1-r6.ebuild new file mode 100644 index 000000000000..a06037118b89 --- /dev/null +++ b/dev-java/qdox/qdox-1.12.1-r6.ebuild @@ -0,0 +1,114 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +JAVA_PKG_IUSE="doc source test" +MAVEN_ID="com.thoughtworks.qdox:qdox:1.12.1" + +inherit java-pkg-2 + +DESCRIPTION="Parser for extracting class/interface/method definitions" +HOMEPAGE="https://github.com/codehaus/qdox" +SRC_URI="https://github.com/codehaus/qdox/archive/${P}.tar.gz + x86? ( https://repo1.maven.org/maven2/de/jflex/jflex/1.6.1/jflex-1.6.1.jar )" +S="${WORKDIR}/${PN}-${PN}-${PV}" + +LICENSE="Apache-2.0" +SLOT="1.12" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86 ~ppc-macos ~x64-macos" +IUSE="ant-task" +REQUIRED_USE="test? ( ant-task )" + +DEPEND=" + >=virtual/jdk-1.8:* + dev-java/byaccj:0 + dev-java/jmock:1.0 + !x86? ( dev-java/jflex:0 ) + ant-task? ( >=dev-java/ant-1.10.14-r3:0 ) + test? ( dev-java/junit:0 ) +" + +RDEPEND=" + >=virtual/jre-1.8:* + ant-task? ( >=dev-java/ant-1.10.14-r3:0 ) +" + +PATCHES=( + "${FILESDIR}/jflex-1.6.1.patch" +) + +src_unpack() { + unpack "${P}.tar.gz" + use x86 && cp "${DISTDIR}/jflex-1.6.1.jar" "${WORKDIR}" +} + +src_prepare() { + default #780585 + java-pkg-2_src_prepare + + if ! use test ; then + rm src/java/com/thoughtworks/qdox/tools/QDoxTester.java + rm -rf src/java/com/thoughtworks/qdox/junit + rm -rf src/test + fi +} + +src_compile() { + # https://bugs.gentoo.org/778416 - for x86 we provide the precompiled jflex + if use x86; then + "$(java-config -J)" -cp "${WORKDIR}/jflex-1.6.1.jar" jflex.Main \ + src/grammar/lexer.flex --skel src/grammar/skeleton.inner -d src/java/com/thoughtworks/qdox/parser/impl/ || die + else + jflex \ + src/grammar/lexer.flex --skel src/grammar/skeleton.inner -d src/java/com/thoughtworks/qdox/parser/impl/ || die + fi + byaccj -v -Jnorun \ + -Jnoconstruct \ + -Jclass=Parser \ + -Jsemantic=Value \ + -Jpackage=com.thoughtworks.qdox.parser.impl \ + src/grammar/parser.y || die + mv Parser.java src/java/com/thoughtworks/qdox/parser/impl/ || die + + # create jar + mkdir -p build/classes || die + + local cp="$(java-pkg_getjars --build-only jmock-1.0)" + + if use test ; then + cp="${cp}:$(java-pkg_getjars --build-only junit)" + fi + + if use ant-task ; then + cp="${cp}:$(java-pkg_getjars --build-only ant)" + else + rm src/java/com/thoughtworks/qdox/ant/AbstractQdoxTask.java || die + fi + + ejavac -sourcepath . -d build/classes -classpath "${cp}" \ + $(find . -name "*.java") || die "Cannot compile sources" + + mkdir dist || die + cd build/classes || die + jar -cvf "${S}"/dist/${PN}.jar com || die "Cannot create JAR" + + # generate javadoc + if use doc ; then + cd "${S}" + mkdir javadoc || die + javadoc -d javadoc -sourcepath src/java -subpackages com -classpath "${cp}" + fi +} + +src_test() { + java -cp "${S}"/dist/${PN}.jar:$(java-pkg_getjars --build-only ant,junit,jmock-1.0) \ + com.thoughtworks.qdox.tools.QDoxTester src || die "Tests failed!" +} + +src_install() { + java-pkg_dojar dist/${PN}.jar + + use source && java-pkg_dosrc src/java/com + use doc && java-pkg_dojavadoc javadoc +} |