Subject: [PATCH 1/4] gnu: python-pillow: Update to 11.0.0.

From: Liliana Marie Prikler <[email-masked]>
Date: Thu, 5 Dec 2024 17:50:00 +0100

* gnu/packages/python-xyz.scm (python-pillow): Update to 11.0.0.
---
 gnu/packages/python-xyz.scm | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index cba99cce62..e77c5f6b65 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -10388,20 +10388,25 @@ (define-public python-pikepdf
 (define-public python-pillow
   (package
     (name "python-pillow")
-    (version "9.2.0")
+    (version "11.0.0")
     (source (origin
-              (method url-fetch)
-              (uri (pypi-uri "Pillow" version))
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/python-pillow/Pillow")
+                    (commit version)))
+              (file-name (git-file-name "python-pillow" version))
               (sha256
                (base32
-                "011wgm1mssjchpva9wsi2a07im9czyjvik137xlp5f0g7vykdrkm"))
-              (modules '((guix build utils)))
+                "0ya68a5ymxc581laidc3qlzjs9l327fyzw0mgcb9fz4r1p66lqxx"))
+              (modules '((guix build utils)
+                         (ice-9 ftw)))
               (snippet '(begin
-                          (delete-file-recursively "src/thirdparty")))
-              (patches
-               (search-patches "python-pillow-CVE-2022-45199.patch"
-                               ;; Included in 10.1.0.
-                               "python-pillow-use-zlib-1.3.patch"))))
+                          (let ((keep '("." ".." "pythoncapi_compat.h")))
+                            (with-directory-excursion "src/thirdparty"
+                              (for-each
+                               (lambda (f) (unless (member f keep)
+                                        (delete-file-recursively f)))
+                               (scandir "."))))))))
     (build-system python-build-system)
     (native-inputs (list python-pytest))
     (inputs (list freetype
-- 
2.46.0