diff options
Diffstat (limited to 'net-libs/nativebiginteger')
12 files changed, 315 insertions, 0 deletions
diff --git a/net-libs/nativebiginteger/Manifest b/net-libs/nativebiginteger/Manifest new file mode 100644 index 000000000000..3625af31b677 --- /dev/null +++ b/net-libs/nativebiginteger/Manifest @@ -0,0 +1,2 @@ +DIST i2psource_0.8.7.tar.bz2 18473515 RMD160 545e72fab13d6f6ca660b5b74d86648a9160a000 SHA1 61727b1b745d7cd882268300c7913dfd13b9f612 SHA256 31acef3fcd1a5839edc3b931f108944222c833d218bd427fe89a57b4acd92ece +DIST nativebiginteger-0.6.4.tar.bz2 10248 RMD160 a7ac7832371c74a1e9592a9abd1b6d5ef40a360a SHA1 37b433b3a7a2cf818a7ca3713548153f63da3817 SHA256 ef36fb57c1d885164f00b3e5d239c22349a530fa20df652efc5cb1f1ccea2c32 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..fed3658eec53 --- /dev/null +++ b/net-libs/nativebiginteger/metadata.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer> + <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..17c1a3a3c0bc --- /dev/null +++ b/net-libs/nativebiginteger/nativebiginteger-0.6.4-r3.ebuild @@ -0,0 +1,36 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +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..72316feb8bdb --- /dev/null +++ b/net-libs/nativebiginteger/nativebiginteger-0.6.4.ebuild @@ -0,0 +1,30 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +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..a6ccf46e67f4 --- /dev/null +++ b/net-libs/nativebiginteger/nativebiginteger-0.8.7.ebuild @@ -0,0 +1,68 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +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 +} |