summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/python-u2flib-server/default.nix
blob: 08a62d41363aafb404101386444783f1fd21bda1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{ lib
, buildPythonPackage
, fetchFromGitHub
, fetchpatch

# propagates
, cryptography
, six

# optional
, webob

# tests
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "python-u2flib-server";
  version = "5.0.1";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "Yubico";
    repo = "python-u2flib-server";
    rev = version;
    hash = "sha256-ginP9u+aHcdaWpwcFYJWu0Ghf7+nDZq9i3TVAacIPhg=";
  };

  patches = [
    ./cryptography-37-compat.patch
  ];

  propagatedBuildInputs = [
    cryptography
    six
  ];

  passthru.optional-dependencies = {
    u2f_server = [
      webob
    ];
  };

  pythonImportsCheck = [
    "u2flib_server"
    "u2flib_server.u2f"
  ];

  nativeCheckInputs = [
    pytestCheckHook
  ] ++ passthru.optional-dependencies.u2f_server;

  meta = with lib; {
    description = "Python based U2F server library";
    homepage = "https://github.com/Yubico/python-u2flib-server";
    changelog = "https://github.com/Yubico/python-u2flib-server/blob/${src.rev}/NEWS";
    license = licenses.bsd2;
    maintainers = with maintainers; [ hexa ];
  };
}