summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolkmar W. Pogatzki <gentoo@pogatzki.net>2022-03-30 01:14:39 +0200
committerFlorian Schmaus <flow@gentoo.org>2022-04-04 09:31:38 +0200
commit55f3ec5078e3d85b0cce92b424b9202dd6a9b580 (patch)
tree64e55a0f2a06882134bf067dc4dd0415cc6fe16f /dev-java/fop
parentdev-python/dask: remove unused patch(es) (diff)
downloadgentoo-55f3ec5078e3d85b0cce92b424b9202dd6a9b580.tar.gz
gentoo-55f3ec5078e3d85b0cce92b424b9202dd6a9b580.tar.bz2
gentoo-55f3ec5078e3d85b0cce92b424b9202dd6a9b580.zip
dev-java/fop: Bump to 2.7
Tests for mudule fop-core need a newer mockito version (see comment in the ebuild), skipped for now. Closes: https://bugs.gentoo.org/727504 Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Volkmar W. Pogatzki <gentoo@pogatzki.net> Signed-off-by: Florian Schmaus <flow@gentoo.org>
Diffstat (limited to 'dev-java/fop')
-rw-r--r--dev-java/fop/Manifest1
-rw-r--r--dev-java/fop/files/fop-2.7-core-event-models.jarbin0 -> 8835 bytes
-rw-r--r--dev-java/fop/files/fop-2.7-test-event-model.jarbin0 -> 428 bytes
-rw-r--r--dev-java/fop/fop-2.7.ebuild154
-rw-r--r--dev-java/fop/metadata.xml12
5 files changed, 163 insertions, 4 deletions
diff --git a/dev-java/fop/Manifest b/dev-java/fop/Manifest
index 9cab9ee0471a..b65582322b79 100644
--- a/dev-java/fop/Manifest
+++ b/dev-java/fop/Manifest
@@ -1 +1,2 @@
DIST fop-2.0-src.zip 26381859 BLAKE2B 8500de6a23e93c14fdb4f27c59bafba27a64e6aaffb7a761f16de5bd523e2fdb83593ab53a66de79bf7b7d6c2b887ab97a34accb18be416b26448753babe2395 SHA512 428793303fcf143cffaecadc22cfdb8a065bad0108cceebcabc479d92dbe9834b4f81fd27f3e0314546d848e1960b2fe1a9d443999d8f336f7e87fce771beb7a
+DIST fop-2.7-src.tar.gz 26799877 BLAKE2B 00bcbd4cc915aad67c0dac54e85b7c5d10576115a0a8a16517846af249137c73b10c8b0ff161c9957f7c49686eefbf9777dc452b038573c996e29cbad951176a SHA512 bffbc0a97db8bbc826cf9af89fbf4a7e6f705585ea4915c0954df57c6d7af50d323387bb4bb9e2d13047826352d9eb7cbf4f23d5146ce246965b4c531e015633
diff --git a/dev-java/fop/files/fop-2.7-core-event-models.jar b/dev-java/fop/files/fop-2.7-core-event-models.jar
new file mode 100644
index 000000000000..49bece365d93
--- /dev/null
+++ b/dev-java/fop/files/fop-2.7-core-event-models.jar
Binary files differ
diff --git a/dev-java/fop/files/fop-2.7-test-event-model.jar b/dev-java/fop/files/fop-2.7-test-event-model.jar
new file mode 100644
index 000000000000..7c2fff6a088d
--- /dev/null
+++ b/dev-java/fop/files/fop-2.7-test-event-model.jar
Binary files differ
diff --git a/dev-java/fop/fop-2.7.ebuild b/dev-java/fop/fop-2.7.ebuild
new file mode 100644
index 000000000000..b6bc2ad9ebca
--- /dev/null
+++ b/dev-java/fop/fop-2.7.ebuild
@@ -0,0 +1,154 @@
+# Copyright 1999-2022 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.xmlgraphics:fop:2.7"
+JAVA_TESTING_FRAMEWORKS="junit-4"
+
+inherit java-pkg-2 java-pkg-simple
+
+DESCRIPTION="XML Graphics Format Object Processor All-In-One"
+HOMEPAGE="https://xmlgraphics.apache.org/fop/"
+SRC_URI="mirror://apache/xmlgraphics/fop/source/fop-${PV}-src.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="2.7"
+KEYWORDS="~amd64 ~ppc64 ~x86"
+
+CP_DEPEND="
+ dev-java/batik:1.14
+ dev-java/commons-io:1
+ dev-java/fontbox:0
+ dev-java/qdox:1.12
+ dev-java/sun-jai-bin:0
+ dev-java/xmlgraphics-commons:2
+"
+
+DEPEND="${CP_DEPEND}
+ >=virtual/jdk-1.8:*
+ dev-java/ant-core:0
+ dev-java/sun-jai-bin:0
+ test? (
+ dev-java/mockito:0
+ dev-java/pdfbox:0
+ dev-java/xmlunit:1
+ )
+"
+
+RDEPEND="${CP_DEPEND}
+ >=virtual/jre-1.8:*"
+
+DOCS=( NOTICE README )
+
+S="${WORKDIR}/fop-${PV}"
+
+src_prepare() {
+ default
+ java-pkg_clean
+}
+
+src_compile() {
+ JAVA_SRC_DIR="fop-util/src/main/java"
+ JAVA_JAR_FILENAME="fop-util.jar"
+ java-pkg-simple_src_compile
+ JAVA_GENTOO_CLASSPATH_EXTRA+=":fop-util.jar"
+ rm -r target || die
+
+ JAVA_SRC_DIR="fop-events/src/main/java"
+ JAVA_RESOURCE_DIRS="fop-events/src/main/resources"
+ JAVA_JAR_FILENAME="fop-events.jar"
+ java-pkg-simple_src_compile
+ JAVA_GENTOO_CLASSPATH_EXTRA+=":fop-events.jar"
+ rm -r target || die
+
+ JAVA_SRC_DIR="fop-core/src/main/java"
+ JAVA_RESOURCE_DIRS="fop-core/src/main/resources"
+ JAVA_MAIN_CLASS=$( sed -n 's:.*<mainClass>\(.*\)</mainClass>:\1:p' fop-core/pom.xml )
+ JAVA_JAR_FILENAME="fop-core.jar"
+ # Code generation according to
+ # https://github.com/apache/xmlgraphics-fop/blob/fop-2_7/fop-core/pom.xml#L150-L219
+ pushd fop-core/src/main/codegen/fonts >/dev/null || die
+ local fonts=$(find . -name "Courier*.xml" \
+ -o -name "Helvetica*.xml" \
+ -o -name "Times*.xml" \
+ -o -name "Symbol.xml" \
+ -o -name "ZapfDingbats.xml"
+ )
+ for font in ${fonts}; do \
+ xalan -XSLTC \
+ -IN $font \
+ -XSL font-file.xsl \
+ -OUT ../../java/org/apache/fop/fonts/base14/${font//.xml}.java || die
+ done
+ xalan -XSLTC \
+ -IN encodings.xml \
+ -XSL code-point-mapping.xsl \
+ -OUT ../../java/org/apache/fop/fonts/base14/CodePointMapping.java || die
+ popd
+ java-pkg-simple_src_compile
+ rm -r target || die
+
+ JAVA_GENTOO_CLASSPATH_EXTRA+=":fop-core.jar"
+
+ # Update "fop-core.jar" with "event-mode.xml" files produced manually
+ # by running "mvn package".
+ mkdir event-model && pushd $_ >/dev/null || die
+ jar -xf "${FILESDIR}/fop-2.7-core-event-models.jar"
+ popd
+ jar -uf "fop-core.jar" -C event-model . || die
+ # Upstream does this with maven-antrun-plugin:
+ # https://github.com/apache/xmlgraphics-fop/blob/fop-2_7/fop-core/pom.xml#L263-L284
+
+ # public class EventProducerCollectorTask extends Task {
+ #
+ # private List<FileSet> filesets = new java.util.ArrayList<FileSet>();
+ # private File destDir;
+ # private File translationFile;
+
+ if use doc; then \
+ JAVA_SRC_DIR=(
+ "fop-util/src/main/java"
+ "fop-events/src/main/java"
+ "fop-core/src/main/java"
+ )
+ JAVA_JAR_FILENAME="ignoreme.jar"
+ java-pkg-simple_src_compile
+ fi
+}
+
+src_test() {
+ JAVA_TEST_GENTOO_CLASSPATH="junit-4,mockito,pdfbox,xmlunit-1"
+
+ JAVA_TEST_SRC_DIR="fop-events/src/test/java"
+ JAVA_TEST_RUN_ONLY="org.apache.fop.events.BasicEventTestCase"
+
+ # This jar file was created manually from the output of "mvn test".
+ # Upstream does this with maven-antrun-plugin
+ jar -xf ${FILESDIR}/fop-2.7-test-event-model.jar || die
+
+ java-pkg-simple_src_test
+
+ JAVA_TEST_SRC_DIR="fop-core/src/test/java"
+ JAVA_TEST_RESOURCE_DIRS="fop-core/src/test/resources"
+
+ # Testing fop-core seems to want a newer mockito:
+ # error: cannot find symbol
+ # import static org.mockito.ArgumentMatchers.anyInt;
+# java-pkg-simple_src_test
+}
+
+src_install() {
+ for module in fop-util fop-events fop-core ; do
+ java-pkg_dojar $module.jar
+ if use source; then
+ java-pkg_dosrc "$module/src/main/java/*"
+ fi
+ done
+ if use doc; then
+ java-pkg_dojavadoc target/api
+ fi
+ java-pkg_dolauncher "fop-${SLOT}" --main "org.apache.fop.cli.Main"
+ einstalldocs
+}
diff --git a/dev-java/fop/metadata.xml b/dev-java/fop/metadata.xml
index 6ef2d50cf07e..3f00c936434b 100644
--- a/dev-java/fop/metadata.xml
+++ b/dev-java/fop/metadata.xml
@@ -1,8 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
- <maintainer type="project">
- <email>java@gentoo.org</email>
- <name>Java</name>
- </maintainer>
+ <maintainer type="project">
+ <email>java@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <bugs-to>https://issues.apache.org/jira/projects/FOP/issues</bugs-to>
+ <changelog>https://xmlgraphics.apache.org/fop/changes.html</changelog>
+ <remote-id type="github">apache/xmlgraphics-fop</remote-id>
+ </upstream>
</pkgmetadata>