Files
nixpkgs/pkgs/development/python-modules/magic-wormhole/default.nix
T

58 lines
1.4 KiB
Nix
Raw Normal View History

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