1 |
commit: 71aa218c86852f9b6b3891ae33bb93445053dc8d |
2 |
Author: Volkmar W. Pogatzki <gentoo <AT> pogatzki <DOT> net> |
3 |
AuthorDate: Sat Apr 17 20:23:16 2021 +0000 |
4 |
Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Apr 25 15:23:46 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=71aa218c |
7 |
|
8 |
dev-java/velocity: bump to 2.3 |
9 |
|
10 |
Bug: https://bugs.gentoo.org/775248 |
11 |
|
12 |
Package-Manager: Portage-3.0.17, Repoman-3.0.2 |
13 |
Signed-off-by: Volkmar W. Pogatzki <gentoo <AT> pogatzki.net> |
14 |
Closes: https://github.com/gentoo/gentoo/pull/20429 |
15 |
Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org> |
16 |
|
17 |
dev-java/velocity/Manifest | 1 + |
18 |
dev-java/velocity/velocity-2.3.ebuild | 144 ++++++++++++++++++++++++++++++++++ |
19 |
2 files changed, 145 insertions(+) |
20 |
|
21 |
diff --git a/dev-java/velocity/Manifest b/dev-java/velocity/Manifest |
22 |
index bca2b1c20c0..2728c27d189 100644 |
23 |
--- a/dev-java/velocity/Manifest |
24 |
+++ b/dev-java/velocity/Manifest |
25 |
@@ -1 +1,2 @@ |
26 |
DIST velocity-1.7.tar.gz 5882643 BLAKE2B 4c1499bb015fe1c6b87257a60d247b1b0fb8558e6f879a3d04cf9ef0561ed69b89491c9ebba55cc54d14f6d377b300ee0f7e55ae4118236bba60dc632b5686b3 SHA512 542c9cc0efa118693bf1c952ac4b0c7c3d0229ef804afaa4f0f1c01ad40b0112055c21df7f800c302bf173d58461a864b29b9bc4b9174029d9748f88f2fcf9ab |
27 |
+DIST velocity-2.3.tar.gz 443754 BLAKE2B 16b7aaa87eb6be899f40d09ee8aa50b2ac24dd59c33f29b944d46ea84a77de07cd69f344632b4b829b92a92fe6ccd75cf79e021787b2ca59a79040aa08a53eed SHA512 987f2991a96fa8fae43ff2f72d6a57b25b1cb7d98b7def7a1a6e9a308c8b5b86e394444c47ee0eca8b70d41b341759c7309404dc4b952dbc65fc3a5b92d46cdb |
28 |
|
29 |
diff --git a/dev-java/velocity/velocity-2.3.ebuild b/dev-java/velocity/velocity-2.3.ebuild |
30 |
new file mode 100644 |
31 |
index 00000000000..495e3056411 |
32 |
--- /dev/null |
33 |
+++ b/dev-java/velocity/velocity-2.3.ebuild |
34 |
@@ -0,0 +1,144 @@ |
35 |
+# Copyright 1999-2021 Gentoo Authors |
36 |
+# Distributed under the terms of the GNU General Public License v2 |
37 |
+ |
38 |
+# Skeleton command: |
39 |
+# java-ebuilder --generate-ebuild --workdir . --pom pom.xml --download-uri https://github.com/apache/velocity-engine/archive/refs/tags/2.3.tar.gz --slot 0 --keywords "~amd64 ~x86" --ebuild velocity-2.3.ebuild |
40 |
+ |
41 |
+EAPI=7 |
42 |
+ |
43 |
+JAVA_PKG_IUSE="doc source test" |
44 |
+MAVEN_ID="org.apache.velocity:velocity-engine-core:2.3" |
45 |
+JAVA_TESTING_FRAMEWORKS="junit-4" |
46 |
+ |
47 |
+inherit java-pkg-2 java-pkg-simple |
48 |
+ |
49 |
+DESCRIPTION="Apache Velocity is a general purpose template engine." |
50 |
+HOMEPAGE="https://velocity.apache.org" |
51 |
+SRC_URI="https://github.com/apache/${PN}-engine/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz" |
52 |
+ |
53 |
+LICENSE="Apache-2.0" |
54 |
+SLOT="0" |
55 |
+KEYWORDS="~amd64 ~x86" |
56 |
+ |
57 |
+# Common dependencies |
58 |
+# POM: pom.xml |
59 |
+# commons-io:commons-io:2.8.0 -> >=dev-java/commons-io-2.8.0:1 |
60 |
+# org.apache.commons:commons-lang3:3.11 -> >=dev-java/commons-lang-3.11:3.6 |
61 |
+# org.slf4j:slf4j-api:1.7.30 -> >=dev-java/slf4j-api-1.7.30:0 |
62 |
+ |
63 |
+CDEPEND=" |
64 |
+ >=dev-java/commons-io-2.8.0:1 |
65 |
+ >=dev-java/commons-lang-3.11:3.6 |
66 |
+ >=dev-java/slf4j-api-1.7.30:0 |
67 |
+" |
68 |
+ |
69 |
+# Compile dependencies |
70 |
+# POM: pom.xml |
71 |
+# test? junit:junit:4.13.2 -> >=dev-java/junit-4.13.2:4 |
72 |
+# test? org.hsqldb:hsqldb:2.5.1 -> !!!groupId-not-found!!! |
73 |
+# test? org.slf4j:slf4j-simple:1.7.30 -> >=dev-java/slf4j-simple-1.7.30:0 |
74 |
+ |
75 |
+DEPEND=" |
76 |
+ >=virtual/jdk-1.8:* |
77 |
+ ${CDEPEND} |
78 |
+ test? ( |
79 |
+ dev-db/hsqldb:0 |
80 |
+ >=dev-java/slf4j-simple-1.7.30:0 |
81 |
+ ) |
82 |
+" |
83 |
+ |
84 |
+RDEPEND=" |
85 |
+ >=virtual/jre-1.8:* |
86 |
+ ${CDEPEND} |
87 |
+" |
88 |
+ |
89 |
+BDEPEND=" |
90 |
+ dev-java/javacc:0 |
91 |
+" |
92 |
+ |
93 |
+S="${WORKDIR}/${PN}-engine-${PV}/${PN}-engine-core" |
94 |
+ |
95 |
+JAVA_GENTOO_CLASSPATH="commons-io-1,commons-lang-3.6,slf4j-api" |
96 |
+JAVA_SRC_DIR="src/main/java" |
97 |
+JAVA_RESOURCE_DIRS="src/main/resources" |
98 |
+ |
99 |
+JAVA_TEST_GENTOO_CLASSPATH="junit-4,hsqldb,slf4j-simple" |
100 |
+JAVA_TEST_SRC_DIR="src/test/java" |
101 |
+JAVA_TEST_RESOURCE_DIRS="src/test/resources" |
102 |
+ |
103 |
+JAVA_TEST_EXCLUDES=( |
104 |
+ # org.junit.runners.model.InvalidTestClassError: Invalid test class, No runnable methods |
105 |
+ "org.apache.velocity.test.RenderVelocityTemplateTest" |
106 |
+ "org.apache.velocity.test.provider.TestNumber" |
107 |
+ "org.apache.velocity.test.provider.TestProvider" |
108 |
+ "org.apache.velocity.test.sql.TestDataSource" |
109 |
+ "org.apache.velocity.test.misc.TestContext" |
110 |
+ |
111 |
+ # java.lang.IllegalArgumentException: Test class can only have one constructor |
112 |
+ "org.apache.velocity.test.misc.TestLogger" |
113 |
+ |
114 |
+ # junit.framework.AssertionFailedError: Class org.apache.velocity.test.sql.BaseSQLTest has no public constructor TestCase(String name) or TestCase() |
115 |
+ "org.apache.velocity.test.sql.BaseSQLTest" |
116 |
+ |
117 |
+ # requires configured jdbc |
118 |
+ # junit.framework.AssertionFailedError: Exception in constructor: testSimpleTemplate (java.lang.NullPointerException |
119 |
+ # junit.framework.AssertionFailedError: Exception in constructor: testNullTimestamp (java.lang.NullPointerException |
120 |
+ # junit.framework.AssertionFailedError: Exception in constructor: testMacroInvocation (java.lang.NullPointerException |
121 |
+ # junit.framework.AssertionFailedError: Exception in constructor: testRenderTool (java.lang.NullPointerException |
122 |
+ "org.apache.velocity.test.sql.DataSourceResourceLoaderTestCase" |
123 |
+) |
124 |
+ |
125 |
+src_prepare() { |
126 |
+ default |
127 |
+ |
128 |
+ cp -v "${JAVA_SRC_DIR}-templates/org/apache/velocity/runtime/VelocityEngineVersion.java" \ |
129 |
+ "${JAVA_SRC_DIR}/org/apache/velocity/runtime/VelocityEngineVersion.java" || die |
130 |
+ |
131 |
+ sed -i "s/\${project.version}/${PV}/g" \ |
132 |
+ "${JAVA_SRC_DIR}/org/apache/velocity/runtime/VelocityEngineVersion.java" || die |
133 |
+ |
134 |
+ # fix paths for tests |
135 |
+ sed -i \ |
136 |
+ -e "s%System.getProperty(\"test.compare.dir\")%\"${S}/target/test-classes\"%g" \ |
137 |
+ -e "s%System.getProperty(\"test.result.dir\")%\"${S}/results\"%g" \ |
138 |
+ "${JAVA_TEST_SRC_DIR}/org/apache/velocity/test/TemplateTestBase.java" || die |
139 |
+ |
140 |
+ sed -i \ |
141 |
+ -e 's/\${parser.basename}/Standard/g' \ |
142 |
+ -e 's/\${parser.package}/org.apache.velocity.runtime.parser/g' \ |
143 |
+ -e 's/\${parser.char.asterisk}/\*/g' \ |
144 |
+ -e 's/\${parser.char.at}/\@/g' \ |
145 |
+ -e 's/\${parser.char.dollar}/\$/g' \ |
146 |
+ -e 's/\${parser.char.hash}/\#/g' \ |
147 |
+ "${S}/src/main/parser/Parser.jjt" || die |
148 |
+ |
149 |
+ # File "StandardParserTreeConstants.java" does not exist. Will create one. |
150 |
+ # File "StandardParserVisitor.java" does not exist. Will create one. |
151 |
+ # File "JJTStandardParserState.java" does not exist. Will create one. |
152 |
+ jjtree -GRAMMAR_ENCODING=UTF-8 \ |
153 |
+ -JDK_VERSION=1.8 \ |
154 |
+ -BUILD_NODE_FILES=false \ |
155 |
+ -MULTI=true \ |
156 |
+ -NODE_PACKAGE=org.apache.velocity.runtime.parser.node \ |
157 |
+ -NODE_USES_PARSER=true \ |
158 |
+ -STATIC=false \ |
159 |
+ -OUTPUT_DIRECTORY="${JAVA_SRC_DIR}/org/apache/velocity/runtime/parser/node" \ |
160 |
+ "${S}/src/main/parser/Parser.jjt" \ |
161 |
+ || die "Code generation via jjtree failed" |
162 |
+ |
163 |
+ javacc -GRAMMAR_ENCODING=UTF-8 \ |
164 |
+ -JDK_VERSION=1.8 \ |
165 |
+ -STATIC=false \ |
166 |
+ -DEBUG_PARSER=false \ |
167 |
+ -DEBUG_LOOKAHEAD=false \ |
168 |
+ -DEBUG_TOKEN_MANAGER=false \ |
169 |
+ -BUILD_PARSER=true \ |
170 |
+ -TOKEN_MANAGER_USES_PARSER=true \ |
171 |
+ -OUTPUT_DIRECTORY="${JAVA_SRC_DIR}" \ |
172 |
+ "${JAVA_SRC_DIR}/org/apache/velocity/runtime/parser/node/Parser.jj" \ |
173 |
+ || die "Parser.java code generation via javacc failed" |
174 |
+ |
175 |
+ # Avoid "error: duplicate class: org.apache.velocity.runtime.parser...." |
176 |
+ rm -v "${JAVA_SRC_DIR}/CharStream.java" || die "cannot remove 'CharStream.java'" |
177 |
+ rm -v "${JAVA_SRC_DIR}/ParseException.java" || die "cannot remove 'ParseException.java'" |
178 |
+} |