dev-java/tomcat-servlet-api: amd64 stable wrt bug #718018
[gentoo.git] / dev-java / fec / fec-1.0.4-r2.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5 JAVA_PKG_IUSE="doc source"
6
7 inherit flag-o-matic toolchain-funcs java-pkg-2 java-ant-2
8
9 DESCRIPTION="Forward Error Correction library in Java"
10 HOMEPAGE="https://bitbucket.org/onionnetworks/"
11 SRC_URI="https://dev.gentoo.org/~monsieurp/packages/${P}.tar.gz"
12
13 LICENSE="BSD-2"
14 SLOT="0"
15 KEYWORDS="amd64 x86"
16 IUSE=""
17
18 CDEPEND="dev-java/log4j:0"
19
20 RDEPEND="
21         ${CDEPEND}
22         >=virtual/jre-1.6"
23
24 DEPEND="
25         ${CDEPEND}
26         >=virtual/jdk-1.6
27         app-arch/unzip"
28
29 PATCHES=(
30         "${FILESDIR}"/"${P}-libfec8path.patch"
31         "${FILESDIR}"/"${P}-build.patch"
32         "${FILESDIR}"/"${P}-soname.patch"
33         "${FILESDIR}"/"${P}-remove-concurrent-util-imports.patch"
34 )
35
36 JAVA_ANT_REWRITE_CLASSPATH="yes"
37 EANT_GENTOO_CLASSPATH="log4j"
38 EANT_BUILD_TARGET="jars"
39
40 # There seems to be unit tests, but they are in such a state.
41 RESTRICT="test"
42
43 java_prepare() {
44         # In fact, we'll wipe tests altogether.
45         rm -rf tests || die
46
47         # Apply patches.
48         epatch "${PATCHES[@]}"
49
50         # Get rid of bundled jars.
51         java-pkg_clean
52 }
53
54 src_compile() {
55         java-pkg-2_src_compile
56         einfo "Sucessfully compiled Java classes!"
57
58         cd "${S}"/src/csrc || die
59         append-flags -fPIC
60         emake CC=$(tc-getCC) CFLAGS="${CFLAGS} $(java-pkg_get-jni-cflags)"
61         einfo "Sucessfully compiled C files!"
62 }
63
64 src_install() {
65         java-pkg_newjar "lib/onion-${PN}.jar" "${PN}.jar"
66         use doc && java-pkg_dojavadoc javadoc
67         use source && java-pkg_dosrc src/com
68         dolib.so src/csrc/libfec{8,16}.so
69 }