depot/third_party/nixpkgs/pkgs/development/python-modules/pycryptodome/default.nix
Default email ca5ab3a501 Project import generated by Copybara.
GitOrigin-RevId: 4a01ca36d6bfc133bc617e661916a81327c9bbc8
2022-07-14 08:49:19 -04:00

43 lines
885 B
Nix

{ lib
, buildPythonPackage
, callPackage
, fetchFromGitHub
, cffi
, gmp
}:
let
test-vectors = callPackage ./vectors.nix { };
in
buildPythonPackage rec {
pname = "pycryptodome";
version = "3.15.0";
format = "setuptools";
src = fetchFromGitHub {
owner = "Legrandin";
repo = "pycryptodome";
rev = "v${version}";
hash = "sha256-SPRoAfwP1MFlVzZsVWmXDWUY5Yje7eg7d+9zJhZNXrw=";
};
postPatch = ''
substituteInPlace lib/Crypto/Math/_IntegerGMP.py \
--replace 'load_lib("gmp"' 'load_lib("${gmp}/lib/libgmp.so.10"'
'';
checkInputs = [
test-vectors
];
pythonImportsCheck = [
"Crypto"
];
meta = with lib; {
description = "Self-contained cryptographic library";
homepage = "https://github.com/Legrandin/pycryptodome";
license = with licenses; [ bsd2 /* and */ asl20 ];
maintainers = with maintainers; [ fab ];
};
}