From b998bf47f7cf898d91b02dc91fab874ebb7b7b4a Mon Sep 17 00:00:00 2001 From: Ansh Dadwal Date: Sun, 14 Sep 2025 18:17:08 +0530 Subject: [PATCH] `pillow`: update to `11.3.0` --- pythonforandroid/recipes/Pillow/__init__.py | 5 +- .../recipes/Pillow/setup.py.patch | 64 ++++++------------- 2 files changed, 22 insertions(+), 47 deletions(-) diff --git a/pythonforandroid/recipes/Pillow/__init__.py b/pythonforandroid/recipes/Pillow/__init__.py index ffac810a2b..447803263f 100644 --- a/pythonforandroid/recipes/Pillow/__init__.py +++ b/pythonforandroid/recipes/Pillow/__init__.py @@ -23,11 +23,12 @@ class PillowRecipe(PyProjectRecipe): - libwebp: library to encode and decode images in WebP format. """ - version = '10.3.0' + version = '11.3.0' url = 'https://github.com/python-pillow/Pillow/archive/{version}.tar.gz' site_packages_name = 'PIL' patches = ["setup.py.patch"] - depends = ['png', 'jpeg', 'freetype', 'setuptools'] + depends = ['png', 'jpeg', 'freetype'] + hostpython_prerequisites = ["setuptools>=77"] opt_depends = ['libwebp'] def get_recipe_env(self, arch, **kwargs): diff --git a/pythonforandroid/recipes/Pillow/setup.py.patch b/pythonforandroid/recipes/Pillow/setup.py.patch index 2970e23670..aae9d1eb17 100644 --- a/pythonforandroid/recipes/Pillow/setup.py.patch +++ b/pythonforandroid/recipes/Pillow/setup.py.patch @@ -1,76 +1,50 @@ ---- Pillow/setup.py 2024-05-24 19:35:08.270160608 +0530 -+++ Pillow.mod/setup.py 2024-05-24 22:07:52.741495666 +0530 -@@ -39,6 +39,7 @@ - LCMS_ROOT = None - TIFF_ROOT = None - ZLIB_ROOT = None -+WEBP_ROOT = None - FUZZING_BUILD = "LIB_FUZZING_ENGINE" in os.environ +diff '--color=auto' -uNr Pillow-11.3.0/setup.py Pillow-11.3.0.mod/setup.py +--- Pillow-11.3.0/setup.py 2025-07-01 13:11:24.000000000 +0530 ++++ Pillow-11.3.0.mod/setup.py 2025-09-17 01:50:35.498105827 +0530 +@@ -156,6 +156,7 @@ - if sys.platform == "win32" and sys.version_info >= (3, 13): -@@ -150,6 +151,7 @@ - - def _find_library_dirs_ldconfig(): + def _find_library_dirs_ldconfig() -> list[str]: + return [] # Based on ctypes.util from Python 2 ldconfig = "ldconfig" if shutil.which("ldconfig") else "/sbin/ldconfig" -@@ -460,15 +462,16 @@ - "HARFBUZZ_ROOT": "harfbuzz", - "FRIBIDI_ROOT": "fribidi", - "LCMS_ROOT": "lcms2", -+ "WEBP_ROOT": "libwebp", - "IMAGEQUANT_ROOT": "libimagequant", - }.items(): - root = globals()[root_name] +@@ -514,12 +515,10 @@ if root is None and root_name in os.environ: -- prefix = os.environ[root_name] -- root = (os.path.join(prefix, "lib"), os.path.join(prefix, "include")) + root_prefix = os.environ[root_name] +- root = ( +- os.path.join(root_prefix, "lib"), +- os.path.join(root_prefix, "include"), +- ) + root = tuple(os.environ[root_name].split(":")) if root is None and pkg_config: + continue - if isinstance(lib_name, tuple): - for lib_name2 in lib_name: - _dbg(f"Looking for `{lib_name2}` using pkg-config.") -@@ -495,14 +498,6 @@ - for include_dir in include_root: - _add_directory(include_dirs, include_dir) - -- # respect CFLAGS/CPPFLAGS/LDFLAGS -- for k in ("CFLAGS", "CPPFLAGS", "LDFLAGS"): -- if k in os.environ: -- for match in re.finditer(r"-I([^\s]+)", os.environ[k]): -- _add_directory(include_dirs, match.group(1)) -- for match in re.finditer(r"-L([^\s]+)", os.environ[k]): -- _add_directory(library_dirs, match.group(1)) -- - # include, rpath, if set as environment variables: - for k in ("C_INCLUDE_PATH", "CPATH", "INCLUDE"): - if k in os.environ: -@@ -514,13 +509,10 @@ + if isinstance(lib_name, str): + _dbg("Looking for `%s` using pkg-config.", lib_name) + root = pkg_config(lib_name) +@@ -565,13 +564,11 @@ for d in os.environ[k].split(os.path.pathsep): _add_directory(library_dirs, d) - _add_directory(library_dirs, os.path.join(sys.prefix, "lib")) - _add_directory(include_dirs, os.path.join(sys.prefix, "include")) -- + # # add platform directories - if self.disable_platform_guessing: -+ if True: ++ if True: # self.disable_platform_guessing: pass elif sys.platform == "cygwin": -@@ -614,7 +606,7 @@ +@@ -674,7 +671,7 @@ # FIXME: check /opt/stuff directories here? # standard locations - if not self.disable_platform_guessing: -+ if False: #not self.disable_platform_guessing: ++ if False: # not self.disable_platform_guessing: _add_directory(library_dirs, "/usr/local/lib") _add_directory(include_dirs, "/usr/local/include")