diff --git a/10.3.0.tar.gz b/Pillow-11.1.0.tar.gz similarity index 80% rename from 10.3.0.tar.gz rename to Pillow-11.1.0.tar.gz index a36d6103fc6dd005af41cbb17edf3566b84a69aa..b1c05699a09eb31f540516ab8b468b77125a7545 100644 Binary files a/10.3.0.tar.gz and b/Pillow-11.1.0.tar.gz differ diff --git a/pillow_mingw.patch b/pillow_mingw.patch new file mode 100644 index 0000000000000000000000000000000000000000..f54f6ab3c4f33cd3221ce68a7ccb3e233e5acaff --- /dev/null +++ b/pillow_mingw.patch @@ -0,0 +1,78 @@ +diff -rupN --no-dereference Pillow-11.1.0/setup.py Pillow-11.1.0-new/setup.py +--- Pillow-11.1.0/setup.py 2025-01-02 06:00:59.000000000 +0100 ++++ Pillow-11.1.0-new/setup.py 2025-01-03 09:39:04.046148203 +0100 +@@ -142,7 +142,7 @@ class RequiredDependencyException(Except + pass + + +-PLATFORM_MINGW = os.name == "nt" and "GCC" in sys.version ++PLATFORM_MINGW = "mingw32" in os.getenv("CC", "") + + + def _dbg(s: str, tp: Any = None) -> None: +@@ -553,7 +553,7 @@ class pil_build_ext(build_ext): + # + # add platform directories + +- if self.disable_platform_guessing: ++ if self.disable_platform_guessing or PLATFORM_MINGW: + pass + + elif sys.platform == "cygwin": +@@ -648,7 +648,7 @@ class pil_build_ext(build_ext): + # FIXME: check /opt/stuff directories here? + + # standard locations +- if not self.disable_platform_guessing: ++ if not self.disable_platform_guessing and not PLATFORM_MINGW: + _add_directory(library_dirs, "/usr/local/lib") + _add_directory(include_dirs, "/usr/local/include") + +@@ -883,7 +883,7 @@ class pil_build_ext(build_ext): + if feature.get("xcb"): + libs.append(feature.get("xcb")) + defs.append(("HAVE_XCB", None)) +- if sys.platform == "win32": ++ if sys.platform == "win32" or PLATFORM_MINGW: + libs.extend(["kernel32", "user32", "gdi32"]) + if struct.unpack("h", b"\0\1")[0] == 1: + defs.append(("WORDS_BIGENDIAN", None)) +@@ -898,6 +898,8 @@ class pil_build_ext(build_ext): + if feature.get("freetype"): + srcs = [] + libs = ["freetype"] ++ if sys.platform == "win32" or PLATFORM_MINGW: ++ libs.extend(["dl"]) + defs = [] + if feature.get("raqm"): + if not feature.want_vendor("raqm"): # using system Raqm +@@ -920,7 +922,7 @@ class pil_build_ext(build_ext): + + if feature.get("lcms"): + libs = [feature.get("lcms")] +- if sys.platform == "win32": ++ if sys.platform == "win32" or PLATFORM_MINGW: + libs.extend(["user32", "gdi32"]) + self._update_extension("PIL._imagingcms", libs) + else: +@@ -933,7 +935,7 @@ class pil_build_ext(build_ext): + else: + self._remove_extension("PIL._webp") + +- tk_libs = ["psapi"] if sys.platform in ("win32", "cygwin") else [] ++ tk_libs = ["psapi"] if sys.platform in ("win32", "cygwin") or PLATFORM_MINGW else [] + self._update_extension("PIL._imagingtk", tk_libs) + + build_ext.build_extensions(self) +diff -rupN --no-dereference Pillow-11.1.0/src/libImaging/ImPlatform.h Pillow-11.1.0-new/src/libImaging/ImPlatform.h +--- Pillow-11.1.0/src/libImaging/ImPlatform.h 2025-01-02 06:00:59.000000000 +0100 ++++ Pillow-11.1.0-new/src/libImaging/ImPlatform.h 2025-01-03 09:39:04.047148183 +0100 +@@ -29,7 +29,7 @@ + #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ + + #define WIN32_LEAN_AND_MEAN +-#include ++#include + + #ifdef __CYGWIN__ + #undef _WIN64 diff --git a/python-pillow.spec b/python-pillow.spec index 87e6b3bbed5521fc089388928642ce456e973b95..a3d1f9db382eab3e4986d2cc0a1ff74e9643f52c 100644 --- a/python-pillow.spec +++ b/python-pillow.spec @@ -1,4 +1,4 @@ -%define anolis_release 1 +%define anolis_release 1 %global py3_incdir %(RPM_BUILD_ROOT= %{python3} -Ic 'import sysconfig; print(sysconfig.get_path("include"))') %global py3_libbuilddir lib.%{python3_platform}-%{python3_version} @@ -7,14 +7,15 @@ %bcond_with doc Name: python-%{srcname} -Version: 10.3.0 +Version: 11.1.0 Release: %{anolis_release}%{dist} Summary: Python image processing library # License: see http://www.pythonware.com/products/pil/license.htm License: MIT URL: http://python-pillow.github.io/ -Source0: https://github.com/python-pillow/Pillow/archive/refs/tags/%{version}.tar.gz +Source0: https://github.com/python-pillow/Pillow/archive/11.1.0/Pillow-11.1.0.tar.gz +Patch1: pillow_mingw.patch BuildRequires: freetype-devel BuildRequires: gcc @@ -44,6 +45,34 @@ BuildRequires: python3-sphinx_rtd_theme BuildRequires: python3-sphinx-removed-in %endif BuildRequires: python3-tkinter +BuildRequires: mingw32-dlfcn +BuildRequires: mingw32-filesystem >= 95 +BuildRequires: mingw32-freetype +BuildRequires: mingw32-gcc +BuildRequires: mingw32-lcms2 +BuildRequires: mingw32-libimagequant +BuildRequires: mingw32-libjpeg +BuildRequires: mingw32-libtiff +BuildRequires: mingw32-libwebp +BuildRequires: mingw32-openjpeg2 +BuildRequires: mingw32-python3 +BuildRequires: mingw32-python3-setuptools +BuildRequires: mingw32-tk +BuildRequires: mingw32-zlib +BuildRequires: mingw64-dlfcn +BuildRequires: mingw64-filesystem >= 95 +BuildRequires: mingw64-freetype +BuildRequires: mingw64-gcc +BuildRequires: mingw64-lcms2 +BuildRequires: mingw64-libimagequant +BuildRequires: mingw64-libjpeg +BuildRequires: mingw64-libtiff +BuildRequires: mingw64-libwebp +BuildRequires: mingw64-openjpeg2 +BuildRequires: mingw64-python3 +BuildRequires: mingw64-python3-setuptools +BuildRequires: mingw64-tk +BuildRequires: mingw64-zlib # For EpsImagePlugin.py Requires: ghostscript @@ -187,6 +216,10 @@ popd %endif %changelog +* Wed Sep 17 2025 wenyuzifang - 11.1.0-1 +- Updated to version 11.1.0 to fix xxxxxx +- Improve MinGW build reliability by correctly detecting the compiler and linking required libraries + * Fri May 17 2024 mgb01105731 - 10.3.0-1 - update to 10.3.0