git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #16463 from FRidh/secp

secp256k1: init (native lib, and python ffi bindings at 0.12.1)

commit81d798bc36028276157112d4c80ee47004bab38a authorFrederik Rietdijk <freddyrietdijk@fridh.nl> dateFri 15 Jul 2016, 12:23 (10 years ago) parent55eb18d9f78710
3 files changed+73−2
pkgs/tools/security/secp256k1/default.nix+35 pkgs/top-level/all-packages.nix+2 pkgs/top-level/python-packages.nix+36−2
pkgs/tools/security/secp256k1/default.nixnew file+35
@@ -0,0 +1,35 @@
1+{ stdenv, fetchFromGitHub, autoconf, automake, libtool, ... }:
2+
3+stdenv.mkDerivation rec {
4+ name = "secp256k1-${version}";
5+
6+ # I can't find any version numbers, so we're just using the date
7+ # of the last commit.
8+ version = "2016-05-30";
9+
10+ src = fetchFromGitHub {
11+ owner = "bitcoin-core";
12+ repo = "secp256k1";
13+ rev = "b3be8521e694eaf45dd29baea035055183c42fe2";
14+ sha256 = "1pgsy72w87yxbiqn96hnm8alsfx3rj7d9jlzdsypyf6i1rf6w4bq";
15+ };
16+
17+ buildInputs = [ autoconf automake libtool ];
18+
19+ configureFlags = [ "--enable-module-recovery" ];
20+
21+ preConfigure = "./autogen.sh";
22+
23+ 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 ];
33+ maintainers = with maintainers; [ chris-martin ];
34+ };
35+}
pkgs/top-level/all-packages.nix+2
@@ -3392,6 +3392,8 @@ in
33923392
33933393 seccure = callPackage ../tools/security/seccure { };
33943394
3395+ secp256k1 = callPackage ../tools/security/secp256k1 { };
3396+
33953397 securefs = callPackage ../tools/filesystems/securefs { };
33963398
33973399 setroot = callPackage ../tools/X11/setroot { };
pkgs/top-level/python-packages.nix+36−2
@@ -4476,11 +4476,11 @@ in modules // {
44764476 };
44774477
44784478 pytest_28 = self.pytest_27.override rec {
4479− name = "pytest-2.8.6";
4479+ name = "pytest-2.8.7";
44804480
44814481 src = pkgs.fetchurl {
44824482 url = "mirror://pypi/p/pytest/${name}.tar.gz";
4483− sha256 = "ed38a3725b8e4478555dfdb549a4219ca3ba57955751141a1aaa45b706d84194";
4483+ sha256 = "1bwb06g64x2gky8x5hcrfpg6r351xwvafimnhm5qxq7wajz8ck7w";
44844484 };
44854485 };
44864486
@@ -21688,6 +21688,40 @@ in modules // {
2168821688 };
2168921689 };
2169021690
21691+ secp256k1 = buildPythonPackage rec {
21692+ name = "secp256k1-${version}";
21693+ version = "0.12.1";
21694+
21695+ src = pkgs.fetchurl {
21696+ url = "mirror://pypi/s/secp256k1/${name}.tar.gz";
21697+ sha256 = "0zrjxvzxqm4bz2jcy8sras8jircgbs6dkrw8j3nc6jhvzlikwwxl";
21698+ };
21699+
21700+ buildInputs = [ pkgs.pkgconfig self.pytest_28 self.pytestrunner ];
21701+ propagatedBuildInputs = [ self.cffi pkgs.secp256k1 ];
21702+
21703+ # Tests are not included in archive
21704+ doCheck = false;
21705+
21706+ preConfigure = ''
21707+ cp -r ${pkgs.secp256k1.src} libsecp256k1
21708+ touch libsecp256k1/autogen.sh
21709+ export INCLUDE_DIR=${pkgs.secp256k1}/include
21710+ export LIB_DIR=${pkgs.secp256k1}/lib
21711+ '';
21712+
21713+ checkPhase = ''
21714+ py.test tests
21715+ '';
21716+
21717+ meta = {
21718+ homepage = https://github.com/ludbb/secp256k1-py;
21719+ description = "Python FFI bindings for secp256k1";
21720+ license = with licenses; [ mit ];
21721+ maintainers = with maintainers; [ chris-martin ];
21722+ };
21723+ };
21724+
2169121725 semantic-version = buildPythonPackage rec {
2169221726 name = "semantic_version-2.4.2";
2169321727 src = pkgs.fetchurl {