summary refs log tree commit diff
path: root/pkgs/tools/admin/certbot
diff options
context:
space:
mode:
authorFrederik Rietdijk <fridh@fridh.nl>2019-10-29 14:10:31 +0100
committerFrederik Rietdijk <fridh@fridh.nl>2019-10-29 14:10:56 +0100
commit2db400d8c844ce501f0d8009a661505297ccdf81 (patch)
tree109950c5c2a63623b293cb970a4a4d67dd198151 /pkgs/tools/admin/certbot
parent298db02d7338183240f4a2431265b0ac7cb9495e (diff)
downloadnixpkgs-2db400d8c844ce501f0d8009a661505297ccdf81.tar
nixpkgs-2db400d8c844ce501f0d8009a661505297ccdf81.tar.gz
nixpkgs-2db400d8c844ce501f0d8009a661505297ccdf81.tar.bz2
nixpkgs-2db400d8c844ce501f0d8009a661505297ccdf81.tar.lz
nixpkgs-2db400d8c844ce501f0d8009a661505297ccdf81.tar.xz
nixpkgs-2db400d8c844ce501f0d8009a661505297ccdf81.tar.zst
nixpkgs-2db400d8c844ce501f0d8009a661505297ccdf81.zip
certbot: don't use distutils.StrictVersion
Diffstat (limited to 'pkgs/tools/admin/certbot')
-rw-r--r--pkgs/tools/admin/certbot/0001-Don-t-use-distutils.StrictVersion-that-cannot-handle.patch60
-rw-r--r--pkgs/tools/admin/certbot/default.nix1
2 files changed, 61 insertions, 0 deletions
diff --git a/pkgs/tools/admin/certbot/0001-Don-t-use-distutils.StrictVersion-that-cannot-handle.patch b/pkgs/tools/admin/certbot/0001-Don-t-use-distutils.StrictVersion-that-cannot-handle.patch
new file mode 100644
index 00000000000..81c1dd0e6a3
--- /dev/null
+++ b/pkgs/tools/admin/certbot/0001-Don-t-use-distutils.StrictVersion-that-cannot-handle.patch
@@ -0,0 +1,60 @@
+From 411b8a413baf39e9b967949b17a992e81a11abfe Mon Sep 17 00:00:00 2001
+From: Frederik Rietdijk <fridh@fridh.nl>
+Date: Tue, 29 Oct 2019 14:08:07 +0100
+Subject: [PATCH] Don't use distutils.StrictVersion that cannot handle certain
+ versions
+
+```
+  File "setup.py", line 63, in <module>
+    if StrictVersion(setuptools_version) >= StrictVersion('36.2'):
+File
+"/nix/store/zdh16dcvjw99ybam59zd2ijb6bx138j0-python3-3.7.5/lib/python3.7/distutils/version.py",
+line 40, in __init__
+    self.parse(vstring)
+File
+"/nix/store/zdh16dcvjw99ybam59zd2ijb6bx138j0-python3-3.7.5/lib/python3.7/distutils/version.py",
+line 137, in parse
+    raise ValueError("invalid version number '%s'" % vstring)
+ValueError: invalid version number '41.4.0.post20191022'
+```
+---
+ setup.py | 15 +--------------
+ 1 file changed, 1 insertion(+), 14 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 1f4838c90..831528d77 100644
+--- a/setup.py
++++ b/setup.py
+@@ -3,7 +3,6 @@ import os
+ import re
+ import sys
+ 
+-from distutils.version import StrictVersion
+ from setuptools import find_packages, setup, __version__ as setuptools_version
+ from setuptools.command.test import test as TestCommand
+ 
+@@ -56,20 +55,8 @@ install_requires = [
+ 
+ # Add pywin32 on Windows platforms to handle low-level system calls.
+ # This dependency needs to be added using environment markers to avoid its installation on Linux.
+-# However environment markers are supported only with setuptools >= 36.2.
+-# So this dependency is not added for old Linux distributions with old setuptools,
+-# in order to allow these systems to build certbot from sources.
+ pywin32_req = 'pywin32>=224'
+-if StrictVersion(setuptools_version) >= StrictVersion('36.2'):
+-    install_requires.append(pywin32_req + " ; sys_platform == 'win32'")
+-elif 'bdist_wheel' in sys.argv[1:]:
+-    raise RuntimeError('Error, you are trying to build certbot wheels using an old version '
+-                       'of setuptools. Version 36.2+ of setuptools is required.')
+-elif os.name == 'nt':
+-    # This branch exists to improve this package's behavior on Windows. Without
+-    # it, if the sdist is installed on Windows with an old version of
+-    # setuptools, pywin32 will not be specified as a dependency.
+-    install_requires.append(pywin32_req)
++install_requires.append(pywin32_req + " ; sys_platform == 'win32'")
+ 
+ dev_extras = [
+     'astroid==1.6.5',
+-- 
+2.23.0
+
diff --git a/pkgs/tools/admin/certbot/default.nix b/pkgs/tools/admin/certbot/default.nix
index 3448e3c8183..7d3d019e81f 100644
--- a/pkgs/tools/admin/certbot/default.nix
+++ b/pkgs/tools/admin/certbot/default.nix
@@ -14,6 +14,7 @@ python37Packages.buildPythonApplication rec {
 
   patches = [
     ./0001-pebble_artifacts-hardcode-pebble-location.patch
+    ./0001-Don-t-use-distutils.StrictVersion-that-cannot-handle.patch
   ];
 
   propagatedBuildInputs = with python37Packages; [