summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Sachau <tommy@gentoo.org>2011-07-31 18:20:59 +0000
committerThomas Sachau <tommy@gentoo.org>2011-07-31 18:20:59 +0000
commit96f701f0f8409a735cbc2a49b1a1f534d6fa8310 (patch)
tree3e5f64610a033518a02e3282b5e4a5d7f92eb521 /net-libs/nativebiginteger
parentVersion bump. (diff)
downloadgentoo-2-96f701f0f8409a735cbc2a49b1a1f534d6fa8310.tar.gz
gentoo-2-96f701f0f8409a735cbc2a49b1a1f534d6fa8310.tar.bz2
gentoo-2-96f701f0f8409a735cbc2a49b1a1f534d6fa8310.zip
Version bump, partly based on ebuilds by Dennis Schridde, fixes bug 376971
(Portage version: 2.2.0_alpha47-r1/cvs/Linux x86_64)
Diffstat (limited to 'net-libs/nativebiginteger')
-rw-r--r--net-libs/nativebiginteger/ChangeLog14
-rw-r--r--net-libs/nativebiginteger/files/nativebiginteger-0.8.7-asmfix.patch31
-rw-r--r--net-libs/nativebiginteger/files/nativebiginteger-0.8.7-build-system.patch22
-rw-r--r--net-libs/nativebiginteger/files/nativebiginteger-0.8.7-debug-all.patch35
-rw-r--r--net-libs/nativebiginteger/files/nativebiginteger-0.8.7-jcpuid-build-system.patch23
-rw-r--r--net-libs/nativebiginteger/files/nativebiginteger-0.8.7-non-android-warnings.patch11
-rw-r--r--net-libs/nativebiginteger/nativebiginteger-0.8.7.ebuild75
7 files changed, 209 insertions, 2 deletions
diff --git a/net-libs/nativebiginteger/ChangeLog b/net-libs/nativebiginteger/ChangeLog
index 0f4a9487283e..a27079e4dcfb 100644
--- a/net-libs/nativebiginteger/ChangeLog
+++ b/net-libs/nativebiginteger/ChangeLog
@@ -1,6 +1,16 @@
# ChangeLog for net-libs/nativebiginteger
-# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-libs/nativebiginteger/ChangeLog,v 1.6 2010/12/28 12:34:30 tommy Exp $
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-libs/nativebiginteger/ChangeLog,v 1.7 2011/07/31 18:20:59 tommy Exp $
+
+*nativebiginteger-0.8.7 (31 Jul 2011)
+
+ 31 Jul 2011; Thomas Sachau (Tommy[D]) <tommy@gentoo.org>
+ +nativebiginteger-0.8.7.ebuild, +files/nativebiginteger-0.8.7-asmfix.patch,
+ +files/nativebiginteger-0.8.7-build-system.patch,
+ +files/nativebiginteger-0.8.7-debug-all.patch,
+ +files/nativebiginteger-0.8.7-jcpuid-build-system.patch,
+ +files/nativebiginteger-0.8.7-non-android-warnings.patch:
+ Version bump, partly based on ebuilds by Dennis Schridde, fixes bug 376971
*nativebiginteger-0.6.4-r3 (28 Dec 2010)
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/nativebiginteger-0.8.7.ebuild b/net-libs/nativebiginteger/nativebiginteger-0.8.7.ebuild
new file mode 100644
index 000000000000..4e05cf43f626
--- /dev/null
+++ b/net-libs/nativebiginteger/nativebiginteger-0.8.7.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-libs/nativebiginteger/nativebiginteger-0.8.7.ebuild,v 1.1 2011/07/31 18:20:59 tommy Exp $
+
+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 || die
+ ( use amd64 || use x86 ) && dolib c/jcpuid/lib/freenet/support/CPUInformation/libjcpuid-x86-linux.so || die
+
+ ## The following is needed for compatibility with earlier versions of NativeBigInteger ##
+
+ # os list found by: grep 'jbigi-' core/java/src/net/i2p/util/NativeBigInteger.java
+ case ${CHOST} in
+ *-fbsd) os=freebsd ;;
+ *-darwin) os=osx ;;
+ *-mingw*|*-cygwin) os=windows ;;
+ *) os=linux ;;
+ esac
+ # 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-$os-$arch.so || die
+ done
+}