2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
2023-11-16 04:20:00 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# build-system
|
|
|
|
setuptools,
|
2023-11-16 04:20:00 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# dependencies
|
|
|
|
spake2,
|
|
|
|
pynacl,
|
|
|
|
six,
|
|
|
|
attrs,
|
|
|
|
twisted,
|
|
|
|
autobahn,
|
|
|
|
automat,
|
|
|
|
tqdm,
|
|
|
|
click,
|
|
|
|
humanize,
|
|
|
|
iterable-io,
|
|
|
|
txtorcon,
|
|
|
|
zipstream-ng,
|
2023-11-16 04:20:00 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# optional-dependencies
|
|
|
|
noiseprotocol,
|
2023-11-16 04:20:00 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# tests
|
|
|
|
nettools,
|
|
|
|
unixtools,
|
|
|
|
mock,
|
|
|
|
magic-wormhole-transit-relay,
|
|
|
|
magic-wormhole-mailbox-server,
|
|
|
|
pytestCheckHook,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "magic-wormhole";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "0.15.0";
|
2024-05-15 15:35:15 +00:00
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-viVjtcVUe6MzvGYI8EgATI821VYTm/L/49n0HaJ5cAY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
postPatch =
|
|
|
|
# enable tests by fixing the location of the wormhole binary
|
|
|
|
''
|
|
|
|
substituteInPlace src/wormhole/test/test_cli.py --replace-fail \
|
|
|
|
'locations = procutils.which("wormhole")' \
|
|
|
|
'return "${placeholder "out"}/bin/wormhole"'
|
|
|
|
''
|
|
|
|
# fix the location of the ifconfig binary
|
2024-09-26 11:04:55 +00:00
|
|
|
+ lib.optionalString stdenv.hostPlatform.isLinux ''
|
2024-07-27 06:49:29 +00:00
|
|
|
sed -i -e "s|'ifconfig'|'${nettools}/bin/ifconfig'|" src/wormhole/ipaddrs.py
|
|
|
|
'';
|
2023-11-16 04:20:00 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
build-system = [ setuptools ];
|
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
pythonRelaxDeps = [
|
|
|
|
"spake2"
|
|
|
|
];
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
dependencies = [
|
2022-05-18 14:49:53 +00:00
|
|
|
attrs
|
|
|
|
autobahn
|
|
|
|
automat
|
|
|
|
click
|
|
|
|
humanize
|
2024-05-15 15:35:15 +00:00
|
|
|
iterable-io
|
2024-07-27 06:49:29 +00:00
|
|
|
pynacl
|
|
|
|
six
|
|
|
|
spake2
|
|
|
|
tqdm
|
|
|
|
twisted
|
2022-05-18 14:49:53 +00:00
|
|
|
txtorcon
|
2024-05-15 15:35:15 +00:00
|
|
|
zipstream-ng
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ autobahn.optional-dependencies.twisted ++ twisted.optional-dependencies.tls;
|
2022-05-18 14:49:53 +00:00
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
optional-dependencies = {
|
2024-06-05 15:53:02 +00:00
|
|
|
dilation = [ noiseprotocol ];
|
2023-11-16 04:20:00 +00:00
|
|
|
};
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
nativeCheckInputs =
|
|
|
|
# For Python 3.12, remove magic-wormhole-mailbox-server and magic-wormhole-transit-relay from test dependencies,
|
|
|
|
# which are not yet supported with this version.
|
|
|
|
lib.optionals (!magic-wormhole-mailbox-server.meta.broken) [ magic-wormhole-mailbox-server ]
|
|
|
|
++ lib.optionals (!magic-wormhole-transit-relay.meta.broken) [ magic-wormhole-transit-relay ]
|
|
|
|
++ [
|
|
|
|
mock
|
|
|
|
pytestCheckHook
|
|
|
|
]
|
2024-10-04 16:56:33 +00:00
|
|
|
++ optional-dependencies.dilation
|
2024-09-26 11:04:55 +00:00
|
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [ unixtools.locale ];
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
2022-09-30 11:47:45 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
disabledTestPaths =
|
|
|
|
# For Python 3.12, remove the tests depending on magic-wormhole-mailbox-server and magic-wormhole-transit-relay,
|
|
|
|
# which are not yet supported with this version.
|
|
|
|
lib.optionals
|
|
|
|
(magic-wormhole-mailbox-server.meta.broken || magic-wormhole-transit-relay.meta.broken)
|
|
|
|
[
|
|
|
|
"src/wormhole/test/dilate/test_full.py"
|
|
|
|
"src/wormhole/test/test_args.py"
|
|
|
|
"src/wormhole/test/test_cli.py"
|
|
|
|
"src/wormhole/test/test_wormhole.py"
|
|
|
|
"src/wormhole/test/test_xfer_util.py"
|
|
|
|
]
|
|
|
|
++ lib.optionals magic-wormhole-transit-relay.meta.broken [ "src/wormhole/test/test_transit.py" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
install -Dm644 docs/wormhole.1 $out/share/man/man1/wormhole.1
|
|
|
|
'';
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
meta = {
|
2023-11-16 04:20:00 +00:00
|
|
|
changelog = "https://github.com/magic-wormhole/magic-wormhole/blob/${version}/NEWS.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Securely transfer data between computers";
|
2022-05-18 14:49:53 +00:00
|
|
|
homepage = "https://github.com/magic-wormhole/magic-wormhole";
|
2024-05-15 15:35:15 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = [ lib.maintainers.mjoerg ];
|
2021-10-04 12:37:57 +00:00
|
|
|
mainProgram = "wormhole";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|