2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv
|
2018-02-03 11:36:14 +01:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2019-09-13 19:47:04 +02:00
|
|
|
, fetchpatch
|
2020-04-07 21:36:45 +02:00
|
|
|
, isPy27
|
|
|
|
, ipaddress
|
2018-02-03 11:36:14 +01:00
|
|
|
, openssl
|
|
|
|
, cryptography_vectors
|
|
|
|
, darwin
|
|
|
|
, packaging
|
|
|
|
, six
|
|
|
|
, pythonOlder
|
|
|
|
, isPyPy
|
|
|
|
, cffi
|
|
|
|
, pytest
|
|
|
|
, pretend
|
|
|
|
, iso8601
|
|
|
|
, pytz
|
|
|
|
, hypothesis
|
2020-04-18 07:25:52 +02:00
|
|
|
, enum34
|
2018-02-03 11:36:14 +01:00
|
|
|
}:
|
|
|
|
|
2018-08-21 02:47:41 +02:00
|
|
|
buildPythonPackage rec {
|
2018-02-03 11:36:14 +01:00
|
|
|
pname = "cryptography";
|
2020-12-10 13:38:54 +01:00
|
|
|
version = "3.3.1"; # Also update the hash in vectors.nix
|
2018-02-03 11:36:14 +01:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-12-10 13:38:54 +01:00
|
|
|
sha256 = "1ribd1vxq9wwz564mg60dzcy699gng54admihjjkgs9dx95pw5vy";
|
2018-02-03 11:36:14 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2020-11-19 20:57:37 +01:00
|
|
|
nativeBuildInputs = stdenv.lib.optionals (!isPyPy) [
|
|
|
|
cffi
|
|
|
|
];
|
|
|
|
|
2019-03-30 17:13:09 +01:00
|
|
|
buildInputs = [ openssl ]
|
2018-02-03 11:36:14 +01:00
|
|
|
++ stdenv.lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Security;
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
packaging
|
|
|
|
six
|
2020-11-19 20:57:37 +01:00
|
|
|
] ++ stdenv.lib.optionals (!isPyPy) [
|
|
|
|
cffi
|
|
|
|
] ++ stdenv.lib.optionals isPy27 [
|
|
|
|
ipaddress enum34
|
|
|
|
];
|
2018-02-03 11:36:14 +01:00
|
|
|
|
|
|
|
checkInputs = [
|
2019-03-30 17:13:09 +01:00
|
|
|
cryptography_vectors
|
|
|
|
hypothesis
|
2018-02-03 11:36:14 +01:00
|
|
|
iso8601
|
2019-03-30 17:13:09 +01:00
|
|
|
pretend
|
|
|
|
pytest
|
2018-02-03 11:36:14 +01:00
|
|
|
pytz
|
|
|
|
];
|
|
|
|
|
2018-11-11 08:55:35 +01:00
|
|
|
checkPhase = ''
|
2020-04-03 15:36:19 +02:00
|
|
|
py.test --disable-pytest-warnings tests
|
2018-11-11 08:55:35 +01:00
|
|
|
'';
|
|
|
|
|
2018-02-03 11:36:14 +01:00
|
|
|
# IOKit's dependencies are inconsistent between OSX versions, so this is the best we
|
|
|
|
# can do until nix 1.11's release
|
|
|
|
__impureHostDeps = [ "/usr/lib" ];
|
2019-01-23 23:58:29 +01:00
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2019-01-23 23:58:29 +01:00
|
|
|
description = "A package which provides cryptographic recipes and primitives";
|
|
|
|
longDescription = ''
|
|
|
|
Cryptography includes both high level recipes and low level interfaces to
|
|
|
|
common cryptographic algorithms such as symmetric ciphers, message
|
|
|
|
digests, and key derivation functions.
|
|
|
|
Our goal is for it to be your "cryptographic standard library". It
|
2020-04-03 15:36:19 +02:00
|
|
|
supports Python 2.7, Python 3.5+, and PyPy 5.4+.
|
2019-01-23 23:58:29 +01:00
|
|
|
'';
|
2020-04-03 15:36:19 +02:00
|
|
|
homepage = "https://github.com/pyca/cryptography";
|
|
|
|
changelog = "https://cryptography.io/en/latest/changelog/#v"
|
|
|
|
+ replaceStrings [ "." ] [ "-" ] version;
|
2019-01-23 23:58:29 +01:00
|
|
|
license = with licenses; [ asl20 bsd3 psfl ];
|
|
|
|
maintainers = with maintainers; [ primeos ];
|
|
|
|
};
|
2018-08-21 02:47:41 +02:00
|
|
|
}
|