depot/third_party/nixpkgs/pkgs/development/python-modules/pycryptodome/default.nix
Default email fa5436e0a7 Project import generated by Copybara.
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
2024-06-05 17:53:02 +02:00

43 lines
993 B
Nix

{
lib,
buildPythonPackage,
callPackage,
fetchFromGitHub,
gmp,
}:
let
test-vectors = callPackage ./vectors.nix { };
in
buildPythonPackage rec {
pname = "pycryptodome";
version = "3.20.0";
format = "setuptools";
src = fetchFromGitHub {
owner = "Legrandin";
repo = "pycryptodome";
rev = "refs/tags/v${version}";
hash = "sha256-RPaBUj/BJCO+10maGDmugeEXxaIrlk2UHIvkbrQVM8c=";
};
postPatch = ''
substituteInPlace lib/Crypto/Math/_IntegerGMP.py \
--replace 'load_lib("gmp"' 'load_lib("${gmp}/lib/libgmp.so.10"'
'';
nativeCheckInputs = [ test-vectors ];
pythonImportsCheck = [ "Crypto" ];
meta = with lib; {
description = "Self-contained cryptographic library";
homepage = "https://github.com/Legrandin/pycryptodome";
changelog = "https://github.com/Legrandin/pycryptodome/blob/v${version}/Changelog.rst";
license = with licenses; [
bsd2 # and
asl20
];
maintainers = with maintainers; [ fab ];
};
}