diff options
Diffstat (limited to 'dev-java')
| -rw-r--r-- | dev-java/qdox/files/qdox-1.12.1-jflex-1.9.1.patch | 91 | ||||
| -rw-r--r-- | dev-java/qdox/qdox-1.12.1-r8.ebuild | 105 |
2 files changed, 196 insertions, 0 deletions
diff --git a/dev-java/qdox/files/qdox-1.12.1-jflex-1.9.1.patch b/dev-java/qdox/files/qdox-1.12.1-jflex-1.9.1.patch new file mode 100644 index 000000000000..2deb0dc13275 --- /dev/null +++ b/dev-java/qdox/files/qdox-1.12.1-jflex-1.9.1.patch @@ -0,0 +1,91 @@ + +warning: [options] bootstrap class path not set in conjunction with -source 8 +./src/java/com/thoughtworks/qdox/parser/impl/JFlexLexer.java:1010: error: variable yyline is already defined in class JFlexLexer + private int yyline; + ^ +./src/java/com/thoughtworks/qdox/parser/impl/JFlexLexer.java:1013: error: variable yycolumn is already defined in class JFlexLexer + private int yycolumn; + ^ +./src/java/com/thoughtworks/qdox/parser/impl/JFlexLexer.java:1017: error: variable yychar is already defined in class JFlexLexer + private long yychar; + ^ +./src/java/com/thoughtworks/qdox/parser/impl/JFlexLexer.java:1021: error: variable zzAtBOL is already defined in class JFlexLexer + private boolean zzAtBOL = true; + ^ +./src/java/com/thoughtworks/qdox/parser/impl/JFlexLexer.java:1024: error: variable zzEOFDone is already defined in class JFlexLexer + private boolean zzEOFDone; + ^ +./src/java/com/thoughtworks/qdox/parser/impl/JFlexLexer.java:1408: error: cannot find symbol + char [] zzCMapL = ZZ_CMAP; + ^ + symbol: variable ZZ_CMAP + location: class JFlexLexer +Note: Some input files use or override a deprecated API. +Note: Recompile with -Xlint:deprecation for details. +Note: Some input files use unchecked or unsafe operations. +Note: Recompile with -Xlint:unchecked for details. +6 errors + +--- a/src/grammar/skeleton.inner ++++ b/src/grammar/skeleton.inner +@@ -52,29 +52,9 @@ + from input */ + private int zzEndRead; + +- /** number of newlines encountered up to the start of the matched text */ +- private int yyline; +- +- /** the number of characters up to the start of the matched text */ +- private int yychar; +- +- /** +- * the number of characters from the last newline up to the start of the +- * matched text +- */ +- private int yycolumn; +- +- /** +- * zzAtBOL == true <=> the scanner is currently at the beginning of a line +- */ +- private boolean zzAtBOL = true; +- + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; + +- /** denotes if the user-EOF-code has already been executed */ +- private boolean zzEOFDone; +- + /** the stack of open (nested) input streams to read from */ + private java.util.Stack zzStreams = new java.util.Stack(); + +@@ -382,7 +362,6 @@ + int zzMarkedPosL = zzMarkedPos; + int zzEndReadL = zzEndRead; + char [] zzBufferL = zzBuffer; +- char [] zzCMapL = ZZ_CMAP; + + --- start admin (line, char, col count) + zzAction = -1; +@@ -407,15 +386,15 @@ + zzMarkedPos = zzMarkedPosL; + --- char count update + +---- actions +- default: +- if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { +- zzAtEOF = true; ++ if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { ++ zzAtEOF = true; + --- eofvalue +- } +- else { ++ } ++ else { ++--- actions ++ default: + --- no match +- } ++ } + } + } + } diff --git a/dev-java/qdox/qdox-1.12.1-r8.ebuild b/dev-java/qdox/qdox-1.12.1-r8.ebuild new file mode 100644 index 000000000000..bcdc288d2b7e --- /dev/null +++ b/dev-java/qdox/qdox-1.12.1-r8.ebuild @@ -0,0 +1,105 @@ +# Copyright 1999-2025 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" +S="${WORKDIR}/${PN}-${P}" + +LICENSE="Apache-2.0" +SLOT="1.12" +KEYWORDS="~amd64 ~ppc-macos ~x64-macos" +IUSE="ant-task" +REQUIRED_USE="test? ( ant-task )" + +DEPEND=" + >=virtual/jdk-1.8:* + dev-java/byaccj:0 + >=dev-java/javacup-11b_p20160615-r2:0 + >=dev-java/jflex-1.9.1:0 + dev-java/jmock:1.0 + ant-task? ( >=dev-java/ant-1.10.15:0 ) + test? ( dev-java/junit:0 ) +" + +RDEPEND=" + >=virtual/jre-1.8:* + ant-task? ( >=dev-java/ant-1.10.15:0 ) +" + +PATCHES=( "${FILESDIR}/qdox-1.12.1-jflex-1.9.1.patch" ) + +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() { + "$(java-config -J)" -cp "$(java-pkg_getjars --build-only jflex):$(java-pkg_getjars --build-only javacup)" jflex.Main \ + src/grammar/lexer.flex \ + --skel src/grammar/skeleton.inner \ + -d src/java/com/thoughtworks/qdox/parser/impl/ || die + + 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 +} |
