mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-22 05:33:23 +00:00
35750bad50
For tests that require a working ca-bundle via certifi we need to setup `NIX_SSL_CERT_FILE`, which is kindly provided by cacerts setup-hook.
53 lines
1.1 KiB
Nix
53 lines
1.1 KiB
Nix
{ lib
|
|
, buildPythonPackage
|
|
, cacert
|
|
, pythonOlder
|
|
, fetchFromGitHub
|
|
, pytestCheckHook
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "certifi";
|
|
version = "2022.12.07";
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = pname;
|
|
repo = "python-certifi";
|
|
rev = version;
|
|
hash = "sha256-r6TJ6YGL0cygz+F6g6wiqBfBa/QKhynZ92C6lHTZ2rI=";
|
|
};
|
|
|
|
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
|
|
];
|
|
|
|
checkInputs = [
|
|
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 SuperSandro2000 ];
|
|
};
|
|
}
|