25 # optional-dependencies
32 magic-wormhole-transit-relay,
33 magic-wormhole-mailbox-server,
37 buildPythonPackage rec {
38 pname = "magic-wormhole";
42 src = fetchFromGitHub {
43 owner = "magic-wormhole";
44 repo = "magic-wormhole";
45 rev = "refs/tags/${version}";
46 hash = "sha256-BxPF4iQ91wLBagdvQ/Y89VIZBkMxFiEHnK+BU55Bwr4=";
50 # enable tests by fixing the location of the wormhole binary
52 substituteInPlace src/wormhole/test/test_cli.py --replace-fail \
53 'locations = procutils.which("wormhole")' \
54 'return "${placeholder "out"}/bin/wormhole"'
56 # fix the location of the ifconfig binary
57 + lib.optionalString stdenv.hostPlatform.isLinux ''
58 sed -i -e "s|'ifconfig'|'${nettools}/bin/ifconfig'|" src/wormhole/ipaddrs.py
61 build-system = [ setuptools ];
77 ] ++ autobahn.optional-dependencies.twisted ++ twisted.optional-dependencies.tls;
79 optional-dependencies = {
80 dilation = [ noiseprotocol ];
84 # For Python 3.12, remove magic-wormhole-mailbox-server and magic-wormhole-transit-relay from test dependencies,
85 # which are not yet supported with this version.
87 (!magic-wormhole-mailbox-server.meta.broken && !magic-wormhole-transit-relay.meta.broken)
89 magic-wormhole-mailbox-server
90 magic-wormhole-transit-relay
96 ++ optional-dependencies.dilation
97 ++ lib.optionals stdenv.hostPlatform.isDarwin [ unixtools.locale ];
99 __darwinAllowLocalNetworking = true;
102 # For Python 3.12, remove the tests depending on magic-wormhole-mailbox-server and magic-wormhole-transit-relay,
103 # which are not yet supported with this version.
105 (magic-wormhole-mailbox-server.meta.broken || magic-wormhole-transit-relay.meta.broken)
107 "src/wormhole/test/dilate/test_full.py"
108 "src/wormhole/test/test_args.py"
109 "src/wormhole/test/test_cli.py"
110 "src/wormhole/test/test_transit.py"
111 "src/wormhole/test/test_wormhole.py"
112 "src/wormhole/test/test_xfer_util.py"
116 install -Dm644 docs/wormhole.1 $out/share/man/man1/wormhole.1
120 changelog = "https://github.com/magic-wormhole/magic-wormhole/blob/${version}/NEWS.md";
121 description = "Securely transfer data between computers";
122 homepage = "https://github.com/magic-wormhole/magic-wormhole";
123 license = lib.licenses.mit;
124 maintainers = [ lib.maintainers.mjoerg ];
125 mainProgram = "wormhole";