1{ lib 2, buildPythonPackage 3, fetchPypi 4, pkgconfig 5, pytest 6, pytestrunner 7, cffi 8, secp256k1 9}: 10 11buildPythonPackage rec { 12 pname = "secp256k1"; 13 version = "0.13.2"; 14 15 src = fetchPypi { 16 inherit pname version; 17 sha256 = "a3b43e02d321c09eafa769a6fc2c156f555cab3a7db62175ef2fd21e16cdf20c"; 18 }; 19 20 nativeBuildInputs = [ pkgconfig ]; 21 checkInputs = [ pytest pytestrunner ]; 22 propagatedBuildInputs = [ cffi secp256k1 ]; 23 24 # Tests are not included in archive 25 doCheck = false; 26 27 preConfigure = '' 28 cp -r ${secp256k1.src} libsecp256k1 29 touch libsecp256k1/autogen.sh 30 export INCLUDE_DIR=${secp256k1}/include 31 export LIB_DIR=${secp256k1}/lib 32 ''; 33 34 checkPhase = '' 35 py.test tests 36 ''; 37 38 postPatch = '' 39 substituteInPlace setup.py --replace ", 'pytest-runner==2.6.2'" "" 40 ''; 41 42 meta = { 43 homepage = https://github.com/ludbb/secp256k1-py; 44 description = "Python FFI bindings for secp256k1"; 45 license = with lib.licenses; [ mit ]; 46 maintainers = with lib.maintainers; [ chris-martin ]; 47 }; 48}