summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/omemo/default.nix
blob: 8f4fa6a957df2d78eee103920b73d480aa10e034 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
{
  lib,
  fetchFromGitHub,
  buildPythonPackage,

  setuptools,

  typing-extensions,
  xeddsa,

  pytestCheckHook,
  oldmemo,
  twomemo,
  pytest-asyncio,
  pytest-cov-stub,

  # passthru
  omemo,
}:
buildPythonPackage rec {
  pname = "omemo";
  version = "2.0.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "Syndace";
    repo = "python-omemo";
    tag = "v${version}";
    hash = "sha256-uA8Nv8xT6ROlE9eM/Oz2j5HsYtvWzKEu7DSd/ws+WZY=";
  };

  build-system = [
    setuptools
  ];

  dependencies = [
    typing-extensions
    xeddsa
  ];

  doCheck = false;

  nativeCheckInputs = [
    pytestCheckHook
    oldmemo
    twomemo
    pytest-asyncio
    pytest-cov-stub
  ]
  ++ oldmemo.optional-dependencies.xml;

  pythonImportsCheck = [
    "omemo"
  ];

  passthru.tests = {
    pytest = omemo.overridePythonAttrs {
      doCheck = true;
    };
  };

  meta = {
    description = "Open python implementation of the OMEMO Multi-End Message and Object Encryption protocol";
    longDescription = ''
      A complete implementation of XEP-0384 on protocol-level, i.e. more than just the cryptography.
      python-omemo supports different versions of the specification through so-called backends.

      A backend for OMEMO in the urn:xmpp:omemo:2 namespace (the most recent version of the specification) is available
      in the python-twomemo Python package.
      A backend for (legacy) OMEMO in the eu.siacs.conversations.axolotl namespace is available in the python-oldmemo
      package.
      Multiple backends can be loaded and used at the same time, the library manages their coexistence transparently.
    '';
    homepage = "https://github.com/Syndace/python-omemo";
    changelog = "https://github.com/Syndace/python-omemo/blob/${src.tag}/CHANGELOG.md";
    license = lib.licenses.mit;
    teams = with lib.teams; [ ngi ];
    maintainers = with lib.maintainers; [ themadbit ];
  };
}