Merge pull request #175002 from SuperSandro2000/pycryptodome
commit
525ba38f95
@ -1,28 +1,43 @@ |
||||
{ lib |
||||
, buildPythonPackage |
||||
, fetchPypi |
||||
, pycryptodome-test-vectors |
||||
, callPackage |
||||
, fetchFromGitHub |
||||
, cffi |
||||
, gmp |
||||
}: |
||||
|
||||
let |
||||
test-vectors = callPackage ./vectors.nix { }; |
||||
in |
||||
buildPythonPackage rec { |
||||
pname = "pycryptodome"; |
||||
version = "3.14.1"; |
||||
format = "setuptools"; |
||||
|
||||
src = fetchPypi { |
||||
inherit pname version; |
||||
hash = "sha256-4E5Ap/jBZpGVU2o3l53YfaLDLb3HPW/jXwB3sMF8gDs="; |
||||
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 = "Python Cryptography Toolkit"; |
||||
homepage = "https://www.pycryptodome.org/"; |
||||
description = "Self-contained cryptographic library"; |
||||
homepage = "https://github.com/Legrandin/pycryptodome"; |
||||
license = with licenses; [ bsd2 /* and */ asl20 ]; |
||||
maintainers = with maintainers; [ fab ]; |
||||
platforms = platforms.unix; |
||||
}; |
||||
} |
||||
|
@ -1,27 +1,13 @@ |
||||
{ lib |
||||
, buildPythonPackage |
||||
, fetchPypi |
||||
, pycryptodome-test-vectors |
||||
}: |
||||
{ pycryptodome }: |
||||
|
||||
buildPythonPackage rec { |
||||
(pycryptodome.overrideAttrs (oldAttrs: rec { |
||||
pname = "pycryptodomex"; |
||||
version = "3.14.1"; |
||||
format = "setuptools"; |
||||
|
||||
src = fetchPypi { |
||||
inherit pname version; |
||||
hash = "sha256-LOdu0Agf1qyMdO3HW50U7KIGQXOveYQ8JPpiVzJjwfI="; |
||||
}; |
||||
postPatch = '' |
||||
touch .separate_namespace |
||||
''; |
||||
|
||||
pythonImportsCheck = [ |
||||
"Cryptodome" |
||||
]; |
||||
|
||||
meta = with lib; { |
||||
description = "A self-contained cryptographic library for Python"; |
||||
homepage = "https://www.pycryptodome.org"; |
||||
license = with licenses; [ bsd2 /* and */ asl20 ]; |
||||
maintainers = with maintainers; [ fab ]; |
||||
}; |
||||
} |
||||
})) |
||||
|
Loading…
Reference in new issue