summaryrefslogtreecommitdiff
path: root/app-text/trang
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-06-15 00:09:17 +0100
committerV3n3RiX <venerix@koprulu.sector>2024-06-15 00:09:17 +0100
commit6a7029e0f7370d4d5dfe9e31cc2719a870482392 (patch)
tree28c6c747114eaedfd2db81f86ac2ff3d7d13111e /app-text/trang
parent5e41a38157bb40e8513e8e34426e85faba672fe7 (diff)
gentoo auto-resync : 15:06:2024 - 00:09:17
Diffstat (limited to 'app-text/trang')
-rw-r--r--app-text/trang/Manifest3
-rw-r--r--app-text/trang/files/trang-20220510-CompactSyntaxTokenManager.patch130
-rw-r--r--app-text/trang/trang-20220510.ebuild115
3 files changed, 248 insertions, 0 deletions
diff --git a/app-text/trang/Manifest b/app-text/trang/Manifest
index 0354d325b9cc..01da655ab81a 100644
--- a/app-text/trang/Manifest
+++ b/app-text/trang/Manifest
@@ -1,6 +1,9 @@
AUX test.xml 3053 BLAKE2B f9837b05c4ac00fa63ce75f04318f3378c2cc0c99680c21520d7d75a74e0e9ad00a9fcdf4857655ac32a3eea935208dc86e51d2bbef3e2349cd78d65ed74ac30 SHA512 11b4faef6fce89d72e8cdcc25cc1dc6c89ea7bc44252e0521a9a5ff47f686e78c46eac6b606e47f51b0bdb8175e583d5c1c56bdcb8bea105c70a63b65f20ea67
AUX trang-20181222-build-fixes.patch 968 BLAKE2B 5f84f3388133b126c711024750f85aff03cd76027ebd526e3eec4b4a605c4e3515662e2d2b1abcf3df08e88176a248442478d1350946e3b3150e00ab928a85db SHA512 ac8bf8e5f8f71f9271a9adba732112b39c379946298b859ab7504e4f861274670666f4a2e0337712a607049f34dbc206962fe2ff8883b8a8a7c5e09037f67062
AUX trang-20181222-unicode-data-path.patch 627 BLAKE2B 78ed1c0ad5cf4327311ba9a65113bbc38554444625fa1da1ac90586e7cc4b87722458b483219c9c6a1132ffff3076a8d4dec120de772b4191ebf7db8cdc33224 SHA512 51909cfdac55204197478e7484794cd6d4a0892baa94d0a98e46bf1e227b7e21ac544451ff1fe9c4a4fb67fe3dc2b557d98471abc5ba130a92da973aebe41495
+AUX trang-20220510-CompactSyntaxTokenManager.patch 5081 BLAKE2B 81533757c5c0088dc79554f2a11ca4a501a30c023693ed36a1547c442518424097d90ba1de6a130a1c1851af2dca194ea7a1804d04ad8fbc7c3c33ca48bace90 SHA512 74dc0bee59e5b2307c6d05029ffa1f0379359fd99017788f7f1aa328059a0296d0b365d8d79b30a206f0f6f4d21f283b4547a084f485c48975b4307a2a8369ec
DIST trang-20181222.tar.gz 14847113 BLAKE2B 335722853b2d373fd9a6e9d4478b8248ca49d0559d5a8f60566f5550e60d5a004f26338897617acc617f84d1d55546afb9c51da64b7634514fa2ec508fa7a47a SHA512 fa412a5beeff07a620c4aa5723cf5b73bdb6b1cda561e3bf7764a609110f538da5313bcc79aca4d7742f71b3b071d3537681845d17ece46bc871c0964f4e251d
+DIST trang-20220510.tar.gz 14317698 BLAKE2B b7337e9555094989955e33f711db9981521c31a3708dd6a862f36cecae0496d8c86fdf09b2d60b8646d8e35e214f57ba7bcd49773fe002eef26ed6b81b4101c1 SHA512 51c44817b396ec45bb82987e0aee8e8d2e5f3f6a1e2f967bae717a31b1bd49c5fc7015466104b19ac62de6ee0270c018dcf19b467763ad1aaa92800bd4edd7a0
EBUILD trang-20181222.ebuild 2222 BLAKE2B beab45edaad346bdf72e21de7e9b14b8a4e6ac792cbea7d01579709443078be1b8231bdf9c47759b5253e32cc2ae3442370280411fe2994488db08e8a377ed11 SHA512 76e9d9de00d100cde4e6641772fe1ab6a591646907752ad4e015b369108799cdcb453910e387c8a3fa35ac64b5e7189e31b0296dc8d5668c11a31ca5b76c271b
+EBUILD trang-20220510.ebuild 3888 BLAKE2B 7e0cfcee6b49bb8b20e8ba6c7ace218064011c413d1127ea7e84690f0fd0ebd1249ef6a26ec5b80d1727bd973932df7a434bb81b08b07136cb68fefb4bd9c732 SHA512 73253d3c9fc6f5de837ead6a39abc5e18572bb100cb08154f63e72d8beff93be341909d44cebf9887f265819830b043169c8957e8fd25e7330dd32315edfff14
MISC metadata.xml 320 BLAKE2B dbc3c73e63a4eba52a905b023fd13c905a367c50b84f2114f1bee024f6e7787dfb02627aa30c83e17ffd90d763f9a977ad912a4429fe63a957120b7fd63ff34b SHA512 cd56de97d8e9b4439babc24fe21cc1b25f367598de0c4fc819ed24b17bfab70167495b00a065662f79b4315008fb65823dff6e6605d8939f697332f2a01eec36
diff --git a/app-text/trang/files/trang-20220510-CompactSyntaxTokenManager.patch b/app-text/trang/files/trang-20220510-CompactSyntaxTokenManager.patch
new file mode 100644
index 000000000000..ef633528e5fc
--- /dev/null
+++ b/app-text/trang/files/trang-20220510-CompactSyntaxTokenManager.patch
@@ -0,0 +1,130 @@
+# mod/rng-parse/mod.xml lines 16-17 - 's/java.io.IOException/EOFException/'
+
+--- a/gensrc/main/com/thaiopensource/relaxng/parse/compact/CompactSyntaxTokenManager.java
++++ b/gensrc/main/com/thaiopensource/relaxng/parse/compact/CompactSyntaxTokenManager.java
+@@ -219,7 +219,7 @@ private int jjMoveStringLiteralDfa0_0(){
+ }
+ private int jjMoveStringLiteralDfa1_0(long active0){
+ try { curChar = input_stream.readChar(); }
+- catch(java.io.IOException e) {
++ catch(EOFException e) {
+ jjStopStringLiteralDfa_0(0, active0);
+ return 1;
+ }
+@@ -264,7 +264,7 @@ private int jjMoveStringLiteralDfa2_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(0, old0);
+ try { curChar = input_stream.readChar(); }
+- catch(java.io.IOException e) {
++ catch(EOFException e) {
+ jjStopStringLiteralDfa_0(1, active0);
+ return 2;
+ }
+@@ -307,7 +307,7 @@ private int jjMoveStringLiteralDfa3_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(1, old0);
+ try { curChar = input_stream.readChar(); }
+- catch(java.io.IOException e) {
++ catch(EOFException e) {
+ jjStopStringLiteralDfa_0(2, active0);
+ return 3;
+ }
+@@ -342,7 +342,7 @@ private int jjMoveStringLiteralDfa4_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(2, old0);
+ try { curChar = input_stream.readChar(); }
+- catch(java.io.IOException e) {
++ catch(EOFException e) {
+ jjStopStringLiteralDfa_0(3, active0);
+ return 4;
+ }
+@@ -387,7 +387,7 @@ private int jjMoveStringLiteralDfa5_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(3, old0);
+ try { curChar = input_stream.readChar(); }
+- catch(java.io.IOException e) {
++ catch(EOFException e) {
+ jjStopStringLiteralDfa_0(4, active0);
+ return 5;
+ }
+@@ -426,7 +426,7 @@ private int jjMoveStringLiteralDfa6_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(4, old0);
+ try { curChar = input_stream.readChar(); }
+- catch(java.io.IOException e) {
++ catch(EOFException e) {
+ jjStopStringLiteralDfa_0(5, active0);
+ return 6;
+ }
+@@ -465,7 +465,7 @@ private int jjMoveStringLiteralDfa7_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(5, old0);
+ try { curChar = input_stream.readChar(); }
+- catch(java.io.IOException e) {
++ catch(EOFException e) {
+ jjStopStringLiteralDfa_0(6, active0);
+ return 7;
+ }
+@@ -492,7 +492,7 @@ private int jjMoveStringLiteralDfa8_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(6, old0);
+ try { curChar = input_stream.readChar(); }
+- catch(java.io.IOException e) {
++ catch(EOFException e) {
+ jjStopStringLiteralDfa_0(7, active0);
+ return 8;
+ }
+@@ -517,7 +517,7 @@ private int jjMoveStringLiteralDfa9_0(long old0, long active0){
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(7, old0);
+ try { curChar = input_stream.readChar(); }
+- catch(java.io.IOException e) {
++ catch(EOFException e) {
+ jjStopStringLiteralDfa_0(8, active0);
+ return 9;
+ }
+@@ -537,7 +537,7 @@ private int jjStartNfaWithStates_0(int pos, int kind, int state)
+ jjmatchedKind = kind;
+ jjmatchedPos = pos;
+ try { curChar = input_stream.readChar(); }
+- catch(java.io.IOException e) { return pos + 1; }
++ catch(EOFException e) { return pos + 1; }
+ return jjMoveNfa_0(state, pos + 1);
+ }
+ static final long[] jjbitVec0 = {
+@@ -1131,7 +1131,7 @@ private int jjMoveNfa_0(int startState, int curPos)
+ if ((i = jjnewStateCnt) == (startsAt = 43 - (jjnewStateCnt = startsAt)))
+ return curPos;
+ try { curChar = input_stream.readChar(); }
+- catch(java.io.IOException e) { return curPos; }
++ catch(EOFException e) { return curPos; }
+ }
+ }
+ private int jjMoveStringLiteralDfa0_1()
+@@ -1294,7 +1294,7 @@ private int jjMoveNfa_1(int startState, int curPos)
+ if ((i = jjnewStateCnt) == (startsAt = 10 - (jjnewStateCnt = startsAt)))
+ return curPos;
+ try { curChar = input_stream.readChar(); }
+- catch(java.io.IOException e) { return curPos; }
++ catch(EOFException e) { return curPos; }
+ }
+ }
+ private int jjMoveStringLiteralDfa0_2()
+@@ -1427,7 +1427,7 @@ private int jjMoveNfa_2(int startState, int curPos)
+ if ((i = jjnewStateCnt) == (startsAt = 7 - (jjnewStateCnt = startsAt)))
+ return curPos;
+ try { curChar = input_stream.readChar(); }
+- catch(java.io.IOException e) { return curPos; }
++ catch(EOFException e) { return curPos; }
+ }
+ }
+
+@@ -1686,7 +1686,7 @@ public Token getNextToken()
+ String error_after = null;
+ boolean EOFSeen = false;
+ try { input_stream.readChar(); input_stream.backup(1); }
+- catch (java.io.IOException e1) {
++ catch (EOFException e1) {
+ EOFSeen = true;
+ error_after = curPos <= 1 ? "" : input_stream.GetImage();
+ if (curChar == '\n' || curChar == '\r') {
diff --git a/app-text/trang/trang-20220510.ebuild b/app-text/trang/trang-20220510.ebuild
new file mode 100644
index 000000000000..9b9eb123a90c
--- /dev/null
+++ b/app-text/trang/trang-20220510.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+JAVA_PKG_IUSE="doc test"
+JAVA_TESTING_FRAMEWORKS="testng"
+
+inherit java-pkg-2 java-pkg-simple prefix
+
+DESCRIPTION="Multi-format schema converter based on RELAX NG"
+HOMEPAGE="http://thaiopensource.com/relaxng/trang.html"
+SRC_URI="https://github.com/relaxng/jing-trang/archive/V${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/jing-${P}"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+BDEPEND="
+ app-i18n/unicode-data
+ dev-java/saxon:9
+"
+CP_DEPEND="
+ dev-java/xerces:2
+ dev-java/xml-commons-resolver:0
+"
+RDEPEND="${CP_DEPEND}
+ >=virtual/jre-1.8:*"
+JAVACC_SLOT="7.0.13"
+DEPEND="${CP_DEPEND}
+ dev-java/javacc:${JAVACC_SLOT}
+ dev-java/testng:0
+ >=virtual/jdk-1.8:*"
+
+JAVA_TEST_RESOURCE_DIRS="src/test"
+JAVA_TEST_SRC_DIR="src/test"
+
+src_prepare() {
+ java-pkg-2_src_prepare
+ java-pkg_clean
+
+ eprefixify mod/regex/mod.xml # Do we still need this?
+
+ # separating some sources which are needed only for compilation
+ mkdir helper || die
+ cp -r mod/{catalog,datatype,jaxp,pattern,resolver,rng-parse}/src helper || die
+
+ # most of the mods are not needed for the final trang.jar
+ rm -r mod/{dtdinst,nvdl,picl,rng-jarv,rng-validate,schematron,validate,xerces} || die
+ rm -r mod/{jaxp,pattern,rng-jaxp} || die
+
+ # move all remainig stuff to "src/main" resp. "src/test"
+ mkdir -p resources src meta/META-INF/services || die
+ mv {mod/,}regex-gen || die # but not this one which is needed in two JAVA_SRC_DIRs
+ cp -r mod/*/src/{main,test} src || die
+
+ # populate META-INF/services
+ echo com.thaiopensource.datatype.xsd.DatatypeLibraryFactoryImpl \
+ > meta/META-INF/services/org.relaxng.datatype.DatatypeLibraryFactory || die
+ echo com.thaiopensource.datatype.xsd.regex.xerces2.RegexEngineImpl \
+ > meta/META-INF/services/com.thaiopensource.datatype.xsd.regex.RegexEngine || die
+
+ echo "version=${PV}" \
+ > src/main/com/thaiopensource/relaxng/translate/resources/Version.properties || die
+
+ # java-pkg-simple expects resources in JAVA_RESOURCE_DIRS
+ find src -type f ! -name '*.java' ! -name 'CompactSyntax.jj' ! -name 'package.html' \
+ | xargs cp --parent -t resources || die
+
+ # code generation according to mod/rng-parse/mod.xml
+ local OUT_DIR="gensrc/main/com/thaiopensource/relaxng/parse/compact"
+ mkdir -p "${OUT_DIR}"
+ "javacc-${JAVACC_SLOT}" -GRAMMAR_ENCODING=UTF-8 \
+ -JDK_VERSION=1.8 \
+ -OUTPUT_DIRECTORY="${OUT_DIR}" \
+ helper/src/main/com/thaiopensource/relaxng/parse/compact/CompactSyntax.jj \
+ || die "Code generation with java.jj failed"
+ rm "${OUT_DIR}/JavaCharStream.java" || die
+
+ # mod/rng-parse/mod.xml lines 16-17 - 's/java.io.IOException/EOFException/'
+ eapply "${FILESDIR}/trang-20220510-CompactSyntaxTokenManager.patch" || die
+}
+
+src_compile() {
+ einfo "Compiling some classes needed for code generation"
+ ejavac -d util \
+ $(find regex-gen/src/main mod/util/src/main -name "*.java") || die
+
+ einfo "Code generation"
+ "$(java-config -J)" -cp "util" \
+ com.thaiopensource.datatype.xsd.regex.java.gen.NamingExceptionsGen \
+ "com.thaiopensource.datatype.xsd.regex.java.NamingExceptions" \
+ "src/main" || die
+
+ "$(java-config -J)" -cp "util" \
+ com.thaiopensource.datatype.xsd.regex.java.gen.CategoriesGen \
+ "com.thaiopensource.datatype.xsd.regex.java.Categories" \
+ "src/main" \
+ "/usr/share/unicode-data/UnicodeData.txt" || die
+
+ einfo "Compiling classes which are not needed for the final trang.jar"
+ ejavac -d helper \
+ -cp "util:$(java-pkg_getjars --build-only xml-commons-resolver)" \
+ $(find gensrc/main helper/src/main -name "*.java") || die
+
+ einfo "Compiling trang.jar"
+ JAVA_CLASSPATH_EXTRA="testng"
+ JAVA_GENTOO_CLASSPATH_EXTRA="util:helper"
+ JAVA_JAR_FILENAME="trang.jar"
+ JAVA_MAIN_CLASS="com.thaiopensource.relaxng.translate.Driver"
+ JAVA_RESOURCE_DIRS=( meta resources/src/main )
+ JAVA_SRC_DIR=( {gen,}src/main )
+ java-pkg-simple_src_compile
+}