blob: ef7b571170f3eaafde6bcc078cfbd698b1e82ded (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
{ lib
, buildPythonPackage
, callPackage
, fetchFromGitHub
, cffi
, gmp
}:
let
test-vectors = callPackage ./vectors.nix { };
in
buildPythonPackage rec {
pname = "pycryptodome";
version = "3.14.1";
format = "setuptools";
src = fetchFromGitHub {
owner = "Legrandin";
repo = "pycryptodome";
rev = "v${version}";
hash = "sha256-0GjpKNyALe2Q1R3dEjeAEn6E8hxYDic/vbN1YkVaUfs=";
};
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 ];
};
}
|