summaryrefslogtreecommitdiff
path: root/dev-java/velocity
diff options
context:
space:
mode:
Diffstat (limited to 'dev-java/velocity')
-rw-r--r--dev-java/velocity/Manifest4
-rw-r--r--dev-java/velocity/metadata.xml1
-rw-r--r--dev-java/velocity/velocity-2.4.ebuild113
3 files changed, 117 insertions, 1 deletions
diff --git a/dev-java/velocity/Manifest b/dev-java/velocity/Manifest
index c72aac207393..8d12ea185842 100644
--- a/dev-java/velocity/Manifest
+++ b/dev-java/velocity/Manifest
@@ -1,3 +1,5 @@
DIST velocity-2.3_p20240314.tar.gz 440967 BLAKE2B c5fcea7af49d6c46d5c0943efe82f3c04d921afc2c53201b97842ae71714e7035d075c147b3bea71e959db12dd970b7879ade73bbc23bab09a1fd262e21f2fc6 SHA512 9055e780d2a3c798bfe30e5c7859a7311c4984b551d7b2ffa68c57c076549326d0ddae31eabff8009ea021c749331d34c71eee8cab55599dea5f3c8dba841a02
+DIST velocity-2.4.tar.gz 444952 BLAKE2B 0db598bad6743383e62e89acc55b887f28108b6065c3e615b78485e4f94c9f1a316bff7c04d66052541d6173311e97dab28142dad69e6caca168b2a2fcc28637 SHA512 b3f7ae68fa2e0f30193f089a2e8ee5366e71726d93e85fa2f4c3f95d20aa599df053ee7103c71b01c89fe08dd5276e5a2c7da3e26eaffeafd94c078241a9e264
EBUILD velocity-2.3_p20240314.ebuild 3484 BLAKE2B d523792a502ce5fe7318b3a48c3daad09c05ad3e8bac6e02527abd6d7288865230ee8a1e490dc04a18f9817c4fc84aba789678af003628b885fafeea3ec5d54b SHA512 be61868f896446727b26c9bbfcf2f7d072aabe1b64da73c5963c75c6aa747da0b989eba05eef00c2320f48a9bc7a88b8434e64b4b9532af8b2c744e0b2a1483a
-MISC metadata.xml 324 BLAKE2B c8eea57701703ec431e972c8e9c79135f5c124f1d16d4882cdcf64b884ba656654f030dc63ae7bcba3f0485cf751c53cce51e3b337eae198d61ae84abb3d04ed SHA512 29c6d5194ebede2598996e03408bd4c3c54bdcfce18c1025ffa95fbfba99a953acc66af25e4bb046d33a71d2c462e4fc84867ff8067a2434af885fb046980840
+EBUILD velocity-2.4.ebuild 3498 BLAKE2B 7eb3687afa4c291363c8420c5548debef6dac1ae53cfe60768ee3107ec71092381818d066a4ba7330b37ed0ef990fe9940acf05d3a812ff60c2e5997ce1c7bd8 SHA512 ca4b99627d1f62dc3282aad474accfa9e233e930728a4a7880a8c8a8e6a3fcd1b251e4d03046065da7b63d16695e48093be24391638bc858d5b1e879fce9c70c
+MISC metadata.xml 401 BLAKE2B b11e2740816123dd6a2e4c19958be0309b72bce734f677acac45570597adaaf7b1b21b240612fe7f0a31165d81bc8d70c258f0ff2ab41922acd74acd1e731b54 SHA512 1ebed6a12dd89d632574519db9e266fbf434d11ae28221813499a96a926fe33db2e52af6e36f5854b49df7b1898d166eece550a67c5e6bab4b4439e8b6289c36
diff --git a/dev-java/velocity/metadata.xml b/dev-java/velocity/metadata.xml
index 8e49c08df5a1..859cbf7156a4 100644
--- a/dev-java/velocity/metadata.xml
+++ b/dev-java/velocity/metadata.xml
@@ -6,6 +6,7 @@
<name>Java</name>
</maintainer>
<upstream>
+ <changelog>https://velocity.apache.org/engine/2.4/changes.html</changelog>
<remote-id type="github">apache/velocity-engine</remote-id>
</upstream>
</pkgmetadata>
diff --git a/dev-java/velocity/velocity-2.4.ebuild b/dev-java/velocity/velocity-2.4.ebuild
new file mode 100644
index 000000000000..27d9d96922dc
--- /dev/null
+++ b/dev-java/velocity/velocity-2.4.ebuild
@@ -0,0 +1,113 @@
+# 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="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/${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/${PN}-engine-${PV}/${PN}-engine-core"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~ppc64"
+
+CP_DEPEND="
+ dev-java/commons-lang:3.6
+ dev-java/slf4j-api:0
+"
+
+DEPEND="
+ ${CP_DEPEND}
+ dev-java/commons-io:1
+ >=virtual/jdk-1.8:*
+ test? (
+ dev-db/hsqldb:0
+ dev-java/slf4j-simple:0
+ )
+"
+
+RDEPEND="
+ ${CP_DEPEND}
+ >=virtual/jre-1.8:*
+"
+
+JAVACC_SLOT="7.0.13"
+BDEPEND="dev-java/javacc:${JAVACC_SLOT}"
+
+JAVA_CLASSPATH_EXTRA="commons-io-1"
+JAVA_RESOURCE_DIRS="src/main/resources"
+JAVA_SRC_DIR="src/main/java"
+JAVA_TEST_EXTRA_ARGS="-Dtest.compare.dir=target/test-classes -Dtest.result.dir=results"
+JAVA_TEST_GENTOO_CLASSPATH="junit-4,hsqldb,slf4j-simple"
+JAVA_TEST_RESOURCE_DIRS="src/test/resources"
+JAVA_TEST_SRC_DIR="src/test/java"
+
+src_prepare() {
+ java-pkg-2_src_prepare
+
+ cp -r src/main/{,resources/org/apache/velocity/runtime}/parser || die
+
+ sed -e "s/\${project.version}/${PV}/" \
+ src/main/java-templates/org/apache/velocity/runtime/VelocityEngineVersion.java > \
+ src/main/java/org/apache/velocity/runtime/VelocityEngineVersion.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-${JAVACC_SLOT}" -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-${JAVACC_SLOT}" -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'"
+}
+
+src_test() {
+ pushd src/test/java || die
+ # DataSourceResourceLoaderTestCase.java requires configured jdbc
+ local JAVA_TEST_RUN_ONLY=$(find * \
+ -name "*TestCase.java" \
+ ! -name "BaseTestCase.java" \
+ ! -name "DataSourceResourceLoaderTestCase.java" \
+ )
+ JAVA_TEST_RUN_ONLY="${JAVA_TEST_RUN_ONLY//.java}"
+ JAVA_TEST_RUN_ONLY="${JAVA_TEST_RUN_ONLY//\//.}"
+ popd
+ java-pkg-simple_src_test
+}