dev-java/spec-alpha: new package for clojure build
[gentoo.git] / dev-java / freehep-graphicsio-emf / freehep-graphicsio-emf-2.4.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 MY_PN="freehep-vectorgraphics"
7 MY_P="${MY_PN}-${PV}"
8 JAVA_PKG_IUSE="doc source"
9
10 inherit eutils java-pkg-2 java-pkg-simple
11
12 DESCRIPTION="High Energy Physics Java library - FreeHEP Enhanced Metafile Format Driver"
13 HOMEPAGE="http://java.freehep.org/"
14 SRC_URI="https://github.com/freehep/${MY_PN}/archive/${MY_P}.tar.gz"
15 LICENSE="Apache-2.0 LGPL-2.1"
16 SLOT="0"
17 KEYWORDS="~amd64 ~x86"
18 IUSE="test"
19 RESTRICT="!test? ( test )"
20
21 CDEPEND="~dev-java/freehep-graphics2d-${PV}:${SLOT}
22         ~dev-java/freehep-graphicsbase-${PV}:${SLOT}
23         ~dev-java/freehep-graphicsio-${PV}:${SLOT}
24         dev-java/freehep-io:0"
25
26 DEPEND="${CDEPEND}
27         >=virtual/jdk-1.7
28         test? (
29                 ~dev-java/freehep-graphicsio-tests-${PV}:${SLOT}
30                 dev-java/junit:4
31         )"
32
33 RDEPEND="${CDEPEND}
34         >=virtual/jre-1.7"
35
36 S="${WORKDIR}/${MY_PN}-${MY_P}/${PN}"
37 JAVA_SRC_DIR="src/main/java"
38 JAVA_GENTOO_CLASSPATH="freehep-graphics2d,freehep-graphicsbase,freehep-graphicsio,freehep-io"
39
40 java_prepare() {
41         epatch "${FILESDIR}"/github-30.patch
42 }
43
44 src_compile() {
45         java-pkg-simple_src_compile
46         java-pkg_addres ${PN}.jar src/main/resources
47 }
48
49 src_install() {
50         java-pkg-simple_src_install
51         java-pkg_register-optional-dependency freehep-graphicsio-svg
52         java-pkg_dolauncher emf2svg --main org.freehep.graphicsio.emf.EMF2SVG
53 }
54
55 src_test() {
56         local DIR=src/test/java
57         local CP="${DIR}:${PN}.jar:$(java-pkg_getjars junit-4,freehep-graphicsio-tests,${JAVA_GENTOO_CLASSPATH})"
58
59         ejavac -cp "${CP}" -d ${DIR} $(find ${DIR} -name "*.java")
60         ejunit4 -classpath "${CP}" org.freehep.graphicsio.emf.test.EMFTestSuite
61 }