depot/third_party/nixpkgs/pkgs/development/python-modules/pycryptodome/default.nix
Default email e7ec2969af Project import generated by Copybara.
GitOrigin-RevId: 9b19f5e77dd906cb52dade0b7bd280339d2a1f3d
2024-01-13 09:15:51 +01:00

43 lines
986 B
Nix

{ lib
, buildPythonPackage
, callPackage
, fetchFromGitHub
, gmp
}:
let
test-vectors = callPackage ./vectors.nix { };
in
buildPythonPackage rec {
pname = "pycryptodome";
version = "3.19.0";
format = "setuptools";
src = fetchFromGitHub {
owner = "Legrandin";
repo = "pycryptodome";
rev = "refs/tags/v${version}";
hash = "sha256-WD+OEjePVtqlmn7h1CIfraLuEQlodkvjmYQ8q7nNoGU=";
};
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 ];
};
}