From 4f8ac15c523a878196c9f00d9a9b3dd1fbda9e64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 4 Jun 2022 05:00:03 +0200 Subject: [PATCH] python310Packages.coincurve: init at 17.0.0 --- .../python-modules/coincurve/default.nix | 72 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 4 ++ 2 files changed, 76 insertions(+) create mode 100644 pkgs/development/python-modules/coincurve/default.nix diff --git a/pkgs/development/python-modules/coincurve/default.nix b/pkgs/development/python-modules/coincurve/default.nix new file mode 100644 index 000000000000..5d259f250b5f --- /dev/null +++ b/pkgs/development/python-modules/coincurve/default.nix @@ -0,0 +1,72 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, asn1crypto +, autoconf +, automake +, cffi +, libtool +, pkg-config +, pytestCheckHook +, python +, pythonOlder +, secp256k1 +}: + +buildPythonPackage rec { + pname = "coincurve"; + version = "17.0.0"; + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "ofek"; + repo = "coincurve"; + rev = "v${version}"; + sha256 = "sha256-7H4/TDxteuMTrj1PdfpA5rc7CegJAOjqn1PteImfGiQ="; + }; + + postPatch = '' + substituteInPlace setup.py \ + --replace ", 'requests'" "" + + # don't try to load .dll files + rm coincurve/_windows_libsecp256k1.py + cp -r --no-preserve=mode ${secp256k1.src} libsecp256k1 + patchShebangs secp256k1/autogen.sh + ''; + + nativeBuildInputs = [ + autoconf + automake + libtool + pkg-config + ]; + + propagatedBuildInputs = [ + asn1crypto + cffi + ]; + + preCheck = '' + # https://github.com/ofek/coincurve/blob/master/tox.ini#L20-L22= + rm -rf coincurve + + # don't run benchmark tests + rm tests/test_bench.py + ''; + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "coincurve" + ]; + + meta = with lib; { + description = "Cross-platform bindings for libsecp256k1"; + homepage = "https://github.com/ofek/coincurve"; + license = with licenses; [ asl20 mit ]; + maintainers = with maintainers; [ SuperSandro2000 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6f3e96d3519a..8fb341640d01 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1549,6 +1549,10 @@ in { censys = callPackage ../development/python-modules/censys { }; + coincurve = callPackage ../development/python-modules/coincurve { + inherit (pkgs) secp256k1; + }; + connect-box = callPackage ../development/python-modules/connect_box { }; connection-pool = callPackage ../development/python-modules/connection-pool { };