Merge pull request #92786 from flokli/certbot-with-plugins

certbot: add certbot.withPlugins
This commit is contained in:
Florian Klink 2020-07-22 12:53:07 +02:00 committed by GitHub
commit 3d50d643f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 20 deletions

View File

@ -1,12 +1,13 @@
{ lib
, buildPythonApplication
, buildPythonPackage
, python, runCommand
, fetchFromGitHub
, ConfigArgParse, acme, configobj, cryptography, distro, josepy, parsedatetime, pyRFC3339, pyopenssl, pytz, requests, six, zope_component, zope_interface
, dialog, mock, gnureadline
, pytest_xdist, pytest, dateutil
, pytest_xdist, pytest, pytestCheckHook, dateutil
}:
buildPythonApplication rec {
buildPythonPackage rec {
pname = "certbot";
version = "1.6.0";
@ -17,6 +18,8 @@ buildPythonApplication rec {
sha256 = "1y0m5qm853i6pcpb2mrf8kjkr9wr80mdrx1qmck38ayvr2v2p5lc";
};
sourceRoot = "source/${pname}";
propagatedBuildInputs = [
ConfigArgParse
acme
@ -36,21 +39,32 @@ buildPythonApplication rec {
buildInputs = [ dialog mock gnureadline ];
checkInputs = [ pytest_xdist pytest dateutil ];
checkInputs = [
dateutil
pytest
pytestCheckHook
pytest_xdist
];
preBuild = ''
cd certbot
'';
postInstall = ''
for i in $out/bin/*; do
wrapProgram "$i" --prefix PYTHONPATH : "$PYTHONPATH" \
--prefix PATH : "${dialog}/bin:$PATH"
done
'';
pytestFlagsArray = [ "-o cache_dir=$(mktemp -d)" ];
doCheck = true;
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 ])
passthru.withPlugins = f: let
pythonEnv = python.withPackages f;
in runCommand "certbot-with-plugins" {
} ''
mkdir -p $out/bin
cd $out/bin
ln -s ${pythonEnv}/bin/certbot
'';
meta = with lib; {
homepage = src.meta.homepage;
description = "ACME client that can obtain certs and extensibly update server configurations";

View File

@ -11598,7 +11598,13 @@ in
ogre = ogre1_10;
};
certbot = python3Packages.callPackage ../tools/admin/certbot { };
certbot = python3.pkgs.toPythonApplication python3.pkgs.certbot;
certbot-full = certbot.withPlugins (cp: with cp; [
certbot-dns-cloudflare
certbot-dns-rfc2136
certbot-dns-route53
]);
caf = callPackage ../development/libraries/caf {};

View File

@ -585,6 +585,8 @@ in {
cdecimal = callPackage ../development/python-modules/cdecimal { };
certbot = callPackage ../development/python-modules/certbot { };
certbot-dns-cloudflare = callPackage ../development/python-modules/certbot-dns-cloudflare { };
certbot-dns-rfc2136 = callPackage ../development/python-modules/certbot-dns-rfc2136 { };
@ -1047,7 +1049,7 @@ in {
nvchecker = callPackage ../development/python-modules/nvchecker { };
numericalunits = callPackage ../development/python-modules/numericalunits { };
nunavut = callPackage ../development/python-modules/nunavut { };
oath = callPackage ../development/python-modules/oath { };
@ -1681,7 +1683,7 @@ in {
inherit (pkgs.darwin.apple_sdk.frameworks) ApplicationServices CoreServices;
};
pyuavcan = callPackage ../development/python-modules/pyuavcan {
pyuavcan = callPackage ../development/python-modules/pyuavcan {
# this version pinpoint to anold version is necessary due to a regression
nunavut = self.nunavut.overridePythonAttrs ( old: rec {
version = "0.2.3";
@ -4495,7 +4497,7 @@ in {
}));
libkeepass = callPackage ../development/python-modules/libkeepass { };
libredwg = toPythonModule (pkgs.libredwg.override {
enablePython = true;
inherit (self) python libxml2;
@ -4548,7 +4550,7 @@ in {
locustio = callPackage ../development/python-modules/locustio { };
llvmlite = callPackage ../development/python-modules/llvmlite {
llvmlite = callPackage ../development/python-modules/llvmlite {
llvm = pkgs.llvm_9; # llvmlite always requires a specific version of llvm.
};
@ -6710,7 +6712,7 @@ in {
zipp = if pythonOlder "3.6" then
callPackage ../development/python-modules/zipp/1.nix { }
else
else
callPackage ../development/python-modules/zipp { };
zope_broken = callPackage ../development/python-modules/zope_broken { };