diff --git a/pkgs/development/python-modules/pillow/0001-Revert-Handle-more-than-one-directory-returned-by-pk.patch b/pkgs/development/python-modules/pillow/0001-Revert-Handle-more-than-one-directory-returned-by-pk.patch new file mode 100644 index 000000000000000..9947a476efdf767 --- /dev/null +++ b/pkgs/development/python-modules/pillow/0001-Revert-Handle-more-than-one-directory-returned-by-pk.patch @@ -0,0 +1,60 @@ +From d71eade071704c3f10709b49335eba886f2ac5b2 Mon Sep 17 00:00:00 2001 +From: roblabla +Date: Thu, 27 Apr 2023 11:40:58 +0200 +Subject: [PATCH] Revert "Handle more than one directory returned by + pkg-config." + +This reverts commit 04cf5e2cfc5dc1676efd9f5c8d605ddfccb0f9ee. +--- + setup.py | 26 ++++++++++++-------------- + 1 file changed, 12 insertions(+), 14 deletions(-) + +diff --git a/setup.py b/setup.py +index 07d6c66d6..348ad1482 100755 +--- a/setup.py ++++ b/setup.py +@@ -265,16 +265,18 @@ def _pkg_config(name): + if not DEBUG: + command_libs.append("--silence-errors") + command_cflags.append("--silence-errors") +- libs = re.split( +- r"(^|\s+)-L", ++ libs = ( + subprocess.check_output(command_libs, stderr=stderr) + .decode("utf8") +- .strip(), +- )[::2][1:] +- cflags = re.split( +- r"(^|\s+)-I", +- subprocess.check_output(command_cflags).decode("utf8").strip(), +- )[::2][1:] ++ .strip() ++ .replace("-L", "") ++ ) ++ cflags = ( ++ subprocess.check_output(command_cflags) ++ .decode("utf8") ++ .strip() ++ .replace("-I", "") ++ ) + return libs, cflags + except Exception: + pass +@@ -472,12 +474,8 @@ class pil_build_ext(build_ext): + else: + lib_root = include_root = root + +- if lib_root is not None: +- for lib_dir in lib_root: +- _add_directory(library_dirs, lib_dir) +- if include_root is not None: +- for include_dir in include_root: +- _add_directory(include_dirs, include_dir) ++ _add_directory(library_dirs, lib_root) ++ _add_directory(include_dirs, include_root) + + # respect CFLAGS/CPPFLAGS/LDFLAGS + for k in ("CFLAGS", "CPPFLAGS", "LDFLAGS"): +-- +2.37.1 (Apple Git-137.1) + diff --git a/pkgs/development/python-modules/pillow/default.nix b/pkgs/development/python-modules/pillow/default.nix index 6dc894c0a4ca5b3..a6f48850acec2b9 100644 --- a/pkgs/development/python-modules/pillow/default.nix +++ b/pkgs/development/python-modules/pillow/default.nix @@ -12,7 +12,7 @@ import ./generic.nix (rec { pname = "pillow"; - version = "9.4.0"; + version = "9.5.0"; format = "setuptools"; disabled = pythonOlder "3.7"; @@ -20,9 +20,13 @@ import ./generic.nix (rec { src = fetchPypi { pname = "Pillow"; inherit version; - hash = "sha256-ocLXeARI65P7zDeJvzkWqlcg2ULjeUX0BWaAMX8c0j4="; + hash = "sha256-v1SEedM2cm16Ds6252fhefveN4M65CeUYCYxoHDWMPE="; }; + # Reverts 04cf5e2cfc5dc1676efd9f5c8d605ddfccb0f9ee, which prevents pillow from + # finding zlib. + patches = [ ./0001-Revert-Handle-more-than-one-directory-returned-by-pk.patch ]; + passthru.tests = { inherit imageio matplotlib pilkit pydicom reportlab; };