2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
pkg-config,
|
|
|
|
pytestCheckHook,
|
|
|
|
cffi,
|
|
|
|
secp256k1,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "secp256k1";
|
2021-12-26 17:43:05 +00:00
|
|
|
version = "0.14.0";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-12-26 17:43:05 +00:00
|
|
|
sha256 = "82c06712d69ef945220c8b53c1a0d424c2ff6a1f64aee609030df79ad8383397";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
postPatch = ''
|
|
|
|
# don't do hacky tarball download + setuptools check
|
|
|
|
sed -i '38,54d' setup.py
|
|
|
|
substituteInPlace setup.py --replace ", 'pytest-runner==2.6.2'" ""
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
cffi
|
|
|
|
secp256k1
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# Tests are not included in archive
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
cp -r ${secp256k1.src} libsecp256k1
|
|
|
|
export INCLUDE_DIR=${secp256k1}/include
|
|
|
|
export LIB_DIR=${secp256k1}/lib
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://github.com/ludbb/secp256k1-py";
|
|
|
|
description = "Python FFI bindings for secp256k1";
|
|
|
|
license = with lib.licenses; [ mit ];
|
2024-07-31 10:19:44 +00:00
|
|
|
maintainers = [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|