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