guix_mirror_bot pushed a commit to branch python-team
in repository guix.

commit 53ac5eaadcffe60c1969882491a768a854834c3b
Author: Hugo Buddelmeijer <[email protected]>
AuthorDate: Fri Oct 23 22:27:54 2026 +0200

    gnu: python-manim: Fix build with Pillow 13.
    
    * gnu/packages/patches/manim-pillow-13.patch: New file.
    * gnu/local.mk (dist_patch_DATA): Register patch.
    * gnu/packages/python-graphics.scm (python-manim): Fix build with Pillow 13.
    [origin]<patches>: Use patch.
    
    Relates-to: guix/guix!12052
    Signed-off-by: Sharlatan Hellseher <[email protected]>
---
 gnu/local.mk                               |  1 +
 gnu/packages/patches/manim-pillow-13.patch | 31 ++++++++++++++++++++++++++++++
 gnu/packages/python-graphics.scm           |  1 +
 3 files changed, 33 insertions(+)

diff --git a/gnu/local.mk b/gnu/local.mk
index 5502e61bbe0..c53c68c9a3c 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1918,6 +1918,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/mate-common-honor-aclocal.patch         \
   %D%/packages/patches/mactelnet-remove-init.patch             \
   %D%/packages/patches/mailutils-variable-lookup.patch         \
+  %D%/packages/patches/manim-pillow-13.patch   \
   %D%/packages/patches/mandoc-support-zstd-compression.patch   \
   %D%/packages/patches/mantid-openmp-cleanup.patch             \
   %D%/packages/patches/make-impure-dirs.patch                  \
diff --git a/gnu/packages/patches/manim-pillow-13.patch 
b/gnu/packages/patches/manim-pillow-13.patch
new file mode 100644
index 00000000000..79599ee6cc2
--- /dev/null
+++ b/gnu/packages/patches/manim-pillow-13.patch
@@ -0,0 +1,31 @@
+From 25fa4150c6a907822c776c5f41cfcbf765038d10 Mon Sep 17 00:00:00 2001
+From: Benjamin Hackl <[email protected]>
+Date: Tue, 20 Oct 2026 11:08:07 +0200
+Subject: Fix Cairo image rendering with Pillow 13
+
+Create the transparent compositing canvas directly as an RGBA image instead of 
reinterpreting a two-dimensional float64 array. Pillow 13 rejects the 
mismatched array mode.
+
+---
+ manim/camera/camera.py        |  7 ++--
+ tests/test_pillow13_compat.py | 61 +++++++++++++++++++++++++++++++++++
+ 2 files changed, 65 insertions(+), 3 deletions(-)
+ create mode 100644 tests/test_pillow13_compat.py
+
+diff --git a/manim/camera/camera.py b/manim/camera/camera.py
+index b3371faf3e..6dfc08117b 100644
+--- a/manim/camera/camera.py
++++ b/manim/camera/camera.py
+@@ -1125,9 +1125,10 @@ def display_image_mobject(
+         )
+ 
+         # Paste into an image as large as the camera's pixel array.
+-        full_image = Image.fromarray(
+-            np.zeros((self.pixel_height, self.pixel_width)),
+-            mode="RGBA",
++        full_image = Image.new(
++            "RGBA",
++            (self.pixel_width, self.pixel_height),
++            (0, 0, 0, 0),
+         )
+         full_image.paste(
+             sub_image,
diff --git a/gnu/packages/python-graphics.scm b/gnu/packages/python-graphics.scm
index f851520ee2c..4dac21f0349 100644
--- a/gnu/packages/python-graphics.scm
+++ b/gnu/packages/python-graphics.scm
@@ -406,6 +406,7 @@ Design spec without sacrificing ease of use or application 
performance.")
               (url "https://github.com/ManimCommunity/manim";)
               (commit (string-append "v" version))))
        (file-name (git-file-name name version))
+       (patches (search-patches "manim-pillow-13.patch"))
        (sha256
         (base32 "1ifgcsz9dhb7qyqsi60q840wqcqfmqxf19r8qlncakziyqlfmwxd"))))
     (build-system pyproject-build-system)

Reply via email to