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