2022-06-16 17:23:12 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, asn1crypto
|
|
|
|
, autoconf
|
|
|
|
, automake
|
|
|
|
, cffi
|
|
|
|
, libtool
|
|
|
|
, pkg-config
|
|
|
|
, pytestCheckHook
|
|
|
|
, python
|
|
|
|
, pythonOlder
|
|
|
|
, secp256k1
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "coincurve";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "18.0.0";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2022-06-16 17:23:12 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ofek";
|
|
|
|
repo = "coincurve";
|
2023-01-20 10:41:00 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-Z5g6ten8wNICoFu7+aZc6r8ET+RDmFeb93ONjsTzcbw=";
|
2022-06-16 17:23:12 +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-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-06-16 17:23:12 +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-08-04 22:07:22 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
}
|