2022-06-04 03:00:03 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, asn1crypto
|
|
|
|
, autoconf
|
|
|
|
, automake
|
|
|
|
, cffi
|
|
|
|
, libtool
|
|
|
|
, pkg-config
|
|
|
|
, pytestCheckHook
|
|
|
|
, python
|
|
|
|
, pythonOlder
|
|
|
|
, secp256k1
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "coincurve";
|
2022-12-30 19:13:02 +00:00
|
|
|
version = "18.0.0";
|
2022-06-04 03:00:03 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ofek";
|
|
|
|
repo = "coincurve";
|
2022-12-30 19:13:02 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-03-03 00:48:06 +00:00
|
|
|
hash = "sha256-Z5g6ten8wNICoFu7+aZc6r8ET+RDmFeb93ONjsTzcbw=";
|
2022-06-04 03:00:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [
|
2022-06-04 03:00:03 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"coincurve"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Cross-platform bindings for libsecp256k1";
|
|
|
|
homepage = "https://github.com/ofek/coincurve";
|
|
|
|
license = with licenses; [ asl20 mit ];
|
2023-07-23 17:30:22 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2022-06-04 03:00:03 +00:00
|
|
|
};
|
|
|
|
}
|