]> git.99rst.org Git - openwrt-packages.git/commitdiff
pillow: drop the pybind11 build dependency
authorAlexandru Ardelean <redacted>
Tue, 11 Aug 2026 06:22:14 +0000 (09:22 +0300)
committerAlexandru Ardelean <redacted>
Tue, 11 Aug 2026 08:16:03 +0000 (11:16 +0300)
Pillow uses pybind11 only for pybind11.setup_helpers.ParallelCompile,
which parallelises the C extension build; it ships no runtime bindings.
Patch setup.py to remove that import and call and drop pybind11 from
build-system.requires, then remove python-pybind11/host from
PKG_BUILD_DEPENDS. The C extensions are compiled serially instead, with
no functional change to the package.

Signed-off-by: Alexandru Ardelean <redacted>
lang/python/pillow/Makefile
lang/python/pillow/patches/010-drop-pybind11-parallelcompile.patch [new file with mode: 0644]

index 20e9763d2c0b3bc8940f9e0c95f6b6b16a8798a4..ad86947233d3e354501421a75f23f45db06f1da1 100644 (file)
@@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=pillow
 PKG_VERSION:=12.2.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PYPI_NAME:=Pillow
 PYPI_SOURCE_NAME:=pillow
 PKG_HASH:=a830b1a40919539d07806aa58e1b114df53ddd43213d9c8b75847eee6c0182b5
 
-PKG_BUILD_DEPENDS:=python-setuptools/host python-pybind11/host
+PKG_BUILD_DEPENDS:=python-setuptools/host
 
 PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
 PKG_LICENSE:=HPND
diff --git a/lang/python/pillow/patches/010-drop-pybind11-parallelcompile.patch b/lang/python/pillow/patches/010-drop-pybind11-parallelcompile.patch
new file mode 100644 (file)
index 0000000..8595394
--- /dev/null
@@ -0,0 +1,46 @@
+From 3fabaeec684fae934055b85c2f91c1bd700c71b0 Mon Sep 17 00:00:00 2001
+From: Alexandru Ardelean <alex@shruggie.ro>
+Date: Tue, 11 Aug 2026 10:30:00 +0300
+Subject: [PATCH] setup.py: drop the pybind11 build dependency
+
+pybind11 is only used for pybind11.setup_helpers.ParallelCompile, a
+build-time helper that parallelises the C extension compilation. Pillow
+ships no pybind11 bindings, so remove the import, the ParallelCompile
+call and the pybind11 build-system requirement; the C extensions are
+then compiled serially.
+
+Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
+---
+ pyproject.toml | 1 -
+ setup.py       | 3 ---
+ 2 files changed, 4 deletions(-)
+
+--- a/pyproject.toml
++++ b/pyproject.toml
+@@ -1,7 +1,6 @@
+ [build-system]
+ build-backend = "backend"
+ requires = [
+-  "pybind11",
+   "setuptools>=77",
+ ]
+ backend-path = [
+--- a/setup.py
++++ b/setup.py
+@@ -17,7 +17,6 @@ import sys
+ import warnings
+ from collections.abc import Iterator
+-from pybind11.setup_helpers import ParallelCompile
+ from setuptools import Extension, setup
+ from setuptools.command.build_ext import build_ext
+@@ -32,8 +31,6 @@ while sys.argv[-1].startswith("--pillow-
+     _, key, value = sys.argv.pop().split("=", 2)
+     configuration.setdefault(key, []).append(value)
+-default = int(configuration.get("parallel", ["0"])[-1])
+-ParallelCompile("MAX_CONCURRENCY", default).install()
+ def get_version() -> str:
git clone https://git.99rst.org/PROJECT