1{ lib
2, stdenv
3, buildPythonPackage
4, fetchPypi
5, spake2
6, pynacl
7, six
8, attrs
9, twisted
10, autobahn
11, automat
12, hkdf
13, tqdm
14, click
15, humanize
16, txtorcon
17, nettools
18, mock
19, magic-wormhole-transit-relay
20, magic-wormhole-mailbox-server
21, pytestCheckHook
22}:
23
24buildPythonPackage rec {
25 pname = "magic-wormhole";
26 version = "0.12.0";
27
28 src = fetchPypi {
29 inherit pname version;
30 sha256 = "0q41j99718y7m95zg1vaybnsp31lp6lhyqkbv4yqz5ys6jixh3qv";
31 };
32
33 propagatedBuildInputs = [
34 spake2
35 pynacl
36 six
37 attrs
38 twisted
39 autobahn
40 automat
41 hkdf
42 tqdm
43 click
44 humanize
45 txtorcon
46 ] ++ autobahn.optional-dependencies.twisted
47 ++ twisted.optional-dependencies.tls;
48
49 checkInputs = [
50 mock
51 magic-wormhole-transit-relay
52 magic-wormhole-mailbox-server
53 pytestCheckHook
54 ];
55
56 disabledTests = [
57 # Expected: (<class 'wormhole.errors.WrongPasswordError'>,) Got: Failure instance: Traceback (failure with no frames): <class 'wormhole.errors.LonelyError'>:
58 "test_welcome"
59 ];
60
61 postPatch = lib.optionalString stdenv.isLinux ''
62 sed -i -e "s|'ifconfig'|'${nettools}/bin/ifconfig'|" src/wormhole/ipaddrs.py
63 '';
64
65 postInstall = ''
66 install -Dm644 docs/wormhole.1 $out/share/man/man1/wormhole.1
67 '';
68
69 meta = with lib; {
70 description = "Securely transfer data between computers";
71 homepage = "https://github.com/magic-wormhole/magic-wormhole";
72 license = licenses.mit;
73 maintainers = with maintainers; [ asymmetric SuperSandro2000 ];
74 mainProgram = "wormhole";
75 };
76}