23 buildPythonPackage rec {
24 pname = "cryptography";
25 version = "3.4.7"; # Also update the hash in vectors.nix
28 inherit pname version;
29 sha256 = "04x7bhjkglxpllad10821vxddlmxdkd3gjvp35iljmnj2s0xw41x";
32 cargoDeps = rustPlatform.fetchCargoTarball {
34 sourceRoot = "${pname}-${version}/${cargoRoot}";
35 name = "${pname}-${version}";
36 sha256 = "1wisxmq26b8ml144m2458sgcbk8jpv419j01qmffsrfy50x9i1yw";
39 cargoRoot = "src/rust";
41 outputs = [ "out" "dev" ];
43 nativeBuildInputs = lib.optionals (!isPyPy) [
46 rustPlatform.cargoSetupHook
48 ] ++ (with rustPlatform; [ rust.cargo rust.rustc ]);
50 buildInputs = [ openssl ]
51 ++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Security;
52 propagatedBuildInputs = [
55 ] ++ lib.optionals (!isPyPy) [
70 py.test --disable-pytest-warnings tests
73 # IOKit's dependencies are inconsistent between OSX versions, so this is the best we
74 # can do until nix 1.11's release
75 __impureHostDeps = [ "/usr/lib" ];
78 description = "A package which provides cryptographic recipes and primitives";
80 Cryptography includes both high level recipes and low level interfaces to
81 common cryptographic algorithms such as symmetric ciphers, message
82 digests, and key derivation functions.
83 Our goal is for it to be your "cryptographic standard library". It
84 supports Python 2.7, Python 3.5+, and PyPy 5.4+.
86 homepage = "https://github.com/pyca/cryptography";
87 changelog = "https://cryptography.io/en/latest/changelog/#v"
88 + replaceStrings [ "." ] [ "-" ] version;
89 license = with licenses; [ asl20 bsd3 psfl ];
90 maintainers = with maintainers; [ primeos ];