2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2022-12-17 10:02:37 +00:00
|
|
|
, cacert
|
2022-03-30 09:31:56 +00:00
|
|
|
, pythonOlder
|
2021-06-28 23:13:55 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "certifi";
|
2022-12-17 10:02:37 +00:00
|
|
|
version = "2022.12.07";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = "python-certifi";
|
|
|
|
rev = version;
|
2022-12-17 10:02:37 +00:00
|
|
|
hash = "sha256-r6TJ6YGL0cygz+F6g6wiqBfBa/QKhynZ92C6lHTZ2rI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
patches = [
|
|
|
|
# Add support for NIX_SSL_CERT_FILE
|
|
|
|
./env.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# Use our system-wide ca-bundle instead of the bundled one
|
|
|
|
rm -v "certifi/cacert.pem"
|
|
|
|
ln -snvf "${cacert}/etc/ssl/certs/ca-bundle.crt" "certifi/cacert.pem"
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedNativeBuildInputs = [
|
|
|
|
# propagate cacerts setup-hook to set up `NIX_SSL_CERT_FILE`
|
|
|
|
cacert
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-06-28 23:13:55 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
2020-05-15 21:57:56 +00:00
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"certifi"
|
|
|
|
];
|
2020-05-15 21:57:56 +00:00
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
meta = with lib; {
|
2021-12-30 13:39:12 +00:00
|
|
|
homepage = "https://github.com/certifi/python-certifi";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Python package for providing Mozilla's CA Bundle";
|
2021-06-28 23:13:55 +00:00
|
|
|
license = licenses.isc;
|
2022-03-30 09:31:56 +00:00
|
|
|
maintainers = with maintainers; [ koral SuperSandro2000 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|