Skip to content

Commit

Permalink
dev-java/freehep-graphicsio-emf: Version bump to 2.4, EAPI bump, tests
Browse files Browse the repository at this point in the history
Also add emf2svg launcher and fix NPE, closes bugs #304317, #304323.

Package-Manager: portage-2.3.0_rc1
  • Loading branch information
chewi committed May 25, 2016
1 parent 8b3ed56 commit c3e09cf
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 35 deletions.
2 changes: 1 addition & 1 deletion dev-java/freehep-graphicsio-emf/Manifest
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DIST freehep-graphicsio-emf-2.1.1-sources.jar 131325 SHA256 c7b32d145be3aedf8adfe679359852c5dc8994d3a70b55f32bfeae85ebb3d629 SHA512 d5f971bb9ff8c5860b26e2e6cb02453db7a088349a2ce9840f8375b586f7911f5f1640b8e47e11c1afd8d7f04934f5f68722f276b22e8a0c28ef3d080d329cad WHIRLPOOL 8b505aaee85196dfb4b6912cfdcb9297a979ea1cf236f5a33c2664263d525012b80dad8180038f2427362ef314b637ceeb009fd47980f42e6d956d634873baf4
DIST freehep-vectorgraphics-2.4.tar.gz 4118379 SHA256 2c7e1bbb3c056e9de83e5f7d9e0b2aeb3f46734000cdd0f18423eb43216305dd SHA512 b5cf083cc6951e7c4b438d5e648f61ca20b23e02163a8cfc4669beaaec2fa9e33338b0ba6875bfe4a3864ac48f9774acfedc2a3b2f59a7488ef99a4817e39382 WHIRLPOOL 62d61e05935348cf8b5d81033408729b02377f8a91760d08ab98a8e1451ea4d44e992a98dfb951978272ca842dbfa0d2885430cd16428dcf4da005aa092fbe76
34 changes: 34 additions & 0 deletions dev-java/freehep-graphicsio-emf/files/github-30.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
https://github.com/freehep/freehep-vectorgraphics/issues/30

diff -Naur freehep-vectorgraphics-freehep-vectorgraphics-2.4.orig/freehep-graphicsio-emf/src/main/java/org/freehep/graphicsio/emf/EMFConverter.java freehep-vectorgraphics-freehep-vectorgraphics-2.4/freehep-graphicsio-emf/src/main/java/org/freehep/graphicsio/emf/EMFConverter.java
--- freehep-vectorgraphics-freehep-vectorgraphics-2.4.orig/freehep-graphicsio-emf/src/main/java/org/freehep/graphicsio/emf/EMFConverter.java 2014-09-02 09:59:14.000000000 +0100
+++ freehep-vectorgraphics-freehep-vectorgraphics-2.4/freehep-graphicsio-emf/src/main/java/org/freehep/graphicsio/emf/EMFConverter.java 2016-05-25 22:50:41.859734476 +0100
@@ -4,6 +4,7 @@
import org.freehep.graphicsbase.util.export.ExportFileType;

import java.util.List;
+import java.util.Properties;
import java.io.FileInputStream;
import java.io.File;

@@ -64,9 +65,10 @@
destFileName += type.toLowerCase();
}

+ Properties p = new Properties();
+
// TODO there is no possibility to use Constants of base class!
/* create SVG properties
- Properties p = new Properties();
p.put(SVGGraphics2D.EMBED_FONTS, Boolean.toString(false));
p.put(SVGGraphics2D.CLIP, Boolean.toString(true));
p.put(SVGGraphics2D.COMPRESS, Boolean.toString(false));
@@ -82,7 +84,7 @@
new File(destFileName),
emfPanel,
emfPanel,
- null,
+ p,
"Freehep EMF converter");
} catch (Exception e) {
e.printStackTrace();

This file was deleted.

61 changes: 61 additions & 0 deletions dev-java/freehep-graphicsio-emf/freehep-graphicsio-emf-2.4.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=5

MY_PN="freehep-vectorgraphics"
MY_P="${MY_PN}-${PV}"
JAVA_PKG_IUSE="doc source"

inherit eutils java-pkg-2 java-pkg-simple

DESCRIPTION="High Energy Physics Java library - FreeHEP Enhanced Metafile Format Driver"
HOMEPAGE="http://java.freehep.org/"
SRC_URI="https://github.com/freehep/${MY_PN}/archive/${MY_P}.tar.gz"
LICENSE="Apache-2.0 LGPL-2.1"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="test"

CDEPEND="~dev-java/freehep-graphics2d-${PV}:${SLOT}
~dev-java/freehep-graphicsbase-${PV}:${SLOT}
~dev-java/freehep-graphicsio-${PV}:${SLOT}
dev-java/freehep-io:0"

DEPEND="${CDEPEND}
>=virtual/jdk-1.7
test? (
~dev-java/freehep-graphicsio-tests-${PV}:${SLOT}
dev-java/junit:4
)"

RDEPEND="${CDEPEND}
>=virtual/jre-1.7"

S="${WORKDIR}/${MY_PN}-${MY_P}/${PN}"
JAVA_SRC_DIR="src/main/java"
JAVA_GENTOO_CLASSPATH="freehep-graphics2d,freehep-graphicsbase,freehep-graphicsio,freehep-io"

java_prepare() {
epatch "${FILESDIR}"/github-30.patch
}

src_compile() {
java-pkg-simple_src_compile
java-pkg_addres ${PN}.jar src/main/resources
}

src_install() {
java-pkg-simple_src_install
java-pkg_register-optional-dependency freehep-graphicsio-svg
java-pkg_dolauncher emf2svg --main org.freehep.graphicsio.emf.EMF2SVG
}

src_test() {
local DIR=src/test/java
local CP="${DIR}:${PN}.jar:$(java-pkg_getjars junit-4,freehep-graphicsio-tests,${JAVA_GENTOO_CLASSPATH})"

ejavac -cp "${CP}" -d ${DIR} $(find ${DIR} -name "*.java")
ejunit4 -classpath "${CP}" org.freehep.graphicsio.emf.test.EMFTestSuite
}
3 changes: 3 additions & 0 deletions dev-java/freehep-graphicsio-emf/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@
<email>[email protected]</email>
<name>Java</name>
</maintainer>
<upstream>
<remote-id type="github">freehep/freehep-vectorgraphics</remote-id>
</upstream>
</pkgmetadata>

0 comments on commit c3e09cf

Please sign in to comment.