2017-05-03 07:52:53 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2017-06-01 19:30:50 +00:00
|
|
|
, pythonAtLeast
|
2017-05-03 07:52:53 +00:00
|
|
|
, nettools
|
|
|
|
, glibcLocales
|
|
|
|
, autobahn
|
|
|
|
, cffi
|
|
|
|
, click
|
|
|
|
, hkdf
|
|
|
|
, pynacl
|
|
|
|
, spake2
|
|
|
|
, tqdm
|
|
|
|
, python
|
|
|
|
, mock
|
2017-06-01 19:30:50 +00:00
|
|
|
, ipaddress
|
|
|
|
, humanize
|
|
|
|
, pyopenssl
|
|
|
|
, service-identity
|
2017-09-05 09:16:41 +00:00
|
|
|
, txtorcon
|
2017-05-03 07:52:53 +00:00
|
|
|
}:
|
2016-11-25 08:12:23 +00:00
|
|
|
|
2017-05-03 07:52:53 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "magic-wormhole";
|
2018-02-03 09:53:00 +00:00
|
|
|
version = "0.10.4";
|
2017-05-03 07:52:53 +00:00
|
|
|
name = "${pname}-${version}";
|
2016-11-25 08:12:23 +00:00
|
|
|
|
2017-05-03 07:52:53 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2018-02-03 09:53:00 +00:00
|
|
|
sha256 = "cd3105975e71bc6437848c7fc9f0b23ef0e0c625c8b19ec66a5ddc727c6d11ae";
|
2016-11-25 08:12:23 +00:00
|
|
|
};
|
2016-11-25 23:34:41 +00:00
|
|
|
|
2017-05-03 07:52:53 +00:00
|
|
|
checkInputs = [ mock ];
|
2016-11-25 23:34:41 +00:00
|
|
|
buildInputs = [ nettools glibcLocales ];
|
2017-09-05 09:16:41 +00:00
|
|
|
propagatedBuildInputs = [ autobahn cffi click hkdf pynacl spake2 tqdm ipaddress humanize pyopenssl service-identity txtorcon ];
|
2016-11-25 23:34:41 +00:00
|
|
|
|
2017-05-03 07:52:53 +00:00
|
|
|
postPatch = ''
|
2016-11-25 23:34:41 +00:00
|
|
|
sed -i -e "s|'ifconfig'|'${nettools}/bin/ifconfig'|" src/wormhole/ipaddrs.py
|
2017-09-05 09:16:41 +00:00
|
|
|
sed -i -e "s|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))|" src/wormhole/test/test_cli.py
|
2017-06-01 19:30:50 +00:00
|
|
|
'' + lib.optionalString (pythonAtLeast "3.3") ''
|
|
|
|
sed -i -e 's|"ipaddress",||' setup.py
|
2016-11-25 08:12:23 +00:00
|
|
|
'';
|
|
|
|
|
2016-11-25 23:34:41 +00:00
|
|
|
checkPhase = ''
|
|
|
|
export PATH="$PATH:$out/bin"
|
|
|
|
export LANG="en_US.UTF-8"
|
|
|
|
export LC_ALL="en_US.UTF-8"
|
2017-05-03 07:52:53 +00:00
|
|
|
${python.interpreter} -m wormhole.test.run_trial wormhole
|
2016-11-25 23:34:41 +00:00
|
|
|
'';
|
2016-11-25 08:12:23 +00:00
|
|
|
|
2017-05-03 07:52:53 +00:00
|
|
|
meta = with lib; {
|
2016-11-25 08:12:23 +00:00
|
|
|
description = "Securely transfer data between computers";
|
2017-08-01 20:03:30 +00:00
|
|
|
homepage = https://github.com/warner/magic-wormhole;
|
2016-11-25 23:34:41 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ asymmetric ];
|
2016-11-25 08:12:23 +00:00
|
|
|
};
|
|
|
|
}
|