1 # Copyright 2018-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit java-pkg-2 toolchain-funcs
8 DESCRIPTION="jbigi library used by net-vpn/i2p"
9 HOMEPAGE="https://geti2p.net"
10 SRC_URI="https://download.i2p2.de/releases/${PV}/i2psource_${PV}.tar.bz2"
12 LICENSE="public-domain"
14 KEYWORDS="~amd64 ~x86"
16 RESTRICT="!test? ( test )"
24 S="${WORKDIR}/i2p-${PV}/core"
27 "${FILESDIR}/${P}-asmfix.patch"
37 "$(tc-getCC)" "${@}" ${CFLAGS} $(java-pkg_get-jni-cflags) \
38 ${LDFLAGS} -shared -fPIC "-Wl,-soname,lib${name}.so" \
39 "${file}" -o "lib${name}.so"
42 cd "${S}/c/jbigi/jbigi" || die "unable to cd to jbigi"
43 compile_lib jbigi src/jbigi.c -Iinclude -lgmp ||
44 die "unable to build jbigi"
46 if use amd64 || use x86; then
47 cd "${S}/c/jcpuid" || die "unable to cd to jcpuid"
48 compile_lib jcpuid src/jcpuid.c -Iinclude ||
49 die "unable to build jcpuid"
53 cd "${S}/java/src" || die "unable to cd to java/src"
54 ejavac -encoding UTF-8 net/i2p/util/NativeBigInteger.java ||
55 die "unable to build tests"
60 cd "${S}/java/src" || die "unable to cd to java/src"
61 "$(java-config -J)" -Djava.library.path="${S}/c/jbigi/jbigi" net/i2p/util/NativeBigInteger ||
62 die "unable to pass tests"
66 dolib.so c/jbigi/jbigi/libjbigi.so
68 if use amd64 || use x86; then
69 dolib.so c/jcpuid/libjcpuid.so