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