summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2015-02-23 21:46:54 +0000
committerAnthony G. Basile <blueness@gentoo.org>2015-02-23 21:46:54 +0000
commitd04e43d68236e69f6258829157783f45debef650 (patch)
tree763f72aaed980998fffcd2fbf1194583b8576415 /dev-libs/libsecp256k1
parentVersion bumps using bitcoincore.eclass (diff)
downloadhistorical-d04e43d68236e69f6258829157783f45debef650.tar.gz
historical-d04e43d68236e69f6258829157783f45debef650.tar.bz2
historical-d04e43d68236e69f6258829157783f45debef650.zip
Add 0.0.0_pre20141212 for libbitcoinconsensus
Package-Manager: portage-2.2.14/cvs/Linux x86_64 Manifest-Sign-Key: 0xF52D4BBA
Diffstat (limited to 'dev-libs/libsecp256k1')
-rw-r--r--dev-libs/libsecp256k1/ChangeLog11
-rw-r--r--dev-libs/libsecp256k1/Manifest31
-rw-r--r--dev-libs/libsecp256k1/files/20141212-fixes.patch289
-rw-r--r--dev-libs/libsecp256k1/libsecp256k1-0.0.0_pre20141212.ebuild74
4 files changed, 388 insertions, 17 deletions
diff --git a/dev-libs/libsecp256k1/ChangeLog b/dev-libs/libsecp256k1/ChangeLog
index ddd613e64e0c..cb2ce6403ad8 100644
--- a/dev-libs/libsecp256k1/ChangeLog
+++ b/dev-libs/libsecp256k1/ChangeLog
@@ -1,7 +1,12 @@
# ChangeLog for dev-libs/libsecp256k1
-# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-libs/libsecp256k1/ChangeLog,v 1.1 2014/11/21 11:42:50 blueness Exp $
+# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/libsecp256k1/ChangeLog,v 1.2 2015/02/23 21:46:44 blueness Exp $
+
+*libsecp256k1-0.0.0_pre20141212 (23 Feb 2015)
+
+ 23 Feb 2015; Anthony G. Basile <blueness@gentoo.org>
+ +files/20141212-fixes.patch, +libsecp256k1-0.0.0_pre20141212.ebuild:
+ Add 0.0.0_pre20141212 for libbitcoinconsensus
21 Nov 2014; Anthony G. Basile <blueness@gentoo.org> ChangeLog:
Initial commit, needed for bitcoins
-
diff --git a/dev-libs/libsecp256k1/Manifest b/dev-libs/libsecp256k1/Manifest
index 6dd0d9e0f62e..d7436565b2af 100644
--- a/dev-libs/libsecp256k1/Manifest
+++ b/dev-libs/libsecp256k1/Manifest
@@ -1,23 +1,26 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
+AUX 20141212-fixes.patch 9161 SHA256 e61d4f94ed932095cd8bbe0624d7776c31ab7e67d1399e3b84361d4e580145ec SHA512 bb96b393834f0b717f1914f00d6a1506b2cc9593a02a91e7747230153d19a7950245767784307c926ee31ffa36e150ff34cecd1088f842d2c0e933479f1ca70d WHIRLPOOL b515a0be56770e05bb8fe149e0dafa2efa45f3ccd3ecf29b03fea06acb1f32a381bf1b619a20ffb68c408265f840e1fdf7dc183aabfaeac18d99a8609e31dc26
+DIST secp256k1-v0.0.0_pre20141212.tgz 60007 SHA256 f5d3a7cac425caf64040395d99c1a91ab2ca1c973b228a66772ba4a290f355ce SHA512 ab2a211c1bf882ebb62e78891e4e12c3ed7244d46d532e37ff2a669ba08db8dcafec7b4c57c073310e463957fd2fa0dffb940c4f35b61890cb8ce86d4283f0f6 WHIRLPOOL 3aa8b7545ca24028ceb17e770fdbf997e2895212ec25a193fcd926660e78f16d704bf27a5b1aa7cf3cabe643c33b128bf0b0568172c15833eb82fcc58e5941c1
+EBUILD libsecp256k1-0.0.0_pre20141212.ebuild 1435 SHA256 c9bc600cf6780a68d4a3040d2455f4aee8b50475d32c5f6bcce85bffbce6a9d5 SHA512 52e7abbe7dc7d80a20eac16b453053fe330f79f648d038d91bff8a246c12f44788bc714070845dc547e2603aec6db9217fedfd11ea087d499a54adc37dc3b16e WHIRLPOOL 82539875edb15124149fbf56ff448a5c5604a9b5e05a2a849a5570c6976e9f83a0ade7abc9250d119d697287c6cbf61545baf375d9822535c97a62f13be357ce
EBUILD libsecp256k1-9999.ebuild 1077 SHA256 51014b59f96489d479b28ee86706a683c54cae335756efda953600ca12fe11d5 SHA512 aa5e4ba85451a21557235672d2965be6801f756f830fe6c8bfecd9c2c1c4221479c101820ba5cbfad568765a943d82f6ac23d07687523469efcb19166ecc3b4d WHIRLPOOL 882844f6526886bf275ee31b126d71fc50137e595646b8aa1acafee3c40b11af58853fb7306005ac0412d2779a9650727241f072bf6557b71c55507fce797e54
-MISC ChangeLog 322 SHA256 440da84cd8b6ff1d4deecea0ddca5974def0ebd950f74ab13056c2e729ec86c7 SHA512 7c84bead3a99a7d445496f30af3affa6d88e0d714f17cd3ff2203d7d517f5fd84e03f2fd89347b61d5f029d1c13e88b79a5b590ca0a42d39c5b99e402a3bcf73 WHIRLPOOL 36a150cc9d9b8f748de5fb27d9e802d0aa7856c468dd9c874bd9afc0dd9daee8883ac8d1b642a5f1d7d316db6d05b668db9c27cd7353f21dfdd793e4047ca815
+MISC ChangeLog 543 SHA256 49d4473bc4286bc90bbfae8425562b6e57acce9c6a6e0cc3e38b4513b4c972ab SHA512 b7b6e58e23ff46ae01d73dc256aa1645834752f3e60c391794ae3a709a347be54ae36584e4f1f8d06bb89ada22ff608dc459fd7bf849c49c3c2c7fed82fbd7fb WHIRLPOOL daa0a27525a1677bf61986170269f8d4faad18cb997c061e36ac06ff8fcddfefa985a731b9453655ad7acbc154a6a692439ab34fcca03407a66f5a28dfd21e65
MISC metadata.xml 506 SHA256 8dbfe75a466694784cec4fb30094e34fd965e96acd271e148c310f99cdfafb17 SHA512 60b88ffe37d8386994a3ff29ed9df9510fec20c19f4b285307b87676127c3a462d1bfcd271ab01bd6d66d42f95d25059dc6f996dac7ef99ffd86495200a52c9c WHIRLPOOL f9056bfb8a57809ce340f42c66a12d044c2873abd230aed65ff6e62d5fc2e3fca2d0fb3d94a50aad971d19702ee98babd59a714639d4499e51d92db3ebfec698
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
-iQIcBAEBCAAGBQJUbyXdAAoJEJOE+m71LUu6sZ4P/1n1fZaVWv9DJlFDRFN+dXke
-a77KwVovCcxvB7RkQqjCEgaNR9u7HqKrZDsYTiNVRVKY179a+SuEZC7drWNCjan7
-uUAKrkja+i4OK68vviLdnNgTAgBhi1RwxNq6fg0ltnpaAxxqftZqUGD5qNlAShvK
-YGefo2CPhhP9Opx4zOJrYOJJJ5rvbyNveQvT1hz0YZgkxWHEKA3cZEDhNuRR9crb
-BAXtZlrBo72BBly17faqbFF+ke4nHuBJRdVwMnn5Pr00VJKG2c6wZVqAuoW87oV7
-Ex1lzzM1xqGu2uAOzGdJF+aLoSf7NQGAYbyydUXZjPhrRt0B2AYlEsmMJsVkIoiQ
-81BN9HgOkuCdCqwz5dllJJR/YlPakqEsexXdXiPTghCJ2sd6nhVRWoFPix82rzB8
-dTRv5lWqeK+L0lOgi54XKCIlrqJF8gNv5M+BC/+TMKBOSc3846ceKqgdkp4XU6+f
-b5Qx8XrQg3bFl+D4rqHTPfC27GY2MHosq00+zziItZ2IYkGEpayIf/3qE4u+VNQG
-WjhSf+4opuJCNUjl8+HICejUZrup4YyTXWoikhzOVCHyDvQVCDEFPIXzsNYMQDuN
-UKYYWgmwk3TmVDnXqVchF/TZ6PwYH5gTR8whNc6Rs3hWTWplLrOBNZtUve2OhfsU
-5jM1CAI51Xl5tW60mjDW
-=RC2i
+iQIcBAEBCAAGBQJU66AxAAoJEJOE+m71LUu6YlsP/2buoVl2+EI8ej2YrcjqhE+B
+c6IxmI4drqjiHE7YN5u51aKat9o0zhgE2bhqZ2PHtfQ6SpWK6dTjkmmPVMPGcN4A
+CMI4b+o9Lv1TiiGugxgRzbneV+KkjtzvRWkVbtgdlti6N+Ke0aFpxwyeYpyt7dTH
+y6kL8vY94MizMtnmXFG0nihdFsS1pAdJhwfIAdn0INdpNPG6wuoDlcDWIZy2iqQx
+pEGIYRZvkHKDEcoZ/M3dRO4l8FO17Z0IPiW9xH8KynObSIW+q1ifKydx4S9j6LkH
+n5fhLBh8H6pzE3uafWftzdmK0ogO4TtWQa8S9ydLOy8WFgnnywUaEgzb96cfDa5b
+ANPCkMLo9mQaqAFEiMzz1eE2fSxA4JB3VWdyNxEIW8pBsLJxc4PPiM5ptCkQTRxW
+WC5VERlXztQOTYekTq28f6odJLSkxftTFUFyuhcA9SugWcEulR8x1ibXhURLdy1x
+kR5YtUr7OZC4wZXjtz0pDw/jkVUf/Ad2pxZNTBUqbVMQ19e5OtQzFbU7FJtyYE7K
+34kPxuUPT7po+Me8xuKTXqX5P+ik2CAcISttTc7R0icPj83LSsYc3yTiUF7j+mNT
+ruInHNGacU/Th9VVIYq2/4ebfwp6R+QgPe5rx5zrhbrybdeH7QE8/9trX7mVKQ+e
+EQ57dmDu/rFf64A/GUsU
+=yiTQ
-----END PGP SIGNATURE-----
diff --git a/dev-libs/libsecp256k1/files/20141212-fixes.patch b/dev-libs/libsecp256k1/files/20141212-fixes.patch
new file mode 100644
index 000000000000..f8cb27436853
--- /dev/null
+++ b/dev-libs/libsecp256k1/files/20141212-fixes.patch
@@ -0,0 +1,289 @@
+diff --git a/build-aux/m4/bitcoin_secp.m4 b/build-aux/m4/bitcoin_secp.m4
+index 1373478..4a398d6 100644
+--- a/build-aux/m4/bitcoin_secp.m4
++++ b/build-aux/m4/bitcoin_secp.m4
+@@ -1,12 +1,6 @@
+ dnl libsecp25k1 helper checks
+ AC_DEFUN([SECP_INT128_CHECK],[
+ has_int128=$ac_cv_type___int128
+-if test x"$has_int128" != x"yes" && test x"$set_field" = x"64bit"; then
+- AC_MSG_ERROR([$set_field field support explicitly requested but is not compatible with this host])
+-fi
+-if test x"$has_int128" != x"yes" && test x"$set_scalar" = x"64bit"; then
+- AC_MSG_ERROR([$set_scalar scalar support explicitly requested but is not compatible with this host])
+-fi
+ ])
+
+ dnl
+@@ -18,11 +12,6 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ __asm__ __volatile__("movq $0x100000000,%1; mulq %%rsi" : "+a"(a) : "S"(tmp) : "cc", "%rdx");
+ ]])],[has_64bit_asm=yes],[has_64bit_asm=no])
+ AC_MSG_RESULT([$has_64bit_asm])
+-if test x"$set_field" == x"64bit_asm"; then
+- if test x"$has_64bit_asm" == x"no"; then
+- AC_MSG_ERROR([$set_field field support explicitly requested but no x86_64 assembly available])
+- fi
+-fi
+ ])
+
+ dnl
+@@ -43,7 +32,7 @@ else
+ )])
+ LIBS=
+ fi
+-if test x"$has_libcrypto" == x"yes" && test x"$has_openssl_ec" = x; then
++if test x"$has_libcrypto" = x"yes" && test x"$has_openssl_ec" = x; then
+ AC_MSG_CHECKING(for EC functions in libcrypto)
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #include <openssl/ec.h>
+@@ -69,11 +58,4 @@ if test x"$has_gmp" != x"yes"; then
+ CPPFLAGS="$CPPFLAGS_TEMP"
+ LIBS="$LIBS_TEMP"
+ fi
+-if test x"$set_field" = x"gmp" && test x"$has_gmp" != x"yes"; then
+- AC_MSG_ERROR([$set_field field support explicitly requested but libgmp was not found])
+-fi
+-if test x"$set_bignum" = x"gmp" && test x"$has_gmp" != x"yes"; then
+- AC_MSG_ERROR([$set_bignum field support explicitly requested but libgmp was not found])
+-fi
+ ])
+-
+diff --git a/configure.ac b/configure.ac
+index 40e121e..bd99013 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -23,7 +23,7 @@ if test "x$CFLAGS" = "x"; then
+ fi
+
+ AC_PROG_CC_C99
+-if test x"$ac_cv_prog_cc_c99" == x"no"; then
++if test x"$ac_cv_prog_cc_c99" = x"no"; then
+ AC_MSG_ERROR([c99 compiler support required])
+ fi
+
+@@ -96,15 +96,18 @@ AC_ARG_ENABLE(endomorphism,
+ [use_endomorphism=$enableval],
+ [use_endomorphism=no])
+
+-AC_ARG_WITH([field], [AS_HELP_STRING([--with-field=gmp|64bit|64bit_asm|32bit|auto],
++AC_ARG_WITH([field], [AS_HELP_STRING([--with-field=gmp|64bit|32bit|auto],
+ [Specify Field Implementation. Default is auto])],[req_field=$withval], [req_field=auto])
+
+-AC_ARG_WITH([bignum], [AS_HELP_STRING([--with-bignum=gmp|none|auto],
++AC_ARG_WITH([bignum], [AS_HELP_STRING([--with-bignum=gmp|no|auto],
+ [Specify Bignum Implementation. Default is auto])],[req_bignum=$withval], [req_bignum=auto])
+
+ AC_ARG_WITH([scalar], [AS_HELP_STRING([--with-scalar=64bit|32bit|auto],
+ [Specify scalar implementation. Default is auto])],[req_scalar=$withval], [req_scalar=auto])
+
++AC_ARG_WITH([asm], [AS_HELP_STRING([--with-asm=x86_64|no|auto]
++[Specify assembly optimizations to use. Default is auto])],[req_asm=$withval], [req_asm=auto])
++
+ AC_CHECK_TYPES([__int128])
+
+ AC_MSG_CHECKING([for __builtin_expect])
+@@ -113,40 +116,66 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[void myfunc() {__builtin_expect(0,0);}]])],
+ [ AC_MSG_RESULT([no])
+ ])
+
+-if test x"$req_field" = x"auto"; then
++if test x"$req_asm" = x"auto"; then
+ SECP_64BIT_ASM_CHECK
+ if test x"$has_64bit_asm" = x"yes"; then
+- set_field=64bit_asm
++ set_asm=x86_64
++ fi
++ if test x"$set_asm" = x; then
++ set_asm=no
+ fi
++else
++ set_asm=$req_asm
++ case $set_asm in
++ x86_64)
++ SECP_64BIT_ASM_CHECK
++ if test x"$has_64bit_asm" != x"yes"; then
++ AC_MSG_ERROR([x86_64 assembly optimization requested but not available])
++ fi
++ ;;
++ no)
++ ;;
++ *)
++ AC_MSG_ERROR([invalid assembly optimization selection])
++ ;;
++ esac
++fi
+
++if test x"$req_field" = x"auto"; then
++ if test x"set_asm" = x"x86_64"; then
++ set_field=64bit
++ fi
+ if test x"$set_field" = x; then
+ SECP_INT128_CHECK
+ if test x"$has_int128" = x"yes"; then
+ set_field=64bit
+ fi
+ fi
+-
+ if test x"$set_field" = x; then
+ SECP_GMP_CHECK
+ if test x"$has_gmp" = x"yes"; then
+ set_field=gmp
+ fi
+ fi
+-
+ if test x"$set_field" = x; then
+ set_field=32bit
+ fi
+ else
+ set_field=$req_field
+ case $set_field in
+- 64bit_asm)
+- SECP_64BIT_ASM_CHECK
+- ;;
+ 64bit)
+- SECP_INT128_CHECK
++ if test x"$set_asm" != x"x86_64"; then
++ SECP_INT128_CHECK
++ if test x"$has_int128" != x"yes"; then
++ AC_MSG_ERROR([64bit field explicitly requested but neither __int128 support or x86_64 assembly available])
++ fi
++ fi
+ ;;
+ gmp)
+ SECP_GMP_CHECK
++ if test x"$has_gmp" != x"yes"; then
++ AC_MSG_ERROR([gmp field explicitly requested but libgmp not available])
++ fi
+ ;;
+ 32bit)
+ ;;
+@@ -157,11 +186,9 @@ else
+ fi
+
+ if test x"$req_scalar" = x"auto"; then
+- if test x"$set_scalar" = x; then
+- SECP_INT128_CHECK
+- if test x"$has_int128" = x"yes"; then
+- set_scalar=64bit
+- fi
++ SECP_INT128_CHECK
++ if test x"$has_int128" = x"yes"; then
++ set_scalar=64bit
+ fi
+ if test x"$set_scalar" = x; then
+ set_scalar=32bit
+@@ -171,6 +198,9 @@ else
+ case $set_scalar in
+ 64bit)
+ SECP_INT128_CHECK
++ if test x"$has_int128" != x"yes"; then
++ AC_MSG_ERROR([64bit scalar explicitly requested but __int128 support not available])
++ fi
+ ;;
+ 32bit)
+ ;;
+@@ -187,15 +217,18 @@ if test x"$req_bignum" = x"auto"; then
+ fi
+
+ if test x"$set_bignum" = x; then
+- set_bignum=none
++ set_bignum=no
+ fi
+ else
+ set_bignum=$req_bignum
+ case $set_bignum in
+ gmp)
+ SECP_GMP_CHECK
++ if test x"$has_gmp" != x"yes"; then
++ AC_MSG_ERROR([gmp bignum explicitly requested but libgmp not available])
++ fi
+ ;;
+- none)
++ no)
+ ;;
+ *)
+ AC_MSG_ERROR([invalid bignum implementation selection])
+@@ -203,14 +236,21 @@ else
+ esac
+ fi
+
++# select assembly optimization
++case $set_asm in
++x86_64)
++ AC_DEFINE(USE_ASM_X86_64, 1, [Define this symbol to enable x86_64 assembly optimizations])
++ ;;
++no)
++ ;;
++*)
++ AC_MSG_ERROR([invalid assembly optimizations])
++ ;;
++esac
++
+ # select field implementation
+ case $set_field in
+-64bit_asm)
+- AC_DEFINE(USE_FIELD_5X52_ASM, 1, [Define this symbol to use the assembly version for the 5x52 field implementation])
+- AC_DEFINE(USE_FIELD_5X52, 1, [Define this symbol to use the FIELD_5X52 implementation])
+- ;;
+ 64bit)
+- AC_DEFINE(USE_FIELD_5X52_INT128, 1, [Define this symbol to use the __int128 version for the 5x52 field implementation])
+ AC_DEFINE(USE_FIELD_5X52, 1, [Define this symbol to use the FIELD_5X52 implementation])
+ ;;
+ gmp)
+@@ -233,7 +273,7 @@ gmp)
+ AC_DEFINE(USE_FIELD_INV_NUM, 1, [Define this symbol to use the num-based field inverse implementation])
+ AC_DEFINE(USE_SCALAR_INV_NUM, 1, [Define this symbol to use the num-based scalar inverse implementation])
+ ;;
+-none)
++no)
+ AC_DEFINE(USE_NUM_NONE, 1, [Define this symbol to use no num implementation])
+ AC_DEFINE(USE_FIELD_INV_BUILTIN, 1, [Define this symbol to use the native field inverse implementation])
+ AC_DEFINE(USE_SCALAR_INV_BUILTIN, 1, [Define this symbol to use the native scalar inverse implementation])
+@@ -258,7 +298,7 @@ esac
+
+ if test x"$use_tests" = x"yes"; then
+ SECP_OPENSSL_CHECK
+- if test x"$has_openssl_ec" == x"yes"; then
++ if test x"$has_openssl_ec" = x"yes"; then
+ AC_DEFINE(ENABLE_OPENSSL_TESTS, 1, [Define this symbol if OpenSSL EC functions are available])
+ SECP_TEST_INCLUDES="$SSL_CFLAGS $CRYPTO_CFLAGS"
+ SECP_TEST_LIBS="$CRYPTO_LIBS"
+@@ -281,9 +321,11 @@ if test x"$use_endomorphism" = x"yes"; then
+ AC_DEFINE(USE_ENDOMORPHISM, 1, [Define this symbol to use endomorphism optimization])
+ fi
+
++AC_MSG_NOTICE([Using assembly optimizations: $set_asm])
+ AC_MSG_NOTICE([Using field implementation: $set_field])
+ AC_MSG_NOTICE([Using bignum implementation: $set_bignum])
+ AC_MSG_NOTICE([Using scalar implementation: $set_scalar])
++AC_MSG_NOTICE([Using endomorphism optimizations: $use_endomorphism])
+
+ AC_CONFIG_HEADERS([src/libsecp256k1-config.h])
+ AC_CONFIG_FILES([Makefile libsecp256k1.pc])
+@@ -291,7 +333,6 @@ AC_SUBST(SECP_INCLUDES)
+ AC_SUBST(SECP_LIBS)
+ AC_SUBST(SECP_TEST_LIBS)
+ AC_SUBST(SECP_TEST_INCLUDES)
+-AM_CONDITIONAL([USE_ASM], [test x"$set_field" == x"64bit_asm"])
+ AM_CONDITIONAL([USE_TESTS], [test x"$use_tests" != x"no"])
+ AM_CONDITIONAL([USE_BENCHMARK], [test x"$use_benchmark" != x"no"])
+
+diff --git a/src/field_5x52_impl.h b/src/field_5x52_impl.h
+index 63176d6..a045db3 100644
+--- a/src/field_5x52_impl.h
++++ b/src/field_5x52_impl.h
+@@ -16,12 +16,10 @@
+ #include "num.h"
+ #include "field.h"
+
+-#if defined(USE_FIELD_5X52_ASM)
++#if defined(USE_ASM_X86_64)
+ #include "field_5x52_asm_impl.h"
+-#elif defined(USE_FIELD_5X52_INT128)
+-#include "field_5x52_int128_impl.h"
+ #else
+-#error "Please select field_5x52 implementation"
++#include "field_5x52_int128_impl.h"
+ #endif
+
+ /** Implements arithmetic modulo FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE FFFFFC2F,
diff --git a/dev-libs/libsecp256k1/libsecp256k1-0.0.0_pre20141212.ebuild b/dev-libs/libsecp256k1/libsecp256k1-0.0.0_pre20141212.ebuild
new file mode 100644
index 000000000000..233a2500701a
--- /dev/null
+++ b/dev-libs/libsecp256k1/libsecp256k1-0.0.0_pre20141212.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/libsecp256k1/libsecp256k1-0.0.0_pre20141212.ebuild,v 1.1 2015/02/23 21:46:44 blueness Exp $
+
+EAPI=5
+
+inherit autotools eutils
+
+MyPN=secp256k1
+DESCRIPTION="Optimized C library for EC operations on curve secp256k1"
+HOMEPAGE="https://github.com/bitcoin/${MyPN}"
+COMMITHASH="2a53a472f24acd9ff10878b5bf21b5b27ab8060a"
+SRC_URI="https://github.com/bitcoin/${MyPN}/archive/${COMMITHASH}.tar.gz -> ${MyPN}-v${PV}.tgz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="asm doc endomorphism gmp test"
+
+REQUIRED_USE="
+ asm? ( amd64 )
+"
+RDEPEND="
+ gmp? ( dev-libs/gmp )
+"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ >=sys-devel/gcc-4.7
+ test? ( dev-libs/openssl )
+"
+
+S="${WORKDIR}/${MyPN}-${COMMITHASH}"
+
+src_prepare() {
+ epatch "${FILESDIR}/20141212-fixes.patch"
+ eautoreconf
+}
+
+src_configure() {
+ local field
+ if use gmp && ! use asm; then
+ field=gmp
+ elif use amd64; then
+ field=64bit
+ else
+ field=32bit
+ fi
+
+ econf \
+ --disable-benchmark \
+ $(use_enable test tests) \
+ $(use_enable endomorphism) \
+ --with-asm=$(usex asm auto no) \
+ --with-bignum=$(usex gmp gmp no) \
+ --with-field=${field} \
+ --disable-static
+}
+
+src_compile() {
+ emake
+}
+
+src_test() {
+ emake check
+}
+
+src_install() {
+ if use doc; then
+ dodoc README.md
+ fi
+
+ emake DESTDIR="${D}" install
+ prune_libtool_files
+}