python3Packages.click: fix 'locale' path

importing click shells out to 'locale', which currently needs to be in
PATH. Fix by setting patching locale command at runtime.

+18 -1
+7 -1
pkgs/development/python-modules/click/default.nix
··· 1 - { stdenv, buildPythonPackage, fetchPypi, pytest }: 2 3 buildPythonPackage rec { 4 pname = "click"; ··· 8 inherit pname version; 9 sha256 = "02qkfpykbq35id8glfgwc38yc430427yd05z1wc5cnld8zgicmgi"; 10 }; 11 12 buildInputs = [ pytest ]; 13
··· 1 + { stdenv, buildPythonPackage, fetchPypi, substituteAll, glibc, pytest }: 2 3 buildPythonPackage rec { 4 pname = "click"; ··· 8 inherit pname version; 9 sha256 = "02qkfpykbq35id8glfgwc38yc430427yd05z1wc5cnld8zgicmgi"; 10 }; 11 + 12 + patches = stdenv.lib.optionals (stdenv.isLinux && !stdenv.hostPlatform.isMusl) 13 + (substituteAll { 14 + src = ./fix-paths.patch; 15 + locale = "${glibc.bin}/bin/locale"; 16 + }); 17 18 buildInputs = [ pytest ]; 19
+11
pkgs/development/python-modules/click/fix-paths.patch
···
··· 1 + --- a/click/_unicodefun.py 2018-06-11 15:08:59.369358278 +0200 2 + +++ b/click/_unicodefun.py 2018-06-11 15:09:09.342325998 +0200 3 + @@ -60,7 +60,7 @@ 4 + extra = '' 5 + if os.name == 'posix': 6 + import subprocess 7 + - rv = subprocess.Popen(['locale', '-a'], stdout=subprocess.PIPE, 8 + + rv = subprocess.Popen(['@locale@', '-a'], stdout=subprocess.PIPE, 9 + stderr=subprocess.PIPE).communicate()[0] 10 + good_locales = set() 11 + has_c_utf8 = False