1{ lib 2, fetchFromGitHub 3, fetchpatch 4, buildPythonPackage 5, pythonOlder 6, pytestCheckHook 7, rustPlatform 8, stdenv 9, py-bip39-bindings 10, libiconv }: 11 12buildPythonPackage rec { 13 pname = "py-sr25519-bindings"; 14 version = "unstable-2023-03-15"; 15 format = "pyproject"; 16 17 disabled = pythonOlder "3.6"; 18 19 src = fetchFromGitHub { 20 owner = "polkascan"; 21 repo = "py-sr25519-bindings"; 22 rev = "9127501235bf291d7f14f00ec373d0a5000a32cb"; 23 hash = "sha256-mxNmiFvMbV9WQhGNIQXxTkOcJHYs0vyOPM6Nd5367RE="; 24 }; 25 26 cargoDeps = rustPlatform.fetchCargoTarball { 27 inherit src; 28 name = "${pname}-${version}"; 29 hash = "sha256-7fDlEYWOiRVpG3q0n3ZSS1dfNCOh0/4pX/PbcDBvoMI="; 30 }; 31 32 nativeBuildInputs = with rustPlatform; [ 33 cargoSetupHook 34 maturinBuildHook 35 ]; 36 37 buildInputs = lib.optionals stdenv.isDarwin [ libiconv ]; 38 39 nativeCheckInputs = [ 40 pytestCheckHook 41 py-bip39-bindings 42 ]; 43 44 pytestFlagsArray = [ 45 "tests.py" 46 ]; 47 48 pythonImportsCheck = [ 49 "sr25519" 50 ]; 51 52 meta = with lib; { 53 description = "Python bindings for sr25519 library"; 54 homepage = "https://github.com/polkascan/py-sr25519-bindings"; 55 license = licenses.asl20; 56 maintainers = with maintainers; [ onny stargate01 ]; 57 }; 58}