2019-02-24 19:45:56 +01:00
|
|
|
{ stdenv
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, pytest
|
|
|
|
, libsodium
|
|
|
|
, cffi
|
|
|
|
, six
|
|
|
|
, hypothesis
|
|
|
|
}:
|
2018-02-11 00:01:48 +01:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pynacl";
|
2018-09-27 13:25:04 +02:00
|
|
|
version = "1.3.0";
|
2018-02-11 00:01:48 +01:00
|
|
|
|
2019-02-24 19:45:56 +01:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit version;
|
|
|
|
pname = "PyNaCl";
|
|
|
|
sha256 = "0c6100edd16fefd1557da078c7a31e7b7d7a52ce39fdca2bec29d4f7b6e7600c";
|
2018-02-11 00:01:48 +01:00
|
|
|
};
|
|
|
|
|
2018-02-18 18:01:56 +01:00
|
|
|
checkInputs = [ pytest hypothesis ];
|
2019-02-25 15:16:21 +01:00
|
|
|
buildInputs = [ libsodium ];
|
|
|
|
propagatedBuildInputs = [ cffi six ];
|
2018-02-11 00:01:48 +01:00
|
|
|
|
2018-02-18 18:02:18 +01:00
|
|
|
SODIUM_INSTALL = "system";
|
|
|
|
|
2019-02-24 19:45:56 +01:00
|
|
|
# fixed in next release 1.3.0+
|
|
|
|
# https://github.com/pyca/pynacl/pull/480
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace tests/test_bindings.py \
|
|
|
|
--replace "average_size=128," ""
|
|
|
|
'';
|
|
|
|
|
2018-02-11 00:01:48 +01:00
|
|
|
checkPhase = ''
|
2018-02-18 18:01:56 +01:00
|
|
|
py.test
|
2018-02-11 00:01:48 +01:00
|
|
|
'';
|
2018-09-27 13:25:04 +02:00
|
|
|
|
2019-08-18 10:08:31 +02:00
|
|
|
# https://github.com/pyca/pynacl/issues/550
|
|
|
|
PYTEST_ADDOPTS = "-k 'not test_wrong_types'";
|
|
|
|
|
2018-02-11 00:01:48 +01:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
maintainers = with maintainers; [ va1entin ];
|
|
|
|
description = "Python binding to the Networking and Cryptography (NaCl) library";
|
|
|
|
homepage = https://github.com/pyca/pynacl/;
|
|
|
|
license = licenses.asl20;
|
|
|
|
};
|
|
|
|
}
|