summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValérian Rousset <tharvik@users.noreply.github.com>2018-10-04 19:36:08 +0200
committerMichał Górny <mgorny@gentoo.org>2018-10-21 19:42:30 +0200
commitc5b6dfd9fa5f109a3ad44d6ed972e954a2bdae1e (patch)
treea63b463d50166ac3ed1f710a0460203fd37acf73 /net-libs/nativebiginteger
parentgames-fps/eduke32: bump to version 20181010.7076 (diff)
downloadgentoo-c5b6dfd9fa5f109a3ad44d6ed972e954a2bdae1e.tar.gz
gentoo-c5b6dfd9fa5f109a3ad44d6ed972e954a2bdae1e.tar.bz2
gentoo-c5b6dfd9fa5f109a3ad44d6ed972e954a2bdae1e.zip
net-libs/nativebiginteger: fix build with -test
Closes: https://bugs.gentoo.org/667292 Package-Manager: Portage-2.3.49, Repoman-2.3.11 Signed-off-by: Valérian Rousset <tharvik@users.noreply.github.com> Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'net-libs/nativebiginteger')
-rw-r--r--net-libs/nativebiginteger/nativebiginteger-0.9.36-r1.ebuild70
1 files changed, 70 insertions, 0 deletions
diff --git a/net-libs/nativebiginteger/nativebiginteger-0.9.36-r1.ebuild b/net-libs/nativebiginteger/nativebiginteger-0.9.36-r1.ebuild
new file mode 100644
index 000000000000..a4f330caaee7
--- /dev/null
+++ b/net-libs/nativebiginteger/nativebiginteger-0.9.36-r1.ebuild
@@ -0,0 +1,70 @@
+# Copyright 2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit java-pkg-2 toolchain-funcs
+
+DESCRIPTION='jbigi library used by net-vpn/i2p'
+HOMEPAGE='https://geti2p.net'
+SRC_URI="https://download.i2p2.de/releases/${PV}/i2psource_${PV}.tar.bz2"
+
+LICENSE='public-domain'
+SLOT='0'
+KEYWORDS='~amd64 ~x86'
+IUSE='test'
+
+DEPEND='
+ dev-libs/gmp:0=
+ virtual/jdk:1.8
+'
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/i2p-${PV}/core"
+
+PATCHES=(
+ "${FILESDIR}/${P}-asmfix.patch"
+)
+
+src_compile() {
+ local compile_lib
+ compile_lib() {
+ local name="${1}"
+ local file="${2}"
+ shift 2
+
+ "$(tc-getCC)" "${@}" ${CFLAGS} $(java-pkg_get-jni-cflags) \
+ ${LDFLAGS} -shared -fPIC "-Wl,-soname,lib${name}.so" \
+ "${file}" -o "lib${name}.so"
+ }
+
+ cd "${S}/c/jbigi/jbigi" &&
+ compile_lib jbigi src/jbigi.c -Iinclude -lgmp ||
+ die 'unable to build jbigi'
+
+ if use amd64 || use x86; then
+ cd "${S}/c/jcpuid" &&
+ compile_lib jcpuid src/jcpuid.c -Iinclude ||
+ die 'unable to build jcpuid'
+ fi
+
+ if use test; then
+ cd "${S}/java/src" &&
+ ejavac -encoding UTF-8 net/i2p/util/NativeBigInteger.java ||
+ die 'unable to build tests'
+ fi
+}
+
+src_test() {
+ cd "${S}/java/src" &&
+ "$(java-config -J)" -Djava.library.path="${S}/c/jbigi/jbigi" net/i2p/util/NativeBigInteger ||
+ die 'unable to pass tests'
+}
+
+src_install() {
+ dolib.so c/jbigi/jbigi/libjbigi.so
+
+ if use amd64 || use x86; then
+ dolib.so c/jcpuid/libjcpuid.so
+ fi
+}