1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 cmake,
8 hatchling,
9 ninja,
10 pkg-config,
11 setuptools,
12 scikit-build-core,
13
14 # dependencies
15 asn1crypto,
16 cffi,
17 secp256k1,
18
19 # checks
20 pytestCheckHook,
21 pythonOlder,
22}:
23
24buildPythonPackage rec {
25 pname = "coincurve";
26 version = "20.0.0";
27 pyproject = true;
28
29 disabled = pythonOlder "3.7";
30
31 src = fetchFromGitHub {
32 owner = "ofek";
33 repo = "coincurve";
34 tag = "v${version}";
35 hash = "sha256-NKx/iLuzFEu1UBuwa14x55Ab3laVAKEtX6dtoWi0dOg=";
36 };
37
38 build-system = [
39 hatchling
40 cffi
41 cmake
42 ninja
43 pkg-config
44 setuptools
45 scikit-build-core
46 ];
47
48 dontUseCmakeConfigure = true;
49
50 env.COINCURVE_IGNORE_SYSTEM_LIB = "OFF";
51
52 buildInputs = [ secp256k1 ];
53
54 dependencies = [
55 asn1crypto
56 cffi
57 ];
58
59 preCheck = ''
60 # https://github.com/ofek/coincurve/blob/master/tox.ini#L20-L22=
61 rm -rf coincurve
62
63 # don't run benchmark tests
64 rm tests/test_bench.py
65 '';
66
67 nativeCheckInputs = [ pytestCheckHook ];
68
69 pythonImportsCheck = [ "coincurve" ];
70
71 meta = with lib; {
72 description = "Cross-platform bindings for libsecp256k1";
73 homepage = "https://github.com/ofek/coincurve";
74 license = with licenses; [
75 asl20
76 mit
77 ];
78 maintainers = [ ];
79 };
80}