commit:     71aa218c86852f9b6b3891ae33bb93445053dc8d
Author:     Volkmar W. Pogatzki <gentoo <AT> pogatzki <DOT> net>
AuthorDate: Sat Apr 17 20:23:16 2021 +0000
Commit:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
CommitDate: Sun Apr 25 15:23:46 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=71aa218c

dev-java/velocity: bump to 2.3

Bug: https://bugs.gentoo.org/775248

Package-Manager: Portage-3.0.17, Repoman-3.0.2
Signed-off-by: Volkmar W. Pogatzki <gentoo <AT> pogatzki.net>
Closes: https://github.com/gentoo/gentoo/pull/20429
Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>

 dev-java/velocity/Manifest            |   1 +
 dev-java/velocity/velocity-2.3.ebuild | 144 ++++++++++++++++++++++++++++++++++
 2 files changed, 145 insertions(+)

diff --git a/dev-java/velocity/Manifest b/dev-java/velocity/Manifest
index bca2b1c20c0..2728c27d189 100644
--- a/dev-java/velocity/Manifest
+++ b/dev-java/velocity/Manifest
@@ -1 +1,2 @@
 DIST velocity-1.7.tar.gz 5882643 BLAKE2B 
4c1499bb015fe1c6b87257a60d247b1b0fb8558e6f879a3d04cf9ef0561ed69b89491c9ebba55cc54d14f6d377b300ee0f7e55ae4118236bba60dc632b5686b3
 SHA512 
542c9cc0efa118693bf1c952ac4b0c7c3d0229ef804afaa4f0f1c01ad40b0112055c21df7f800c302bf173d58461a864b29b9bc4b9174029d9748f88f2fcf9ab
+DIST velocity-2.3.tar.gz 443754 BLAKE2B 
16b7aaa87eb6be899f40d09ee8aa50b2ac24dd59c33f29b944d46ea84a77de07cd69f344632b4b829b92a92fe6ccd75cf79e021787b2ca59a79040aa08a53eed
 SHA512 
987f2991a96fa8fae43ff2f72d6a57b25b1cb7d98b7def7a1a6e9a308c8b5b86e394444c47ee0eca8b70d41b341759c7309404dc4b952dbc65fc3a5b92d46cdb

diff --git a/dev-java/velocity/velocity-2.3.ebuild 
b/dev-java/velocity/velocity-2.3.ebuild
new file mode 100644
index 00000000000..495e3056411
--- /dev/null
+++ b/dev-java/velocity/velocity-2.3.ebuild
@@ -0,0 +1,144 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# Skeleton command:
+# 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
+
+EAPI=7
+
+JAVA_PKG_IUSE="doc source test"
+MAVEN_ID="org.apache.velocity:velocity-engine-core:2.3"
+JAVA_TESTING_FRAMEWORKS="junit-4"
+
+inherit java-pkg-2 java-pkg-simple
+
+DESCRIPTION="Apache Velocity is a general purpose template engine."
+HOMEPAGE="https://velocity.apache.org";
+SRC_URI="https://github.com/apache/${PN}-engine/archive/refs/tags/${PV}.tar.gz 
-> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+# Common dependencies
+# POM: pom.xml
+# commons-io:commons-io:2.8.0 -> >=dev-java/commons-io-2.8.0:1
+# org.apache.commons:commons-lang3:3.11 -> >=dev-java/commons-lang-3.11:3.6
+# org.slf4j:slf4j-api:1.7.30 -> >=dev-java/slf4j-api-1.7.30:0
+
+CDEPEND="
+       >=dev-java/commons-io-2.8.0:1
+       >=dev-java/commons-lang-3.11:3.6
+       >=dev-java/slf4j-api-1.7.30:0
+"
+
+# Compile dependencies
+# POM: pom.xml
+# test? junit:junit:4.13.2 -> >=dev-java/junit-4.13.2:4
+# test? org.hsqldb:hsqldb:2.5.1 -> !!!groupId-not-found!!!
+# test? org.slf4j:slf4j-simple:1.7.30 -> >=dev-java/slf4j-simple-1.7.30:0
+
+DEPEND="
+       >=virtual/jdk-1.8:*
+       ${CDEPEND}
+       test? (
+               dev-db/hsqldb:0
+               >=dev-java/slf4j-simple-1.7.30:0
+       )
+"
+
+RDEPEND="
+       >=virtual/jre-1.8:*
+       ${CDEPEND}
+"
+
+BDEPEND="
+       dev-java/javacc:0
+"
+
+S="${WORKDIR}/${PN}-engine-${PV}/${PN}-engine-core"
+
+JAVA_GENTOO_CLASSPATH="commons-io-1,commons-lang-3.6,slf4j-api"
+JAVA_SRC_DIR="src/main/java"
+JAVA_RESOURCE_DIRS="src/main/resources"
+
+JAVA_TEST_GENTOO_CLASSPATH="junit-4,hsqldb,slf4j-simple"
+JAVA_TEST_SRC_DIR="src/test/java"
+JAVA_TEST_RESOURCE_DIRS="src/test/resources"
+
+JAVA_TEST_EXCLUDES=(
+       # org.junit.runners.model.InvalidTestClassError: Invalid test class, No 
runnable methods
+       "org.apache.velocity.test.RenderVelocityTemplateTest"
+       "org.apache.velocity.test.provider.TestNumber"
+       "org.apache.velocity.test.provider.TestProvider"
+       "org.apache.velocity.test.sql.TestDataSource"
+       "org.apache.velocity.test.misc.TestContext"
+
+       # java.lang.IllegalArgumentException: Test class can only have one 
constructor
+       "org.apache.velocity.test.misc.TestLogger"
+
+       # junit.framework.AssertionFailedError: Class 
org.apache.velocity.test.sql.BaseSQLTest has no public constructor 
TestCase(String name) or TestCase()
+       "org.apache.velocity.test.sql.BaseSQLTest"
+
+       # requires configured jdbc
+       # junit.framework.AssertionFailedError: Exception in constructor: 
testSimpleTemplate (java.lang.NullPointerException
+       # junit.framework.AssertionFailedError: Exception in constructor: 
testNullTimestamp (java.lang.NullPointerException
+       # junit.framework.AssertionFailedError: Exception in constructor: 
testMacroInvocation (java.lang.NullPointerException
+       # junit.framework.AssertionFailedError: Exception in constructor: 
testRenderTool (java.lang.NullPointerException
+       "org.apache.velocity.test.sql.DataSourceResourceLoaderTestCase"
+)
+
+src_prepare() {
+       default
+
+       cp -v 
"${JAVA_SRC_DIR}-templates/org/apache/velocity/runtime/VelocityEngineVersion.java"
 \
+               
"${JAVA_SRC_DIR}/org/apache/velocity/runtime/VelocityEngineVersion.java" || die
+
+       sed -i "s/\${project.version}/${PV}/g" \
+               
"${JAVA_SRC_DIR}/org/apache/velocity/runtime/VelocityEngineVersion.java" || die
+
+       # fix paths for tests
+       sed -i \
+               -e 
"s%System.getProperty(\"test.compare.dir\")%\"${S}/target/test-classes\"%g" \
+               -e 
"s%System.getProperty(\"test.result.dir\")%\"${S}/results\"%g" \
+               
"${JAVA_TEST_SRC_DIR}/org/apache/velocity/test/TemplateTestBase.java" || die
+
+       sed -i \
+               -e 's/\${parser.basename}/Standard/g' \
+               -e 's/\${parser.package}/org.apache.velocity.runtime.parser/g' \
+               -e 's/\${parser.char.asterisk}/\*/g' \
+               -e 's/\${parser.char.at}/\@/g' \
+               -e 's/\${parser.char.dollar}/\$/g' \
+               -e 's/\${parser.char.hash}/\#/g' \
+               "${S}/src/main/parser/Parser.jjt" || die
+
+       # File "StandardParserTreeConstants.java" does not exist.  Will create 
one.
+       # File "StandardParserVisitor.java" does not exist.  Will create one.
+       # File "JJTStandardParserState.java" does not exist.  Will create one.
+       jjtree -GRAMMAR_ENCODING=UTF-8 \
+               -JDK_VERSION=1.8 \
+               -BUILD_NODE_FILES=false \
+               -MULTI=true \
+               -NODE_PACKAGE=org.apache.velocity.runtime.parser.node \
+               -NODE_USES_PARSER=true \
+               -STATIC=false \
+               
-OUTPUT_DIRECTORY="${JAVA_SRC_DIR}/org/apache/velocity/runtime/parser/node" \
+               "${S}/src/main/parser/Parser.jjt" \
+               || die "Code generation via jjtree failed"
+
+       javacc -GRAMMAR_ENCODING=UTF-8 \
+               -JDK_VERSION=1.8 \
+               -STATIC=false \
+               -DEBUG_PARSER=false \
+               -DEBUG_LOOKAHEAD=false \
+               -DEBUG_TOKEN_MANAGER=false \
+               -BUILD_PARSER=true \
+               -TOKEN_MANAGER_USES_PARSER=true \
+               -OUTPUT_DIRECTORY="${JAVA_SRC_DIR}" \
+               
"${JAVA_SRC_DIR}/org/apache/velocity/runtime/parser/node/Parser.jj" \
+               || die "Parser.java code generation via javacc failed"
+
+       # Avoid "error: duplicate class: org.apache.velocity.runtime.parser...."
+       rm -v "${JAVA_SRC_DIR}/CharStream.java" || die "cannot remove 
'CharStream.java'"
+       rm -v "${JAVA_SRC_DIR}/ParseException.java" || die "cannot remove 
'ParseException.java'"
+}

Reply via email to