1{ 2 lib, 3 fetchFromGitHub, 4 buildPythonPackage, 5 pkg-config, 6 cffi, 7 secp256k1, 8 pytestCheckHook, 9}: 10 11buildPythonPackage { 12 pname = "python-secp256k1-cardano"; 13 version = "0.2.3"; 14 15 format = "setuptools"; 16 17 src = fetchFromGitHub { 18 owner = "OpShin"; 19 repo = "python-secp256k1"; 20 rev = "5a8f761a4b9a1594653cc4deebadc3398b07533c"; # No tags in repo 21 hash = "sha256-6bE4/G2gW2F8h5FWtI3TZ6FtijsB/slvFT/SIVv7VIY="; 22 }; 23 24 nativeBuildInputs = [ pkg-config ]; 25 26 propagatedBuildInputs = [ 27 cffi 28 secp256k1 29 ]; 30 31 nativeCheckInputs = [ pytestCheckHook ]; 32 33 # Tests expect .so files and are failing 34 doCheck = false; 35 36 preConfigure = '' 37 cp -r ${secp256k1.src} libsecp256k1 38 export INCLUDE_DIR=${secp256k1}/include 39 export LIB_DIR=${secp256k1}/lib 40 ''; 41 42 meta = { 43 homepage = "https://github.com/OpShin/python-secp256k1"; 44 description = "Fork of python-secp256k1, fixing the commit hash of libsecp256k1 to a Cardano compatible version"; 45 license = with lib.licenses; [ mit ]; 46 maintainers = with lib.maintainers; [ aciceri ]; 47 }; 48}