2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
2020-08-20 17:08:02 +00:00
|
|
|
, buildPythonPackage
|
2022-10-21 18:38:19 +00:00
|
|
|
, python
|
|
|
|
, runCommand
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitHub
|
2022-10-21 18:38:19 +00:00
|
|
|
, configargparse
|
|
|
|
, acme
|
|
|
|
, configobj
|
|
|
|
, cryptography
|
|
|
|
, distro
|
|
|
|
, josepy
|
|
|
|
, parsedatetime
|
|
|
|
, pyRFC3339
|
|
|
|
, pyopenssl
|
|
|
|
, pytz
|
|
|
|
, requests
|
|
|
|
, six
|
|
|
|
, zope_component
|
|
|
|
, zope_interface
|
|
|
|
, dialog
|
|
|
|
, gnureadline
|
|
|
|
, pytest-xdist
|
|
|
|
, pytestCheckHook
|
|
|
|
, python-dateutil
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
buildPythonPackage rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "certbot";
|
2023-03-15 16:39:30 +00:00
|
|
|
version = "2.3.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-LhipH6kw/fKBy+nHrC5F7HtCdDbUWSjL85LiEC1bGT8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
sourceRoot = "source/${pname}";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
2021-07-24 12:14:16 +00:00
|
|
|
configargparse
|
2020-04-24 23:36:52 +00:00
|
|
|
acme
|
|
|
|
configobj
|
|
|
|
cryptography
|
|
|
|
distro
|
|
|
|
josepy
|
|
|
|
parsedatetime
|
|
|
|
pyRFC3339
|
|
|
|
pyopenssl
|
|
|
|
pytz
|
|
|
|
requests
|
|
|
|
six
|
|
|
|
zope_component
|
|
|
|
zope_interface
|
|
|
|
];
|
|
|
|
|
2021-04-05 15:23:46 +00:00
|
|
|
buildInputs = [ dialog gnureadline ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-07-04 02:40:35 +00:00
|
|
|
python-dateutil
|
2020-08-20 17:08:02 +00:00
|
|
|
pytestCheckHook
|
2021-07-24 12:14:16 +00:00
|
|
|
pytest-xdist
|
2020-08-20 17:08:02 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-04-05 15:23:46 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"-o cache_dir=$(mktemp -d)"
|
|
|
|
# See https://github.com/certbot/certbot/issues/8746
|
|
|
|
"-W ignore::ResourceWarning"
|
2022-09-30 11:47:45 +00:00
|
|
|
"-W ignore::DeprecationWarning"
|
2021-04-05 15:23:46 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
makeWrapperArgs = [ "--prefix PATH : ${dialog}/bin" ];
|
|
|
|
|
|
|
|
# certbot.withPlugins has a similar calling convention as python*.withPackages
|
|
|
|
# it gets invoked with a lambda, and invokes that lambda with the python package set matching certbot's:
|
|
|
|
# certbot.withPlugins (cp: [ cp.certbot-dns-foo ])
|
2022-10-21 18:38:19 +00:00
|
|
|
passthru.withPlugins = f:
|
|
|
|
let
|
|
|
|
pythonEnv = python.withPackages f;
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
in
|
|
|
|
runCommand "certbot-with-plugins"
|
|
|
|
{ } ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cd $out/bin
|
|
|
|
ln -s ${pythonEnv}/bin/certbot
|
|
|
|
'';
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = src.meta.homepage;
|
|
|
|
description = "ACME client that can obtain certs and extensibly update server configurations";
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ domenkozar ];
|
|
|
|
license = with licenses; [ asl20 ];
|
|
|
|
};
|
|
|
|
}
|