diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /net-libs/nativebiginteger |
reinit the tree, so we can have metadata
Diffstat (limited to 'net-libs/nativebiginteger')
12 files changed, 324 insertions, 0 deletions
diff --git a/net-libs/nativebiginteger/Manifest b/net-libs/nativebiginteger/Manifest new file mode 100644 index 000000000000..d490a0a4e7f6 --- /dev/null +++ b/net-libs/nativebiginteger/Manifest @@ -0,0 +1,15 @@ +AUX nativebiginteger-0.6.4-asmfix.patch 586 SHA256 2ad29016057f3ea18596bff1eb47bc1ef6b4cc129d1f3b55d134f2717b8e631a SHA512 be49f71dadc0b371567e745f85966ee0088b05690506f155abf0f7b991527dbd30cc93ff1997ec80e7cfc06dd622b3ccaea1a8c6cd81d058866d3ed111ee3695 WHIRLPOOL 3db31c5e475983bc4be30aaad4124b6ff7a21482066826f4c44ab47dede2a3f0a118e0f1cc9c5b10e13d5b0ca45021c5e809dfa020141246d5fbf88fb7ef6f71 +AUX nativebiginteger-0.6.4-ldflags.patch 967 SHA256 9e30b7ef2a4c8e55ce9dcacdc4d19ed76e8249f4af540094543f3aae3e27838a SHA512 4e473de37d56cb073fda0f0139525f217f168eb4ef2e09f9c443d003b8651c3e3eb1019842ed41a6cc7937ffcc9ee1f068e05e75d5117ebc28536d40c2b5ecb8 WHIRLPOOL 40370d1165ba21f85f13757dc09e0abfe0b3a7987140f7d73f09eabf341b498b1b37304aadf897c1f8bf2b32cd1eb18c429d5c9c3b0fe874ea201c8346dbe8ea +AUX nativebiginteger-0.8.7-asmfix.patch 590 SHA256 f21f798dfc4bf30e717b5a113d9564d9a1ce93d6460e9d77ea452c2869f3ece1 SHA512 0efbf7f8e0767e2636bea21fd5020860bd6dc86bc6bb562b50bf40bd8ab0f83f9219fb031e93eedfa6d7f54027e5fdeb88aa64c283861963d1fd34e3dd4bbd05 WHIRLPOOL 894b9d7dc2e27852e2e1e3da6d7e9a03d3073b94c93013a4091c254a2d91e93c2f2874422884f2c4c295bd7e3af9201a3220dc593a465d85a76eb29235841f9a +AUX nativebiginteger-0.8.7-build-system.patch 907 SHA256 fb22532815cbef13e1e2639d9dd2f16018d9663370f22aee073b6fb0868f87d6 SHA512 13b7e8d2764ee0b86924854ee99a0c220f9b213d868460a39ad448e510cf33d4d747bfebb0b7273d70ca1cb15151324fea446431d9301973c0f2a0bd381a5dc3 WHIRLPOOL 7247382c8d9ca27a244834c240529533162cfe19a7b7050bdb4b6dcdf86dabd890bb5583ad8c0934c4220bf39a81dc5551e0a793ed7508fa8b82f09f77c10242 +AUX nativebiginteger-0.8.7-debug-all.patch 1215 SHA256 a8ffe1ae7497bda2d10c01f35845bc31689b727c36af39ea73edc8614cc26a18 SHA512 0e9abda1d39a9b0a7c24f13bcc909d15940dd81f2d6b87b4ae39227c0191629ed7a3cfd6be50e3692423d91e0b2931324ba384e736c1c4eaec656df8ee0da9f2 WHIRLPOOL 16cf5f1b9fda626959c03dfcb8d869150e1f5840c37182065c977a7299dfd097913fb064972c08a2d6127cb4c36e4c1fd80dbf108ac188a321db0f4c4e8cbc31 +AUX nativebiginteger-0.8.7-jcpuid-build-system.patch 761 SHA256 62fe230a522df9371427ffa04805279bb1bf1802b6dece013b2d8762bbf7a31d SHA512 9c2f0a458d4a240fc9998d28995a14742aa63873bb05479b296122a2a4f7f68caafe4df315f5ed709b4e1b92a12be22700cfe1792e7ad186feaf7cc1f97b6d86 WHIRLPOOL 0c3cfde88629685d4ef74761412ba823ea763a440c3dde69f3c143678cde34118ff289b85ec0d7a0bf64100248cdd4276cfcf575c09ba13a9b4c858ccc7d7b42 +AUX nativebiginteger-0.8.7-non-android-warnings.patch 533 SHA256 a23ed96c74fd35b45d3dd89c47a348cc5c992857a582e29506894677f4aa2922 SHA512 e9844d0c7fc93ed9ae9a63eba2eb737f9955c37e26e2c27e9c8ea71e098a3242d7ccc26319cfce361003b90f9831da357004567e398f4cecca2d838dc75632d8 WHIRLPOOL 66fba16af59210e19f286573538c34adb17b1228aeb6f53138a221d5754c007482487be3d8120241ac9b4184fb42029f17956e592ed1f4074ac4b830e1a3ce15 +DIST i2psource_0.8.7.tar.bz2 18473515 SHA256 31acef3fcd1a5839edc3b931f108944222c833d218bd427fe89a57b4acd92ece SHA512 32b4eb4bf8bc7d6bb692b3ecd6b0a34c4d3d7c94b0d09a4ff330151979ccdaca9a6c88fef9b7e7965a1bba8ef54dbb710d89e0bb19265ee177ce547ff50ca969 WHIRLPOOL 677e4fe07d659c8fbfcf5f81aae21e0b9d32d45f7885b628544033746db35c74f0bb37d76032565b0539e6e790b1445788f0a06942db9154bd77d65834967271 +DIST nativebiginteger-0.6.4.tar.bz2 10248 SHA256 ef36fb57c1d885164f00b3e5d239c22349a530fa20df652efc5cb1f1ccea2c32 SHA512 626f036fbde09e22f44b7d2fdf64c0e0ce8a86aabc3d68512f0bdd83fc909404a1a50b76633abaa3a4db69dcb1e913f6d5665812595eecadae6a7be24646e0cf WHIRLPOOL 7fdfa1cd561d8978c6f987b417111d4c6f76d80301d9ee56e219607f0be7233398f1adc2fa5d2df6c386b92edac62ef133408e4382f435d083d7270c4835a8fb +EBUILD nativebiginteger-0.6.4-r3.ebuild 735 SHA256 c47e307d54f108d30aab5ef109924a37281dced04881e063a61a647590da8b7d SHA512 79bcd854a99252595891989a79728552ed96b8023a2501e7c894da13b3133faccaac7fa32117f7b36f14ff2ecdbeadaea6dac069a9739697aa5730294af7fb8a WHIRLPOOL 1df2ac7b1908b2c0dac503f3995b21e1847f83fc7d32b42052d550847c9dfa1cc4efbc9088655e4c727376c15b13a8699e76763bcaec91af00ca071ddf56b409 +EBUILD nativebiginteger-0.6.4.ebuild 656 SHA256 9b6b66da9bd26ed56b1578d8104548b66cc28537a319207b16702e93d3e64973 SHA512 cff056c3142a32c5310d5a32bdbeef02965e73a01c91d4675cd84e4689df3bd8741fd67ee6bb40fcf9c55df7647691a6bd7fd0458fb53376b46373151cbf43af WHIRLPOOL cec0dc5352395a977c18590c5eaebe96c645cf48ad18b0bd3810aa594bfb57c79182c1db90e36518a82a5a5617033bbc47ff4a4a534a00834101bf2bc9f06dcf +EBUILD nativebiginteger-0.8.7.ebuild 1762 SHA256 258d0849e7d7fc884e761029661716895b103a5501955ba3f59a5f178e2f83bf SHA512 ac3db2f92711d7f191556ddba481d426ba713da911bebe1a7ba96f66a42bf4718b12ed3e9529f9fd32564459e5c0b76f0e66410e8f9cae371b6b1f6abdee30f3 WHIRLPOOL f48e693456582b8eccc4bac5282e2c978c0a1bc082860f4f1039eb95cb2c112dc4b00e9ed4007f121ae5080a58d9f7e8908e2875a550b0ee55dc67a9a505271e +MISC ChangeLog 3103 SHA256 008222a8d417db89c36e4db2f1b07caeed9c725564d6eb429ec3b170d7415793 SHA512 8e72beb033f4e514811cebd8c03ed83a06da674701d4d448abbb80a21e47d676073d6ebec60d4f6a9f582d86398c0902c78ed7ac341c28186bfa1656a8fa3fc3 WHIRLPOOL f184fd6ee5b58debb38121bbe0c2f217fc29dba8810fed2f47d1cd5674028b4b7f32f3083a11871394fd20d5067a8e037fef87b1c236c70e345aab7b106c1180 +MISC ChangeLog-2015 2211 SHA256 8c2efa8c50a92a3ed9cc254f0f2a9ed9505bd46bdaa85bf0ce757dfbc5101c19 SHA512 f5df66f2fb1f0034b58a38da93004bb8401d64acd83845b493d03ba6ece87140b2c8d652378fed40484cb8fdd6375ca09f1a63c2c2b443a9ddaeb007ddffe8ce WHIRLPOOL b20cd66eb71137171aefb038ad8c4957442b94f9a718518b1a79d882548534ee20471777cca0c478641ef35df665a0fd7852e77e4d0d2ef86c5e8b527966eac3 +MISC metadata.xml 256 SHA256 b1fcbeb75e9059c70100ccf278d492d9d2678ba93411e576ae760b3f308675cb SHA512 26e53ead25d8fef36a3759518b200c6a4ea0fc24d2c1f054ed85772cba5644118b231438d723ca25c22a55ed2fcf54e2c467279c9f3b49b6c1ced9997e3f098c WHIRLPOOL 25a36b6972f88def1dae7e912650b8fe3a0383d551c4a57967e1b8f80cde478e680e30c034f0481366f2da1d38a10e092ab4392902fa1b7f93cd801bb3f46dfa diff --git a/net-libs/nativebiginteger/files/nativebiginteger-0.6.4-asmfix.patch b/net-libs/nativebiginteger/files/nativebiginteger-0.6.4-asmfix.patch new file mode 100644 index 000000000000..04cfa599413a --- /dev/null +++ b/net-libs/nativebiginteger/files/nativebiginteger-0.6.4-asmfix.patch @@ -0,0 +1,31 @@ +--- jcpuid/src/jcpuid.c 2008-10-06 09:44:53.000000000 -0400 ++++ jcpuid/src/jcpuid.c.new2 2010-12-27 09:41:53.000000000 -0500 +@@ -19,6 +19,7 @@ + mov d, edx + } + #else ++ #ifdef _LP64 + //Use GCC assembler notation + asm + ( +@@ -29,6 +30,20 @@ + "=d"(d) + :"a"(iFunction) + ); ++ #elif defined(__i386__) ++ asm ++ ( ++ "pushl %%ebx\n\t" ++ "cpuid\n\t" ++ "movl %%ebx, %%edi\n\t" ++ "popl %%ebx" ++ : "=a" (a), ++ "=D" (b), ++ "=c" (c), ++ "=d" (d) ++ :"a"(iFunction) ++ ); ++ #endif + #endif + return (*env)->NewObject(env, clsResult,constructor,a,b,c,d); + } diff --git a/net-libs/nativebiginteger/files/nativebiginteger-0.6.4-ldflags.patch b/net-libs/nativebiginteger/files/nativebiginteger-0.6.4-ldflags.patch new file mode 100644 index 000000000000..5d3c84cd641e --- /dev/null +++ b/net-libs/nativebiginteger/files/nativebiginteger-0.6.4-ldflags.patch @@ -0,0 +1,17 @@ +--- Makefile 2008-11-06 21:09:54.000000000 +0100 ++++ Makefile.new 2010-12-27 14:26:45.000000000 +0100 +@@ -1,11 +1,11 @@ + libjbigi: + cd jbigi && rm -f jbigi.o libjbigi.so && $(CC) $(CFLAGS) -c -I. -Ijbigi/include -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux \ +- jbigi/src/jbigi.c && $(CC) -shared -Wl,-soname,libjbigi.so -I. -Ijbigi/include -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux -lgmp \ +- -o libjbigi.so jbigi.o ++ jbigi/src/jbigi.c && $(CC) ${LDFLAGS} -shared -Wl,-soname,libjbigi.so jbigi.o -I. -Ijbigi/include -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux -lgmp \ ++ -o libjbigi.so + + + libjcpuid: +- cd jcpuid && $(CC) $(CFLAGS) -shared -Wl,-soname,libjbigi-x86-linux.so -I. -Iinclude -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux \ ++ cd jcpuid && $(CC) $(CFLAGS) ${LDFLAGS} -shared -Wl,-soname,libjbigi-x86-linux.so -I. -Iinclude -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux \ + src/*.c -o libjcpuid-x86-linux.so + + install: diff --git a/net-libs/nativebiginteger/files/nativebiginteger-0.8.7-asmfix.patch b/net-libs/nativebiginteger/files/nativebiginteger-0.8.7-asmfix.patch new file mode 100644 index 000000000000..3443a91c288b --- /dev/null +++ b/net-libs/nativebiginteger/files/nativebiginteger-0.8.7-asmfix.patch @@ -0,0 +1,31 @@ +--- c/jcpuid/src/jcpuid.c 2008-10-06 09:44:53.000000000 -0400 ++++ c/jcpuid/src/jcpuid.c.new2 2010-12-27 09:41:53.000000000 -0500 +@@ -19,6 +19,7 @@ + mov d, edx + } + #else ++ #ifdef _LP64 + //Use GCC assembler notation + asm + ( +@@ -29,6 +30,20 @@ + "=d"(d) + :"a"(iFunction) + ); ++ #elif defined(__i386__) ++ asm ++ ( ++ "pushl %%ebx\n\t" ++ "cpuid\n\t" ++ "movl %%ebx, %%edi\n\t" ++ "popl %%ebx" ++ : "=a" (a), ++ "=D" (b), ++ "=c" (c), ++ "=d" (d) ++ :"a"(iFunction) ++ ); ++ #endif + #endif + return (*env)->NewObject(env, clsResult,constructor,a,b,c,d); + } diff --git a/net-libs/nativebiginteger/files/nativebiginteger-0.8.7-build-system.patch b/net-libs/nativebiginteger/files/nativebiginteger-0.8.7-build-system.patch new file mode 100644 index 000000000000..ea298b5d0358 --- /dev/null +++ b/net-libs/nativebiginteger/files/nativebiginteger-0.8.7-build-system.patch @@ -0,0 +1,22 @@ +--- i2p-0.8.7/core/c/jbigi/build_jbigi.sh.orig 2011-07-29 11:52:43.000000000 +0200 ++++ i2p-0.8.7/core/c/jbigi/build_jbigi.sh 2011-07-29 11:53:43.000000000 +0200 +@@ -3,8 +3,8 @@ + # When executed in Linux/FreeBSD: Produces an libjbigi.so + # Darwin produces libjbigi.jnilib, right? + +-CC="gcc" ++test -z "$CC" && CC="gcc" + + case `uname -sr` in + MINGW*) + JAVA_HOME="c:/software/j2sdk1.4.2_05" +@@ -57,5 +55,7 @@ + + echo "Compiling C code..." + rm -f jbigi.o $LIBFILE +-$CC -c $COMPILEFLAGS $INCLUDES ../../jbigi/src/jbigi.c +-$CC $LINKFLAGS $INCLUDES $INCLUDELIBS -o $LIBFILE jbigi.o $STATICLIBS ++echo $CC -c $COMPILEFLAGS $CFLAGS $CPPFLAGS $INCLUDES ../../jbigi/src/jbigi.c ++$CC -c $COMPILEFLAGS $CFLAGS $CPPFLAGS $INCLUDES ../../jbigi/src/jbigi.c ++echo $CC $LINKFLAGS $LDFLAGS $INCLUDES -o $LIBFILE jbigi.o $STATICLIBS $INCLUDELIBS ++$CC $LINKFLAGS $LDFLAGS $INCLUDES -o $LIBFILE jbigi.o $STATICLIBS $INCLUDELIBS diff --git a/net-libs/nativebiginteger/files/nativebiginteger-0.8.7-debug-all.patch b/net-libs/nativebiginteger/files/nativebiginteger-0.8.7-debug-all.patch new file mode 100644 index 000000000000..07dd05227582 --- /dev/null +++ b/net-libs/nativebiginteger/files/nativebiginteger-0.8.7-debug-all.patch @@ -0,0 +1,35 @@ +--- core/java/src/net/i2p/util/NativeBigInteger.java.orig 2011-07-29 13:14:05.000000000 +0200 ++++ core/java/src/net/i2p/util/NativeBigInteger.java 2011-07-29 13:15:16.000000000 +0200 +@@ -481,14 +481,12 @@ + + /** @since 0.8.7 */ + private static void debug(String s) { +- I2PAppContext.getGlobalContext().logManager().getLog(NativeBigInteger.class).debug(s); ++ System.err.println("DEBUG: " + s); + } + + + private static void info(String s) { +- if(_doLog) +- System.err.println("INFO: " + s); +- I2PAppContext.getGlobalContext().logManager().getLog(NativeBigInteger.class).info(s); ++ System.err.println("INFO: " + s); + _loadStatus = s; + } + +@@ -496,12 +496,9 @@ + + /** @since 0.8.7 */ + private static void warn(String s, Throwable t) { +- if(_doLog) { +- System.err.println("WARNING: " + s); +- if (t != null) +- t.printStackTrace(); +- } +- I2PAppContext.getGlobalContext().logManager().getLog(NativeBigInteger.class).warn(s, t); ++ System.err.println("WARNING: " + s); ++ if (t != null) ++ t.printStackTrace(); + if (t != null) + _loadStatus = s + ' ' + t; + else diff --git a/net-libs/nativebiginteger/files/nativebiginteger-0.8.7-jcpuid-build-system.patch b/net-libs/nativebiginteger/files/nativebiginteger-0.8.7-jcpuid-build-system.patch new file mode 100644 index 000000000000..a4020a012b98 --- /dev/null +++ b/net-libs/nativebiginteger/files/nativebiginteger-0.8.7-jcpuid-build-system.patch @@ -0,0 +1,23 @@ +--- i2p-0.8.7/core/c/jcpuid/build.sh.orig 2011-07-29 18:38:44.554000219 +0200 ++++ i2p-0.8.7/core/c/jcpuid/build.sh 2011-07-29 18:38:13.789000172 +0200 +@@ -24,8 +24,8 @@ + mkdir lib/freenet/support + mkdir lib/freenet/support/CPUInformation + +-CC="gcc" ++test -z "$CC" && CC="gcc" + + case `uname -sr` in + MINGW*) + JAVA_HOME="/c/software/j2sdk1.4.2_05" +@@ -50,8 +52,8 @@ + + echo "Compiling C code..." + rm -f $LIBFILE +-$CC $COMPILEFLAGS $LINKFLAGS $INCLUDES src/*.c -o $LIBFILE +-strip $LIBFILE ++echo $CC $COMPILEFLAGS $CPPFLAGS $CFLAGS $LINKFLAGS $LDFLAGS $INCLUDES src/*.c -o $LIBFILE ++$CC $COMPILEFLAGS $CPPFLAGS $CFLAGS $LINKFLAGS $LDFLAGS $INCLUDES src/*.c -o $LIBFILE + echo Built $LIBFILE + + #g++ -shared -static -static-libgcc -Iinclude -I$JAVA_HOME/include \ diff --git a/net-libs/nativebiginteger/files/nativebiginteger-0.8.7-non-android-warnings.patch b/net-libs/nativebiginteger/files/nativebiginteger-0.8.7-non-android-warnings.patch new file mode 100644 index 000000000000..6240d25bcd9b --- /dev/null +++ b/net-libs/nativebiginteger/files/nativebiginteger-0.8.7-non-android-warnings.patch @@ -0,0 +1,11 @@ +--- core/java/src/net/i2p/util/NativeBigInteger.java.orig 2011-07-29 13:22:39.000000000 +0200 ++++ core/java/src/net/i2p/util/NativeBigInteger.java 2011-07-29 13:22:55.000000000 +0200 +@@ -526,7 +526,7 @@ + System.loadLibrary(name); + return true; + } catch (UnsatisfiedLinkError ule) { +- if (_isAndroid) { ++ if (!_isAndroid) { + // Unfortunately, + // this is not interesting on Android, it says "file not found" + // on link errors too. diff --git a/net-libs/nativebiginteger/metadata.xml b/net-libs/nativebiginteger/metadata.xml new file mode 100644 index 000000000000..3800f75787af --- /dev/null +++ b/net-libs/nativebiginteger/metadata.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>tommy@gentoo.org</email> + <name>Thomas Sachau (Tommy[D])</name> + </maintainer> +</pkgmetadata> diff --git a/net-libs/nativebiginteger/nativebiginteger-0.6.4-r3.ebuild b/net-libs/nativebiginteger/nativebiginteger-0.6.4-r3.ebuild new file mode 100644 index 000000000000..51dda3f1547b --- /dev/null +++ b/net-libs/nativebiginteger/nativebiginteger-0.6.4-r3.ebuild @@ -0,0 +1,35 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=2 + +inherit flag-o-matic multilib toolchain-funcs java-pkg-2 + +DESCRIPTION="NativeBigInteger libs for Freenet taken from i2p" +HOMEPAGE="http://www.i2p2.de" +SRC_URI="mirror://gentoo/${P}.tar.bz2" + +LICENSE="|| ( public-domain BSD MIT )" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +DEPEND="dev-libs/gmp + >=virtual/jdk-1.4" +RDEPEND="dev-libs/gmp" + +src_prepare() { + epatch "${FILESDIR}"/${P}-{asmfix,ldflags}.patch +} + +src_compile() { + append-flags -fPIC + tc-export CC + emake libjbigi || die + use x86 && filter-flags -fPIC -nopie + emake libjcpuid || die +} + +src_install() { + emake DESTDIR="${D}" LIBDIR=$(get_libdir) install || die +} diff --git a/net-libs/nativebiginteger/nativebiginteger-0.6.4.ebuild b/net-libs/nativebiginteger/nativebiginteger-0.6.4.ebuild new file mode 100644 index 000000000000..f390ec4e68f9 --- /dev/null +++ b/net-libs/nativebiginteger/nativebiginteger-0.6.4.ebuild @@ -0,0 +1,29 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +inherit flag-o-matic multilib toolchain-funcs java-pkg-2 + +DESCRIPTION="NativeBigInteger libs for Freenet taken from i2p" +HOMEPAGE="http://www.i2p2.de" +SRC_URI="mirror://gentoo/${P}.tar.bz2" + +LICENSE="|| ( public-domain BSD MIT )" +SLOT="0" +KEYWORDS="amd64 x86" +IUSE="" + +DEPEND="dev-libs/gmp + >=virtual/jdk-1.4" +RDEPEND="dev-libs/gmp" + +src_compile() { + append-flags -fPIC + tc-export CC + emake libjbigi || die + use x86 && filter-flags -fPIC -nopie + emake libjcpuid || die +} + +src_install() { + emake DESTDIR="${D}" LIBDIR=$(get_libdir) install || die +} diff --git a/net-libs/nativebiginteger/nativebiginteger-0.8.7.ebuild b/net-libs/nativebiginteger/nativebiginteger-0.8.7.ebuild new file mode 100644 index 000000000000..15616b668c43 --- /dev/null +++ b/net-libs/nativebiginteger/nativebiginteger-0.8.7.ebuild @@ -0,0 +1,67 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=4 + +inherit eutils toolchain-funcs multilib java-pkg-2 + +DESCRIPTION="jbigi JNI library for net.i2p.util.NativeBigInteger java-class from I2P" +HOMEPAGE="http://www.i2p2.de" +SRC_URI="http://mirror.i2p2.de/i2psource_${PV}.tar.bz2" + +LICENSE="|| ( public-domain BSD MIT )" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +IUSE="test" + +DEPEND="${RDEPEND} + >=virtual/jdk-1.5" +RDEPEND="dev-libs/gmp" + +S=${WORKDIR}/i2p-${PV}/core/ + +src_prepare() { + epatch "${FILESDIR}/${P}"-build-system.patch \ + "${FILESDIR}/${P}"-jcpuid-build-system.patch \ + "${FILESDIR}/${P}"-debug-all.patch \ + "${FILESDIR}/${P}"-non-android-warnings.patch \ + "${FILESDIR}/${P}"-asmfix.patch +} + +src_compile() { + tc-export CC + + cd c/jbigi/jbigi/src || die + ../../build_jbigi.sh dynamic || die + + if use test ; then + einfo "Building tests ..." + cd "${S}"java/src || die + ejavac net/i2p/util/NativeBigInteger.java || die + eend $? + fi + if ( use amd64 || use x86 ) ; then + cd "${S}"c/jcpuid + ./build.sh || die + fi +} + +src_test() { + cd java/src || die + java -Djava.library.path="${S}"/c/jbigi/jbigi/src net/i2p/util/NativeBigInteger || die +} + +src_install() { + local os arch + + dolib c/jbigi/jbigi/src/libjbigi.so + ( use amd64 || use x86 ) && dolib c/jcpuid/lib/freenet/support/CPUInformation/libjcpuid-x86-linux.so + + ## The following is needed for compatibility with earlier versions of NativeBigInteger ## + + # arch list found by "none" + grep 'JBIGI_OPTIMIZATION_.*=' core/java/src/net/i2p/util/NativeBigInteger.java + for arch in none arm k6 k62 k63 athlon x86_64 x86_64_32 pentium pentiummmx pentium2 pentium3 pentium4 ppc ; do + dosym libjbigi.so /usr/$(get_libdir)/libjbigi-linux-$arch.so + done +} |