2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
asn1crypto,
|
|
|
|
autoconf,
|
|
|
|
automake,
|
|
|
|
cffi,
|
|
|
|
libtool,
|
|
|
|
pkg-config,
|
|
|
|
pytestCheckHook,
|
|
|
|
python,
|
|
|
|
pythonOlder,
|
|
|
|
secp256k1,
|
2022-06-16 17:23:12 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "coincurve";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "19.0.1";
|
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}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-T60iKRrc8/t86nqf8/R4971SjOw586YNCWWBuLd9MjM=";
|
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
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "coincurve" ];
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Cross-platform bindings for libsecp256k1";
|
|
|
|
homepage = "https://github.com/ofek/coincurve";
|
2024-06-05 15:53:02 +00:00
|
|
|
license = with licenses; [
|
|
|
|
asl20
|
|
|
|
mit
|
|
|
|
];
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
}
|