2022-05-18 14:49:53 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, spake2
|
|
|
|
, pynacl
|
|
|
|
, six
|
|
|
|
, attrs
|
|
|
|
, twisted
|
|
|
|
, autobahn
|
|
|
|
, automat
|
|
|
|
, hkdf
|
|
|
|
, tqdm
|
|
|
|
, click
|
|
|
|
, humanize
|
|
|
|
, txtorcon
|
|
|
|
, nettools
|
|
|
|
, mock
|
|
|
|
, magic-wormhole-transit-relay
|
|
|
|
, magic-wormhole-mailbox-server
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "magic-wormhole";
|
|
|
|
version = "0.12.0";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
|
|
|
sha256 = "0q41j99718y7m95zg1vaybnsp31lp6lhyqkbv4yqz5ys6jixh3qv";
|
|
|
|
};
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
spake2
|
|
|
|
pynacl
|
|
|
|
six
|
|
|
|
attrs
|
|
|
|
twisted
|
|
|
|
autobahn
|
|
|
|
automat
|
|
|
|
hkdf
|
|
|
|
tqdm
|
|
|
|
click
|
|
|
|
humanize
|
|
|
|
txtorcon
|
|
|
|
] ++ autobahn.extras-require.twisted
|
|
|
|
++ twisted.extras-require.tls;
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
mock
|
|
|
|
magic-wormhole-transit-relay
|
|
|
|
magic-wormhole-mailbox-server
|
|
|
|
twisted
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
postPatch = lib.optionalString stdenv.isLinux ''
|
2020-04-24 23:36:52 +00:00
|
|
|
sed -i -e "s|'ifconfig'|'${nettools}/bin/ifconfig'|" src/wormhole/ipaddrs.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
install -Dm644 docs/wormhole.1 $out/share/man/man1/wormhole.1
|
|
|
|
'';
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
checkPhase = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
export PATH=$out/bin:$PATH
|
|
|
|
export LANG="en_US.UTF-8"
|
|
|
|
export LC_ALL="en_US.UTF-8"
|
|
|
|
substituteInPlace src/wormhole/test/test_cli.py \
|
|
|
|
--replace 'getProcessOutputAndValue("locale", ["-a"])' 'getProcessOutputAndValue("locale", ["-a"], env=os.environ)' \
|
|
|
|
--replace 'if (os.path.dirname(os.path.abspath(wormhole))' 'if not os.path.abspath(wormhole).startswith("/nix/store") and (os.path.dirname(os.path.abspath(wormhole))' \
|
|
|
|
--replace 'locale_env = dict(LC_ALL=locale, LANG=locale)' 'locale_env = dict(LC_ALL=locale, LANG=locale, LOCALE_ARCHIVE=os.getenv("LOCALE_ARCHIVE"))'
|
2022-05-18 14:49:53 +00:00
|
|
|
|
|
|
|
trial -j$NIX_BUILD_CORES wormhole
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
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";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2022-05-18 14:49:53 +00:00
|
|
|
maintainers = with maintainers; [ asymmetric SuperSandro2000 ];
|
2021-10-04 12:37:57 +00:00
|
|
|
mainProgram = "wormhole";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|