1{ lib
2, buildPythonPackage
3, python
4, runCommand
5, fetchFromGitHub
6, configargparse
7, acme
8, configobj
9, cryptography
10, distro
11, josepy
12, parsedatetime
13, pyRFC3339
14, pyopenssl
15, pytz
16, requests
17, six
18, zope_component
19, zope_interface
20, dialog
21, gnureadline
22, pytest-xdist
23, pytestCheckHook
24, python-dateutil
25}:
26
27buildPythonPackage rec {
28 pname = "certbot";
29 version = "1.31.0";
30
31 src = fetchFromGitHub {
32 owner = pname;
33 repo = pname;
34 rev = "refs/tags/v${version}";
35 sha256 = "sha256-JDhesUU6SQBEf0CG3vo1AhlRfGpltTEUmSqrpGIpptg=";
36 };
37
38 sourceRoot = "source/${pname}";
39
40 propagatedBuildInputs = [
41 configargparse
42 acme
43 configobj
44 cryptography
45 distro
46 josepy
47 parsedatetime
48 pyRFC3339
49 pyopenssl
50 pytz
51 requests
52 six
53 zope_component
54 zope_interface
55 ];
56
57 buildInputs = [ dialog gnureadline ];
58
59 checkInputs = [
60 python-dateutil
61 pytestCheckHook
62 pytest-xdist
63 ];
64
65 pytestFlagsArray = [
66 "-o cache_dir=$(mktemp -d)"
67 # See https://github.com/certbot/certbot/issues/8746
68 "-W ignore::ResourceWarning"
69 "-W ignore::DeprecationWarning"
70 ];
71
72 doCheck = true;
73
74 makeWrapperArgs = [ "--prefix PATH : ${dialog}/bin" ];
75
76 # certbot.withPlugins has a similar calling convention as python*.withPackages
77 # it gets invoked with a lambda, and invokes that lambda with the python package set matching certbot's:
78 # certbot.withPlugins (cp: [ cp.certbot-dns-foo ])
79 passthru.withPlugins = f:
80 let
81 pythonEnv = python.withPackages f;
82
83 in
84 runCommand "certbot-with-plugins"
85 { } ''
86 mkdir -p $out/bin
87 cd $out/bin
88 ln -s ${pythonEnv}/bin/certbot
89 '';
90
91 meta = with lib; {
92 homepage = src.meta.homepage;
93 description = "ACME client that can obtain certs and extensibly update server configurations";
94 platforms = platforms.unix;
95 maintainers = with maintainers; [ domenkozar ];
96 license = with licenses; [ asl20 ];
97 };
98}