Merge pull request #121707 from prusnak/secp256k1

secp256k1: (unstable-)2020-08-16 -> unstable-2021-06-06
This commit is contained in:
Sandro 2021-06-12 18:24:14 +02:00 committed by GitHub
commit b07cf14fcb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 29 deletions

View file

@ -1,45 +1,37 @@
{ lib, stdenv, fetchFromGitHub, autoreconfHook, jdk { lib
, stdenv
# Enable ECDSA pubkey recovery module , fetchFromGitHub
, enableRecovery ? true , autoreconfHook
# Enable ECDH shared secret computation (disabled by default because it is
# experimental)
, enableECDH ? false
# Enable libsecp256k1_jni (disabled by default because it requires a jdk,
# which is a large dependency)
, enableJNI ? false
}: }:
let inherit (lib) optionals; in
stdenv.mkDerivation { stdenv.mkDerivation {
pname = "secp256k1"; pname = "secp256k1";
# I can't find any version numbers, so we're just using the date of the # I can't find any version numbers, so we're just using the date of the
# last commit. # last commit.
version = "2020-08-16"; version = "unstable-2021-06-06";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "bitcoin-core"; owner = "bitcoin-core";
repo = "secp256k1"; repo = "secp256k1";
rev = "670cdd3f8be25f81472b2d16dcd228b0d24a5c45"; rev = "7973576f6e3ab27d036a09397152b124d747f4ae";
sha256 = "0ak2hrr0wznl5d9s905qwn5yds7k22i28d2jp957l4a8yf8cqv3s"; sha256 = "0vjk55dv0mkph4k6bqgkykmxn05ngzvhc4rzjnvn33xzi8dzlvah";
}; };
buildInputs = optionals enableJNI [ jdk ];
nativeBuildInputs = [ autoreconfHook ]; nativeBuildInputs = [ autoreconfHook ];
configureFlags = configureFlags = [
[ "--enable-benchmark=no" "--enable-tests=yes" "--enable-exhaustive-tests=no" ] ++ "--enable-benchmark=no"
optionals enableECDH [ "--enable-module-ecdh" "--enable-experimental" ] ++ "--enable-exhaustive-tests=no"
optionals enableRecovery [ "--enable-module-recovery" ] ++ "--enable-experimental"
optionals enableJNI [ "--enable-jni" ]; "--enable-module-ecdh"
"--enable-module-recovery"
"--enable-module-schnorrsig"
"--enable-tests=yes"
];
doCheck = true; doCheck = true;
checkPhase = "./tests"; checkPhase = "./tests";
meta = with lib; { meta = with lib; {

View file

@ -22740,10 +22740,7 @@ in
jnetmap = callPackage ../applications/networking/jnetmap {}; jnetmap = callPackage ../applications/networking/jnetmap {};
libbitcoin = callPackage ../tools/misc/libbitcoin/libbitcoin.nix { libbitcoin = callPackage ../tools/misc/libbitcoin/libbitcoin.nix { };
secp256k1 = secp256k1.override { enableECDH = true; };
};
libbitcoin-protocol = callPackage ../tools/misc/libbitcoin/libbitcoin-protocol.nix { }; libbitcoin-protocol = callPackage ../tools/misc/libbitcoin/libbitcoin-protocol.nix { };
libbitcoin-client = callPackage ../tools/misc/libbitcoin/libbitcoin-client.nix { }; libbitcoin-client = callPackage ../tools/misc/libbitcoin/libbitcoin-client.nix { };
libbitcoin-network = callPackage ../tools/misc/libbitcoin/libbitcoin-network.nix { }; libbitcoin-network = callPackage ../tools/misc/libbitcoin/libbitcoin-network.nix { };