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