2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
2024-07-27 06:49:29 +00:00
|
|
|
|
|
|
|
# build-system
|
|
|
|
cmake,
|
|
|
|
hatchling,
|
|
|
|
ninja,
|
|
|
|
pkg-config,
|
|
|
|
setuptools,
|
|
|
|
scikit-build-core,
|
|
|
|
|
|
|
|
# dependencies
|
2024-06-05 15:53:02 +00:00
|
|
|
asn1crypto,
|
|
|
|
cffi,
|
2024-07-27 06:49:29 +00:00
|
|
|
secp256k1,
|
|
|
|
|
|
|
|
# checks
|
2024-06-05 15:53:02 +00:00
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
2022-06-16 17:23:12 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "coincurve";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "20.0.0";
|
|
|
|
pyproject = true;
|
|
|
|
|
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-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-NKx/iLuzFEu1UBuwa14x55Ab3laVAKEtX6dtoWi0dOg=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# don't try to load .dll files
|
|
|
|
cp -r --no-preserve=mode ${secp256k1.src} libsecp256k1
|
|
|
|
patchShebangs secp256k1/autogen.sh
|
|
|
|
'';
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
build-system = [
|
|
|
|
hatchling
|
|
|
|
cffi
|
|
|
|
cmake
|
|
|
|
ninja
|
2022-06-16 17:23:12 +00:00
|
|
|
pkg-config
|
2024-07-27 06:49:29 +00:00
|
|
|
setuptools
|
|
|
|
scikit-build-core
|
2022-06-16 17:23:12 +00:00
|
|
|
];
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
|
|
|
env.COINCURVE_IGNORE_SYSTEM_LIB = "OFF";
|
|
|
|
|
|
|
|
buildInputs = [ secp256k1 ];
|
|
|
|
|
|
|
|
dependencies = [
|
2022-06-16 17:23:12 +00:00
|
|
|
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
|
|
|
};
|
|
|
|
}
|