2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2023-02-02 18:25:31 +00:00
|
|
|
, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
, swig2
|
|
|
|
, openssl
|
|
|
|
, typing
|
2023-02-02 18:25:31 +00:00
|
|
|
, parameterized
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2023-02-02 18:25:31 +00:00
|
|
|
version = "0.38.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "M2Crypto";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-02-02 18:25:31 +00:00
|
|
|
sha256 = "sha256-mfImCjCQHJSajcbV+CzVMS/7iryS52YzuvIxu7yy3ss=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
2023-02-02 18:25:31 +00:00
|
|
|
# Use OpenSSL_version_num() instead of unrealiable parsing of .h file.
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://src.fedoraproject.org/rpms/m2crypto/raw/42951285c800f72e0f0511cec39a7f49e970a05c/f/m2crypto-MR271-opensslversion.patch";
|
|
|
|
hash = "sha256-e1/NHgWza+kum76MUFSofq9Ko3pML67PUfqWjcwIl+A=";
|
|
|
|
})
|
|
|
|
# Changed required to pass tests on OpenSSL 3.0
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://src.fedoraproject.org/rpms/m2crypto/raw/42951285c800f72e0f0511cec39a7f49e970a05c/f/m2crypto-0.38-ossl3-tests.patch";
|
|
|
|
hash = "sha256-B6JKoPh76+CIna6zmrvFj50DIp3pzg8aKyzz+Q5hqQ0=";
|
|
|
|
})
|
|
|
|
# Allow EVP tests fail on non-FIPS algorithms
|
2020-04-24 23:36:52 +00:00
|
|
|
(fetchpatch {
|
2023-02-02 18:25:31 +00:00
|
|
|
url = "https://src.fedoraproject.org/rpms/m2crypto/raw/42951285c800f72e0f0511cec39a7f49e970a05c/f/m2crypto-0.38-ossl3-tests-evp.patch";
|
|
|
|
hash = "sha256-jMUAphVBQMFaOJSeYUCQMV3WSe9VDQqG6GY5fDQXZnA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeBuildInputs = [ swig2 openssl ];
|
|
|
|
buildInputs = [ openssl parameterized ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A Python crypto and SSL toolkit";
|
|
|
|
homepage = "https://gitlab.com/m2crypto/m2crypto";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ andrew-d ];
|
|
|
|
};
|
|
|
|
}
|