e7ec2969af
GitOrigin-RevId: 9b19f5e77dd906cb52dade0b7bd280339d2a1f3d
58 lines
1.1 KiB
Nix
58 lines
1.1 KiB
Nix
{ lib
|
|
, buildPythonPackage
|
|
, cacert
|
|
, pythonOlder
|
|
, fetchFromGitHub
|
|
, setuptools
|
|
, pytestCheckHook
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "certifi";
|
|
version = "2023.11.17";
|
|
pyproject = true;
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = pname;
|
|
repo = "python-certifi";
|
|
rev = version;
|
|
hash = "sha256-H3zsFJjWt2+tT7yqQOOZZwSL5y0AtfDz6Fqxwpm4Wl8=";
|
|
};
|
|
|
|
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"
|
|
'';
|
|
|
|
nativeBuildInputs = [
|
|
setuptools
|
|
];
|
|
|
|
propagatedNativeBuildInputs = [
|
|
# propagate cacerts setup-hook to set up `NIX_SSL_CERT_FILE`
|
|
cacert
|
|
];
|
|
|
|
nativeCheckInputs = [
|
|
pytestCheckHook
|
|
];
|
|
|
|
pythonImportsCheck = [
|
|
"certifi"
|
|
];
|
|
|
|
meta = with lib; {
|
|
homepage = "https://github.com/certifi/python-certifi";
|
|
description = "Python package for providing Mozilla's CA Bundle";
|
|
license = licenses.isc;
|
|
maintainers = with maintainers; [ koral ];
|
|
};
|
|
}
|