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";
|
2020-04-10 02:06:15 +01:00
|
|
|
version = "0.12.0";
|
2016-11-25 08:12:23 +00:00
|
|
|
|
2017-05-03 08:52:53 +01:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-04-10 02:06:15 +01:00
|
|
|
sha256 = "0q41j99718y7m95zg1vaybnsp31lp6lhyqkbv4yqz5ys6jixh3qv";
|
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
|
|
|
|
2020-04-10 02:06:15 +01:00
|
|
|
postPatch = stdenv.lib.optionalString stdenv.isLinux ''
|
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";
|
2020-04-10 02:06:15 +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
|
|
|
};
|
|
|
|
}
|