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 src;
26 name = "${pname}-${version}";
27 hash = "sha256-OSnPGRZwuAzcvu80GgTXdc740SfhDIsXrQZq9a/BCdE=";
28 };
29
30 nativeBuildInputs = with rustPlatform; [
31 cargoSetupHook
32 maturinBuildHook
33 ];
34
35 buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
36
37 nativeCheckInputs = [
38 pytestCheckHook
39 py-bip39-bindings
40 ];
41
42 pytestFlagsArray = [ "tests.py" ];
43
44 pythonImportsCheck = [ "sr25519" ];
45
46 meta = with lib; {
47 description = "Python bindings for sr25519 library";
48 homepage = "https://github.com/polkascan/py-sr25519-bindings";
49 license = licenses.asl20;
50 maintainers = with maintainers; [
51 onny
52 stargate01
53 ];
54 };
55}