···1-{ stdenv, fetchFromGitHub, autoconf, automake, libtool, ... }:
00000000000000023stdenv.mkDerivation rec {
4 name = "secp256k1-${version}";
56- # I can't find any version numbers, so we're just using the date
7- # of the last commit.
8- version = "2016-05-30";
910 src = fetchFromGitHub {
11 owner = "bitcoin-core";
12 repo = "secp256k1";
13- rev = "b3be8521e694eaf45dd29baea035055183c42fe2";
14- sha256 = "1pgsy72w87yxbiqn96hnm8alsfx3rj7d9jlzdsypyf6i1rf6w4bq";
15 };
1617- buildInputs = [ autoconf automake libtool ];
1819- configureFlags = [ "--enable-module-recovery" ];
2021- preConfigure = "./autogen.sh";
0002223 meta = with stdenv.lib; {
24 description = "Optimized C library for EC operations on curve secp256k1";
25 longDescription = ''
26- Optimized C library for EC operations on curve secp256k1.
27- Part of Bitcoin Core. This library is a work in progress
28- and is being used to research best practices. Use at your
29- own risk.
30 '';
31 homepage = https://github.com/bitcoin-core/secp256k1;
32 license = with licenses; [ mit ];
···1+{ stdenv, fetchFromGitHub, autoreconfHook, jdk
2+3+# Enable ECDSA pubkey recovery module
4+, enableRecovery ? true
5+6+# Enable ECDH shared secret computation (disabled by default because it is
7+# experimental)
8+, enableECDH ? false
9+10+# Enable libsecp256k1_jni (disabled by default because it requires a jdk,
11+# which is a large dependency)
12+, enableJNI ? false
13+14+}:
15+16+let inherit (stdenv.lib) optionals; in
1718stdenv.mkDerivation rec {
19 name = "secp256k1-${version}";
2021+ # I can't find any version numbers, so we're just using the date of the
22+ # last commit.
23+ version = "2016-11-27";
2425 src = fetchFromGitHub {
26 owner = "bitcoin-core";
27 repo = "secp256k1";
28+ rev = "2928420c1b8e1feee8c20dff4e3cc41a0de2fc22";
29+ sha256 = "1djsr2vrhh88353czlwb8bwlyabf008w1f7xg0fs3q33rf42w5gm";
30 };
3132+ buildInputs = optionals enableJNI [ jdk ];
3334+ nativeBuildInputs = [ autoreconfHook ];
3536+ configureFlags =
37+ optionals enableECDH [ "--enable-module-ecdh" "--enable-experimental" ] ++
38+ optionals enableRecovery [ "--enable-module-recovery" ] ++
39+ optionals enableJNI [ "--enable-jni" ];
4041 meta = with stdenv.lib; {
42 description = "Optimized C library for EC operations on curve secp256k1";
43 longDescription = ''
44+ Optimized C library for EC operations on curve secp256k1. Part of
45+ Bitcoin Core. This library is a work in progress and is being used
46+ to research best practices. Use at your own risk.
047 '';
48 homepage = https://github.com/bitcoin-core/secp256k1;
49 license = with licenses; [ mit ];