d5f4a57cbf
GitOrigin-RevId: ce5e4a6ef2e59d89a971bc434ca8ca222b9c7f5e
43 lines
986 B
Nix
43 lines
986 B
Nix
{ lib
|
|
, buildPythonPackage
|
|
, callPackage
|
|
, fetchFromGitHub
|
|
, gmp
|
|
}:
|
|
|
|
let
|
|
test-vectors = callPackage ./vectors.nix { };
|
|
in
|
|
buildPythonPackage rec {
|
|
pname = "pycryptodome";
|
|
version = "3.18.0";
|
|
format = "setuptools";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "Legrandin";
|
|
repo = "pycryptodome";
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-6oXXy18KlSjfyZhfMnIgnu34u/9sG0TPYvPJ8ovTqMA=";
|
|
};
|
|
|
|
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 ];
|
|
};
|
|
}
|