2018-11-18 16:29:22 +00:00
|
|
|
{ stdenv
|
2017-05-03 08:52:53 +01:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2019-12-24 17:35:09 +00:00
|
|
|
, isPy27
|
2018-02-19 16:11:50 +00:00
|
|
|
, spake2
|
|
|
|
, pynacl
|
|
|
|
, six
|
|
|
|
, attrs
|
|
|
|
, twisted
|
2017-05-03 08:52:53 +01:00
|
|
|
, autobahn
|
2018-02-19 16:11:50 +00:00
|
|
|
, automat
|
2017-05-03 08:52:53 +01:00
|
|
|
, hkdf
|
|
|
|
, tqdm
|
2018-02-19 16:11:50 +00:00
|
|
|
, click
|
2017-06-01 20:30:50 +01:00
|
|
|
, humanize
|
2017-09-05 10:16:41 +01:00
|
|
|
, txtorcon
|
2018-02-19 16:11:50 +00:00
|
|
|
, nettools
|
|
|
|
, glibcLocales
|
|
|
|
, mock
|
|
|
|
, magic-wormhole-transit-relay
|
2018-11-18 16:29:22 +00:00
|
|
|
, magic-wormhole-mailbox-server
|
2017-05-03 08:52:53 +01:00
|
|
|
}:
|
2016-11-25 08:12:23 +00:00
|
|
|
|
2017-05-03 08:52:53 +01:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "magic-wormhole";
|
2018-11-18 16:29:22 +00:00
|
|
|
version = "0.11.2";
|
2016-11-25 08:12:23 +00:00
|
|
|
|
2017-05-03 08:52:53 +01:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2018-11-18 16:29:22 +00:00
|
|
|
sha256 = "01fr4bi6kc6fz9n3c4qq892inrc3nf6p2djy65yvm7xkvdxncydf";
|
2016-11-25 08:12:23 +00:00
|
|
|
};
|
2016-11-25 23:34:41 +00:00
|
|
|
|
2018-11-18 16:29:22 +00:00
|
|
|
buildInputs = [ glibcLocales ];
|
|
|
|
propagatedBuildInputs = [ spake2 pynacl six attrs twisted autobahn automat hkdf tqdm click humanize txtorcon ];
|
|
|
|
checkInputs = [ mock magic-wormhole-transit-relay magic-wormhole-mailbox-server ];
|
2016-11-25 23:34:41 +00:00
|
|
|
|
2017-05-03 08:52:53 +01:00
|
|
|
postPatch = ''
|
2016-11-25 23:34:41 +00:00
|
|
|
sed -i -e "s|'ifconfig'|'${nettools}/bin/ifconfig'|" src/wormhole/ipaddrs.py
|
2016-11-25 08:12:23 +00:00
|
|
|
'';
|
|
|
|
|
2019-07-17 08:36:08 +01:00
|
|
|
postInstall = ''
|
|
|
|
install -Dm644 docs/wormhole.1 $out/share/man/man1/wormhole.1
|
|
|
|
'';
|
|
|
|
|
2019-12-24 17:35:09 +00:00
|
|
|
# zope.interface issue
|
|
|
|
doCheck = !isPy27;
|
2018-11-18 16:29:22 +00:00
|
|
|
preCheck = ''
|
|
|
|
export PATH=$out/bin:$PATH
|
2016-11-25 23:34:41 +00:00
|
|
|
export LANG="en_US.UTF-8"
|
|
|
|
export LC_ALL="en_US.UTF-8"
|
2018-11-18 16:29:22 +00:00
|
|
|
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"))'
|
2016-11-25 23:34:41 +00:00
|
|
|
'';
|
2016-11-25 08:12:23 +00:00
|
|
|
|
2018-11-18 16:29:22 +00:00
|
|
|
meta = with stdenv.lib; {
|
2016-11-25 08:12:23 +00:00
|
|
|
description = "Securely transfer data between computers";
|
2017-08-01 21:03:30 +01:00
|
|
|
homepage = https://github.com/warner/magic-wormhole;
|
2016-11-25 23:34:41 +00:00
|
|
|
license = licenses.mit;
|
2019-12-18 21:13:19 +00:00
|
|
|
# Currently broken on Python 2.7. See
|
|
|
|
# https://github.com/NixOS/nixpkgs/issues/71826
|
|
|
|
broken = isPy27;
|
2016-11-25 23:34:41 +00:00
|
|
|
maintainers = with maintainers; [ asymmetric ];
|
2016-11-25 08:12:23 +00:00
|
|
|
};
|
|
|
|
}
|