1{ lib
2, buildPythonPackage
3, fetchPypi
4, fetchpatch
5, six
6, attrs
7, twisted
8, pyopenssl
9, service-identity
10, autobahn
11, treq
12, mock
13, pythonOlder
14}:
15
16buildPythonPackage rec {
17 pname = "magic-wormhole-mailbox-server";
18 version = "0.4.1";
19 format = "setuptools";
20
21 disabled = pythonOlder "3.7";
22
23 src = fetchPypi {
24 inherit pname version;
25 sha256 = "1af10592909caaf519c00e706eac842c5e77f8d4356215fe9c61c7b2258a88fb";
26 };
27
28 patches = [
29 (fetchpatch {
30 # Remove the 'U' open mode removed, https://github.com/magic-wormhole/magic-wormhole-mailbox-server/pull/34
31 name = "fix-for-python-3.11.patch";
32 url = "https://github.com/magic-wormhole/magic-wormhole-mailbox-server/commit/4b358859ba80de37c3dc0a5f67ec36909fd48234.patch";
33 hash = "sha256-RzZ5kD+xhmFYusVzAbGE+CODXtJVR1zN2rZ+VGApXiQ=";
34 })
35 ];
36
37 propagatedBuildInputs = [
38 attrs
39 six
40 twisted
41 autobahn
42 ] ++ autobahn.optional-dependencies.twisted
43 ++ twisted.optional-dependencies.tls;
44
45 nativeCheckInputs = [
46 treq
47 mock
48 twisted
49 ];
50
51 checkPhase = ''
52 trial -j$NIX_BUILD_CORES wormhole_mailbox_server
53 '';
54
55 meta = with lib; {
56 description = "Securely transfer data between computers";
57 homepage = "https://github.com/warner/magic-wormhole-mailbox-server";
58 changelog = "https://github.com/magic-wormhole/magic-wormhole-mailbox-server/blob/${version}/NEWS.md";
59 license = licenses.mit;
60 maintainers = with maintainers; [ SuperSandro2000 ];
61 };
62}