Ihar Hrachyshka dd0f03a56c treewide: remove usage of deprecated apple_sdk framework stubs
They are not doing anything right now. This is in preparation for their
complete removal from the tree.

Note: several changes that affect the derivation inputs (e.g. removal of
references to stub paths in build instructions) were left out. They will
be cleaned up the next iteration and will require special care.

Note: this PR is a result of a mix of ugly regex (not AST) based
automation and some manual labor. For reference, the regex automation
part was hacked in: https://github.com/booxter/nix-clean-apple_sdk

Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
2025-04-19 20:28:20 -04:00

104 lines
2.3 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
callPackage,
setuptools,
bcrypt,
certifi,
cffi,
cryptography-vectors ? (callPackage ./vectors.nix { }),
fetchFromGitHub,
isPyPy,
libiconv,
libxcrypt,
openssl,
pkg-config,
pretend,
pytest-xdist,
pytestCheckHook,
pythonOlder,
rustPlatform,
}:
buildPythonPackage rec {
pname = "cryptography";
version = "44.0.2"; # Also update the hash in vectors.nix
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "pyca";
repo = "cryptography";
tag = version;
hash = "sha256-nXwW6v+U47/+CmjhREHcuQ7QQi/b26gagWBQ3F16DuQ=";
};
cargoDeps = rustPlatform.fetchCargoVendor {
inherit src;
name = "${pname}-${version}";
hash = "sha256-HbUsV+ABE89UvhCRZYXr+Q/zRDKUy+HgCVdQFHqaP4o=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail "--benchmark-disable" ""
'';
build-system = [
rustPlatform.cargoSetupHook
rustPlatform.maturinBuildHook
pkg-config
setuptools
] ++ lib.optionals (!isPyPy) [ cffi ];
buildInputs =
[ openssl ]
++ lib.optionals stdenv.hostPlatform.isDarwin [
libiconv
]
++ lib.optionals (pythonOlder "3.9") [ libxcrypt ];
dependencies = lib.optionals (!isPyPy) [ cffi ];
optional-dependencies.ssh = [ bcrypt ];
nativeCheckInputs = [
certifi
cryptography-vectors
pretend
pytestCheckHook
pytest-xdist
] ++ optional-dependencies.ssh;
pytestFlagsArray = [ "--disable-pytest-warnings" ];
disabledTestPaths = [
# save compute time by not running benchmarks
"tests/bench"
];
passthru = {
vectors = cryptography-vectors;
};
meta = with lib; {
description = "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.
'';
homepage = "https://github.com/pyca/cryptography";
changelog =
"https://cryptography.io/en/latest/changelog/#v" + replaceStrings [ "." ] [ "-" ] version;
license = with licenses; [
asl20
bsd3
psfl
];
maintainers = with maintainers; [ SuperSandro2000 ];
};
}