python.pkgs.click: make patch version-agnostic

This commit is contained in:
Robert Schütz 2019-03-21 11:43:26 +01:00
parent 19aaebe419
commit 0b87a56015
3 changed files with 7 additions and 20 deletions

View File

@ -13,7 +13,7 @@ let
inherit version;
sha256 = "678c98275431fad324275dec63791e4a17558b40e5a110e20a82866139a85a5a";
};
patches = [];
postPatch = "";
});
platformio = self.callPackage ./core.nix { };

View File

@ -1,4 +1,4 @@
{ stdenv, buildPythonPackage, fetchPypi, substituteAll, locale, pytest }:
{ lib, buildPythonPackage, fetchPypi, substituteAll, locale, pytest }:
buildPythonPackage rec {
pname = "click";
@ -10,10 +10,10 @@ buildPythonPackage rec {
sha256 = "5b94b49521f6456670fdb30cd82a4eca9412788a93fa6dd6df72c94d5a8ff2d7";
};
patches = stdenv.lib.optional (stdenv.lib.versionAtLeast version "6.7") (substituteAll {
src = ./fix-paths.patch;
locale = "${locale}/bin/locale";
});
postPatch = ''
substituteInPlace click/_unicodefun.py \
--replace "'locale'" "'${locale}/bin/locale'"
'';
buildInputs = [ pytest ];
@ -24,7 +24,7 @@ buildPythonPackage rec {
# https://github.com/pallets/click/issues/823
doCheck = false;
meta = with stdenv.lib; {
meta = with lib; {
homepage = http://click.pocoo.org/;
description = "Create beautiful command line interfaces in Python";
longDescription = ''

View File

@ -1,13 +0,0 @@
diff --git a/click/_unicodefun.py b/click/_unicodefun.py
index 620edff..85a3c98 100644
--- a/click/_unicodefun.py
+++ b/click/_unicodefun.py
@@ -63,7 +63,7 @@ def _verify_python3_env():
if os.name == 'posix':
import subprocess
try:
- rv = subprocess.Popen(['locale', '-a'], stdout=subprocess.PIPE,
+ rv = subprocess.Popen(['@locale@', '-a'], stdout=subprocess.PIPE,
stderr=subprocess.PIPE).communicate()[0]
except OSError:
rv = b''