diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml index 444cf6c..e443e41 100755 --- a/.azure-pipelines/azure-pipelines-linux.yml +++ b/.azure-pipelines/azure-pipelines-linux.yml @@ -8,28 +8,16 @@ jobs: vmImage: ubuntu-latest strategy: matrix: - linux_64_channel_sourcesconda-forge: - CONFIG: linux_64_channel_sourcesconda-forge + linux_64_: + CONFIG: linux_64_ UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 - linux_64_channel_sourcesconda-forgeconda-forgelabelpython_rc: - CONFIG: linux_64_channel_sourcesconda-forgeconda-forgelabelpython_rc - UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 - linux_aarch64_channel_sourcesconda-forge: - CONFIG: linux_aarch64_channel_sourcesconda-forge - UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-aarch64:alma9 - linux_aarch64_channel_sourcesconda-forgeconda-forgelabelpython_rc: - CONFIG: linux_aarch64_channel_sourcesconda-forgeconda-forgelabelpython_rc + linux_aarch64_: + CONFIG: linux_aarch64_ UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-aarch64:alma9 - linux_ppc64le_channel_sourcesconda-forge: - CONFIG: linux_ppc64le_channel_sourcesconda-forge - UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-ppc64le:alma9 - linux_ppc64le_channel_sourcesconda-forgeconda-forgelabelpython_rc: - CONFIG: linux_ppc64le_channel_sourcesconda-forgeconda-forgelabelpython_rc + linux_ppc64le_: + CONFIG: linux_ppc64le_ UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-ppc64le:alma9 timeoutInMinutes: 360 diff --git a/.azure-pipelines/azure-pipelines-osx.yml b/.azure-pipelines/azure-pipelines-osx.yml index 282a6b9..d08eed2 100755 --- a/.azure-pipelines/azure-pipelines-osx.yml +++ b/.azure-pipelines/azure-pipelines-osx.yml @@ -8,17 +8,11 @@ jobs: vmImage: macOS-15 strategy: matrix: - osx_64_channel_sourcesconda-forge: - CONFIG: osx_64_channel_sourcesconda-forge + osx_64_: + CONFIG: osx_64_ UPLOAD_PACKAGES: 'True' - osx_64_channel_sourcesconda-forgeconda-forgelabelpython_rc: - CONFIG: osx_64_channel_sourcesconda-forgeconda-forgelabelpython_rc - UPLOAD_PACKAGES: 'True' - osx_arm64_channel_sourcesconda-forge: - CONFIG: osx_arm64_channel_sourcesconda-forge - UPLOAD_PACKAGES: 'True' - osx_arm64_channel_sourcesconda-forgeconda-forgelabelpython_rc: - CONFIG: osx_arm64_channel_sourcesconda-forgeconda-forgelabelpython_rc + osx_arm64_: + CONFIG: osx_arm64_ UPLOAD_PACKAGES: 'True' timeoutInMinutes: 360 variables: {} diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml index 5b42e69..ada9763 100755 --- a/.azure-pipelines/azure-pipelines-win.yml +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -8,11 +8,8 @@ jobs: vmImage: windows-2022 strategy: matrix: - win_64_channel_sourcesconda-forge: - CONFIG: win_64_channel_sourcesconda-forge - UPLOAD_PACKAGES: 'True' - win_64_channel_sourcesconda-forgeconda-forgelabelpython_rc: - CONFIG: win_64_channel_sourcesconda-forgeconda-forgelabelpython_rc + win_64_: + CONFIG: win_64_ UPLOAD_PACKAGES: 'True' timeoutInMinutes: 360 variables: diff --git a/.ci_support/linux_64_channel_sourcesconda-forge.yaml b/.ci_support/linux_64_.yaml similarity index 82% rename from .ci_support/linux_64_channel_sourcesconda-forge.yaml rename to .ci_support/linux_64_.yaml index a916694..57c06b6 100644 --- a/.ci_support/linux_64_channel_sourcesconda-forge.yaml +++ b/.ci_support/linux_64_.yaml @@ -6,14 +6,8 @@ c_stdlib: - sysroot c_stdlib_version: - '2.17' -cdt_name: -- conda channel_sources: - conda-forge -- conda-forge -- conda-forge -- conda-forge -- conda-forge channel_targets: - conda-forge main docker_image: @@ -42,12 +36,10 @@ python: - 3.12.* *_cpython - 3.13.* *_cp313 - 3.13.* *_cp313t +- 3.14.* *_cp314 target_platform: - linux-64 tk: - '8.6' -zip_keys: -- - python - - channel_sources zlib: - '1' diff --git a/.ci_support/linux_64_channel_sourcesconda-forgeconda-forgelabelpython_rc.yaml b/.ci_support/linux_64_channel_sourcesconda-forgeconda-forgelabelpython_rc.yaml deleted file mode 100644 index c2fb725..0000000 --- a/.ci_support/linux_64_channel_sourcesconda-forgeconda-forgelabelpython_rc.yaml +++ /dev/null @@ -1,45 +0,0 @@ -c_compiler: -- gcc -c_compiler_version: -- '14' -c_stdlib: -- sysroot -c_stdlib_version: -- '2.17' -cdt_name: -- conda -channel_sources: -- conda-forge,conda-forge/label/python_rc -channel_targets: -- conda-forge main -docker_image: -- quay.io/condaforge/linux-anvil-x86_64:alma9 -freetype: -- '2' -lcms2: -- '2' -libjpeg_turbo: -- '3' -libtiff: -- '4.7' -libwebp: -- '1' -libxcb: -- '1' -openjpeg: -- '2' -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- 3.14.* *_cp314 -target_platform: -- linux-64 -tk: -- '8.6' -zip_keys: -- - python - - channel_sources -zlib: -- '1' diff --git a/.ci_support/linux_aarch64_channel_sourcesconda-forge.yaml b/.ci_support/linux_aarch64_.yaml similarity index 82% rename from .ci_support/linux_aarch64_channel_sourcesconda-forge.yaml rename to .ci_support/linux_aarch64_.yaml index 923ab34..62dfeb8 100644 --- a/.ci_support/linux_aarch64_channel_sourcesconda-forge.yaml +++ b/.ci_support/linux_aarch64_.yaml @@ -6,14 +6,8 @@ c_stdlib: - sysroot c_stdlib_version: - '2.17' -cdt_name: -- conda channel_sources: - conda-forge -- conda-forge -- conda-forge -- conda-forge -- conda-forge channel_targets: - conda-forge main docker_image: @@ -42,12 +36,10 @@ python: - 3.12.* *_cpython - 3.13.* *_cp313 - 3.13.* *_cp313t +- 3.14.* *_cp314 target_platform: - linux-aarch64 tk: - '8.6' -zip_keys: -- - python - - channel_sources zlib: - '1' diff --git a/.ci_support/linux_aarch64_channel_sourcesconda-forgeconda-forgelabelpython_rc.yaml b/.ci_support/linux_aarch64_channel_sourcesconda-forgeconda-forgelabelpython_rc.yaml deleted file mode 100644 index f3e1c10..0000000 --- a/.ci_support/linux_aarch64_channel_sourcesconda-forgeconda-forgelabelpython_rc.yaml +++ /dev/null @@ -1,45 +0,0 @@ -c_compiler: -- gcc -c_compiler_version: -- '14' -c_stdlib: -- sysroot -c_stdlib_version: -- '2.17' -cdt_name: -- conda -channel_sources: -- conda-forge,conda-forge/label/python_rc -channel_targets: -- conda-forge main -docker_image: -- quay.io/condaforge/linux-anvil-aarch64:alma9 -freetype: -- '2' -lcms2: -- '2' -libjpeg_turbo: -- '3' -libtiff: -- '4.7' -libwebp: -- '1' -libxcb: -- '1' -openjpeg: -- '2' -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- 3.14.* *_cp314 -target_platform: -- linux-aarch64 -tk: -- '8.6' -zip_keys: -- - python - - channel_sources -zlib: -- '1' diff --git a/.ci_support/linux_ppc64le_channel_sourcesconda-forge.yaml b/.ci_support/linux_ppc64le_.yaml similarity index 82% rename from .ci_support/linux_ppc64le_channel_sourcesconda-forge.yaml rename to .ci_support/linux_ppc64le_.yaml index 59d55a1..6531323 100644 --- a/.ci_support/linux_ppc64le_channel_sourcesconda-forge.yaml +++ b/.ci_support/linux_ppc64le_.yaml @@ -6,14 +6,8 @@ c_stdlib: - sysroot c_stdlib_version: - '2.17' -cdt_name: -- conda channel_sources: - conda-forge -- conda-forge -- conda-forge -- conda-forge -- conda-forge channel_targets: - conda-forge main docker_image: @@ -42,10 +36,8 @@ python: - 3.12.* *_cpython - 3.13.* *_cp313 - 3.13.* *_cp313t +- 3.14.* *_cp314 target_platform: - linux-ppc64le -zip_keys: -- - python - - channel_sources zlib: - '1' diff --git a/.ci_support/linux_ppc64le_channel_sourcesconda-forgeconda-forgelabelpython_rc.yaml b/.ci_support/linux_ppc64le_channel_sourcesconda-forgeconda-forgelabelpython_rc.yaml deleted file mode 100644 index 178863f..0000000 --- a/.ci_support/linux_ppc64le_channel_sourcesconda-forgeconda-forgelabelpython_rc.yaml +++ /dev/null @@ -1,43 +0,0 @@ -c_compiler: -- gcc -c_compiler_version: -- '14' -c_stdlib: -- sysroot -c_stdlib_version: -- '2.17' -cdt_name: -- conda -channel_sources: -- conda-forge,conda-forge/label/python_rc -channel_targets: -- conda-forge main -docker_image: -- quay.io/condaforge/linux-anvil-ppc64le:alma9 -freetype: -- '2' -lcms2: -- '2' -libjpeg_turbo: -- '3' -libtiff: -- '4.7' -libwebp: -- '1' -libxcb: -- '1' -openjpeg: -- '2' -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- 3.14.* *_cp314 -target_platform: -- linux-ppc64le -zip_keys: -- - python - - channel_sources -zlib: -- '1' diff --git a/.ci_support/osx_64_channel_sourcesconda-forge.yaml b/.ci_support/osx_64_.yaml similarity index 86% rename from .ci_support/osx_64_channel_sourcesconda-forge.yaml rename to .ci_support/osx_64_.yaml index bca2f83..e0f06f1 100644 --- a/.ci_support/osx_64_channel_sourcesconda-forge.yaml +++ b/.ci_support/osx_64_.yaml @@ -12,10 +12,6 @@ c_stdlib_version: - '10.13' channel_sources: - conda-forge -- conda-forge -- conda-forge -- conda-forge -- conda-forge channel_targets: - conda-forge main freetype: @@ -44,12 +40,10 @@ python: - 3.12.* *_cpython - 3.13.* *_cp313 - 3.13.* *_cp313t +- 3.14.* *_cp314 target_platform: - osx-64 tk: - '8.6' -zip_keys: -- - python - - channel_sources zlib: - '1' diff --git a/.ci_support/osx_64_channel_sourcesconda-forgeconda-forgelabelpython_rc.yaml b/.ci_support/osx_64_channel_sourcesconda-forgeconda-forgelabelpython_rc.yaml deleted file mode 100644 index 3040fad..0000000 --- a/.ci_support/osx_64_channel_sourcesconda-forgeconda-forgelabelpython_rc.yaml +++ /dev/null @@ -1,47 +0,0 @@ -MACOSX_DEPLOYMENT_TARGET: -- '10.13' -MACOSX_SDK_VERSION: -- '10.13' -c_compiler: -- clang -c_compiler_version: -- '19' -c_stdlib: -- macosx_deployment_target -c_stdlib_version: -- '10.13' -channel_sources: -- conda-forge,conda-forge/label/python_rc -channel_targets: -- conda-forge main -freetype: -- '2' -lcms2: -- '2' -libjpeg_turbo: -- '3' -libtiff: -- '4.7' -libwebp: -- '1' -libxcb: -- '1' -macos_machine: -- x86_64-apple-darwin13.4.0 -openjpeg: -- '2' -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- 3.14.* *_cp314 -target_platform: -- osx-64 -tk: -- '8.6' -zip_keys: -- - python - - channel_sources -zlib: -- '1' diff --git a/.ci_support/osx_arm64_channel_sourcesconda-forge.yaml b/.ci_support/osx_arm64_.yaml similarity index 86% rename from .ci_support/osx_arm64_channel_sourcesconda-forge.yaml rename to .ci_support/osx_arm64_.yaml index ae61acf..dc46233 100644 --- a/.ci_support/osx_arm64_channel_sourcesconda-forge.yaml +++ b/.ci_support/osx_arm64_.yaml @@ -12,10 +12,6 @@ c_stdlib_version: - '11.0' channel_sources: - conda-forge -- conda-forge -- conda-forge -- conda-forge -- conda-forge channel_targets: - conda-forge main freetype: @@ -44,12 +40,10 @@ python: - 3.12.* *_cpython - 3.13.* *_cp313 - 3.13.* *_cp313t +- 3.14.* *_cp314 target_platform: - osx-arm64 tk: - '8.6' -zip_keys: -- - python - - channel_sources zlib: - '1' diff --git a/.ci_support/osx_arm64_channel_sourcesconda-forgeconda-forgelabelpython_rc.yaml b/.ci_support/osx_arm64_channel_sourcesconda-forgeconda-forgelabelpython_rc.yaml deleted file mode 100644 index f6e3b11..0000000 --- a/.ci_support/osx_arm64_channel_sourcesconda-forgeconda-forgelabelpython_rc.yaml +++ /dev/null @@ -1,47 +0,0 @@ -MACOSX_DEPLOYMENT_TARGET: -- '11.0' -MACOSX_SDK_VERSION: -- '11.0' -c_compiler: -- clang -c_compiler_version: -- '19' -c_stdlib: -- macosx_deployment_target -c_stdlib_version: -- '11.0' -channel_sources: -- conda-forge,conda-forge/label/python_rc -channel_targets: -- conda-forge main -freetype: -- '2' -lcms2: -- '2' -libjpeg_turbo: -- '3' -libtiff: -- '4.7' -libwebp: -- '1' -libxcb: -- '1' -macos_machine: -- arm64-apple-darwin20.0.0 -openjpeg: -- '2' -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- 3.14.* *_cp314 -target_platform: -- osx-arm64 -tk: -- '8.6' -zip_keys: -- - python - - channel_sources -zlib: -- '1' diff --git a/.ci_support/win_64_channel_sourcesconda-forge.yaml b/.ci_support/win_64_.yaml similarity index 81% rename from .ci_support/win_64_channel_sourcesconda-forge.yaml rename to .ci_support/win_64_.yaml index 408f17f..0143cd8 100644 --- a/.ci_support/win_64_channel_sourcesconda-forge.yaml +++ b/.ci_support/win_64_.yaml @@ -4,10 +4,6 @@ c_stdlib: - vs channel_sources: - conda-forge -- conda-forge -- conda-forge -- conda-forge -- conda-forge channel_targets: - conda-forge main freetype: @@ -34,12 +30,10 @@ python: - 3.12.* *_cpython - 3.13.* *_cp313 - 3.13.* *_cp313t +- 3.14.* *_cp314 target_platform: - win-64 tk: - '8.6' -zip_keys: -- - python - - channel_sources zlib: - '1' diff --git a/.ci_support/win_64_channel_sourcesconda-forgeconda-forgelabelpython_rc.yaml b/.ci_support/win_64_channel_sourcesconda-forgeconda-forgelabelpython_rc.yaml deleted file mode 100644 index 8454b55..0000000 --- a/.ci_support/win_64_channel_sourcesconda-forgeconda-forgelabelpython_rc.yaml +++ /dev/null @@ -1,37 +0,0 @@ -c_compiler: -- vs2022 -c_stdlib: -- vs -channel_sources: -- conda-forge,conda-forge/label/python_rc -channel_targets: -- conda-forge main -freetype: -- '2' -lcms2: -- '2' -libjpeg_turbo: -- '3' -libtiff: -- '4.7' -libwebp: -- '1' -libxcb: -- '1' -openjpeg: -- '2' -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- 3.14.* *_cp314 -target_platform: -- win-64 -tk: -- '8.6' -zip_keys: -- - python - - channel_sources -zlib: -- '1' diff --git a/README.md b/README.md index 18996c9..69d52e0 100644 --- a/README.md +++ b/README.md @@ -29,87 +29,45 @@ Current build status - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - @@ -197,12 +155,12 @@ it is possible to build and upload installable packages to the [conda-forge](https://anaconda.org/conda-forge) [anaconda.org](https://anaconda.org/) channel for Linux, Windows and OSX respectively. -To manage the continuous integration and simplify feedstock maintenance +To manage the continuous integration and simplify feedstock maintenance, [conda-smithy](https://github.com/conda-forge/conda-smithy) has been developed. Using the ``conda-forge.yml`` within this repository, it is possible to re-render all of this feedstock's supporting files (e.g. the CI configuration files) with ``conda smithy rerender``. -For more information please check the [conda-forge documentation](https://conda-forge.org/docs/). +For more information, please check the [conda-forge documentation](https://conda-forge.org/docs/). Terminology =========== @@ -229,7 +187,7 @@ merged, the recipe will be re-built and uploaded automatically to the everybody to install and use from the `conda-forge` channel. Note that all branches in the conda-forge/pillow-feedstock are immediately built and any created packages are uploaded, so PRs should be based -on branches in forks and branches in the main repository should only be used to +on branches in forks, and branches in the main repository should only be used to build distinct package versions. In order to produce a uniquely identifiable distribution: diff --git a/conda-forge.yml b/conda-forge.yml index 33702fc..bee592c 100644 --- a/conda-forge.yml +++ b/conda-forge.yml @@ -1,5 +1,7 @@ build_platform: osx_arm64: osx_64 + linux_aarch64: linux_64 + linux_ppc64le: linux_64 conda_build: pkg_format: '2' conda_forge_output_validation: true diff --git a/recipe/patches/0001-Build-without-USE_WIN32_FILEIO.patch b/recipe/patches/0001-Build-without-USE_WIN32_FILEIO.patch index 738bd9b..b8cf893 100644 --- a/recipe/patches/0001-Build-without-USE_WIN32_FILEIO.patch +++ b/recipe/patches/0001-Build-without-USE_WIN32_FILEIO.patch @@ -1,8 +1,19 @@ +From cb06bb5009d739a32fb5aa9909c8ce9adbf9f70c Mon Sep 17 00:00:00 2001 +From: Ryan May +Date: Wed, 5 May 2021 12:42:10 -0600 +Subject: [PATCH 1/3] Build without USE_WIN32_FILEIO + +This keeps things consistent with current conda-forge builds of tiff +(and poppler). +--- + setup.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + diff --git a/setup.py b/setup.py -index 477d187..3d48281 100644 +index 3a72a0742..f7bfc518a 100644 --- a/setup.py +++ b/setup.py -@@ -901,7 +901,7 @@ class pil_build_ext(build_ext): +@@ -911,7 +911,7 @@ class pil_build_ext(build_ext): # when compiling LibTIFF. LibTIFF doesn't expose it in `tiffconf.h`, # so we have to guess; by default it is defined in all Windows builds. # See #4237, #5243, #5359 for more information. diff --git a/recipe/patches/0001-Provide-a-clear-option-to-depend-on-zlib-ng.patch b/recipe/patches/0001-Provide-a-clear-option-to-depend-on-zlib-ng.patch new file mode 100644 index 0000000..5aacca2 --- /dev/null +++ b/recipe/patches/0001-Provide-a-clear-option-to-depend-on-zlib-ng.patch @@ -0,0 +1,282 @@ +From 8c3715bdba0941a1073e92d2193867b0093698f1 Mon Sep 17 00:00:00 2001 +From: Mark Harfouche +Date: Mon, 27 Oct 2025 16:49:17 -0400 +Subject: [PATCH] Provide a clear option to depend on zlib-ng + +--- + setup.py | 13 ++++++++++--- + src/_imaging.c | 6 ++++-- + src/libImaging/ZipCodecs.h | 10 +++++++++- + src/libImaging/ZipDecode.c | 24 ++++++++++++++++++++++++ + src/libImaging/ZipEncode.c | 36 ++++++++++++++++++++++++++++++++++++ + 5 files changed, 83 insertions(+), 6 deletions(-) + +diff --git a/setup.py b/setup.py +index 3a72a0742..726d33aab 100644 +--- a/setup.py ++++ b/setup.py +@@ -725,7 +725,12 @@ class pil_build_ext(build_ext): + + if feature.want("zlib"): + _dbg("Looking for zlib") +- if _find_include_file(self, "zlib.h"): ++ if _find_include_file(self, "zlib-ng.h"): ++ if _find_library_file(self, "z-ng"): ++ feature.set("zlib", "z-ng") ++ elif sys.platform == "win32" and _find_library_file(self, "zlib-ng"): ++ feature.set("zlib", "zlib-ng") ++ elif _find_include_file(self, "zlib.h"): + if _find_library_file(self, "z"): + feature.set("zlib", "z") + elif sys.platform == "win32" and _find_library_file(self, "zlib"): +@@ -923,9 +928,11 @@ class pil_build_ext(build_ext): + defs.append(("HAVE_OPENJPEG", None)) + if sys.platform == "win32" and not PLATFORM_MINGW: + defs.append(("OPJ_STATIC", None)) +- if feature.get("zlib"): +- libs.append(feature.get("zlib")) ++ if zlib := feature.get("zlib"): ++ libs.append(zlib) + defs.append(("HAVE_LIBZ", None)) ++ if zlib in ["z-ng", "zlib-ng"]: ++ defs.append(("HAVE_ZLIBNG", None)) + if feature.get("imagequant"): + libs.append(feature.get("imagequant")) + defs.append(("HAVE_LIBIMAGEQUANT", None)) +diff --git a/src/_imaging.c b/src/_imaging.c +index 41af72568..a38f31ad8 100644 +--- a/src/_imaging.c ++++ b/src/_imaging.c +@@ -85,8 +85,10 @@ + #endif + #endif + +-#ifdef HAVE_LIBZ +-#include "zlib.h" ++#ifdef HAVE_ZLIBNG ++#include ++#else ++#include + #endif + + #ifdef HAVE_LIBTIFF +diff --git a/src/libImaging/ZipCodecs.h b/src/libImaging/ZipCodecs.h +index 50218b6c6..95606501e 100644 +--- a/src/libImaging/ZipCodecs.h ++++ b/src/libImaging/ZipCodecs.h +@@ -7,7 +7,11 @@ + * Copyright (c) Fredrik Lundh 1996. + */ + +-#include "zlib.h" ++#ifdef HAVE_ZLIBNG ++#include ++#else ++#include ++#endif + + /* modes */ + #define ZIP_PNG 0 /* continuous, filtered image data */ +@@ -35,7 +39,11 @@ typedef struct { + + /* PRIVATE CONTEXT (set by decoder/encoder) */ + ++#ifdef HAVE_ZLIBNG ++ zng_stream z_stream; /* (de)compression stream */ ++#else + z_stream z_stream; /* (de)compression stream */ ++#endif + + UINT8 *previous; /* previous line (allocated) */ + +diff --git a/src/libImaging/ZipDecode.c b/src/libImaging/ZipDecode.c +index d964ff2ca..9b0161fbf 100644 +--- a/src/libImaging/ZipDecode.c ++++ b/src/libImaging/ZipDecode.c +@@ -80,7 +80,11 @@ ImagingZipDecode(Imaging im, ImagingCodecState state, UINT8 *buf, Py_ssize_t byt + context->z_stream.zfree = (free_func)NULL; + context->z_stream.opaque = (voidpf)NULL; + ++#ifdef HAVE_ZLIBNG ++ err = zng_inflateInit(&context->z_stream); ++#else + err = inflateInit(&context->z_stream); ++#endif + if (err < 0) { + state->errcode = IMAGING_CODEC_CONFIG; + free(context->previous); +@@ -112,7 +116,11 @@ ImagingZipDecode(Imaging im, ImagingCodecState state, UINT8 *buf, Py_ssize_t byt + context->z_stream.next_out = state->buffer + context->last_output; + context->z_stream.avail_out = row_len + context->prefix - context->last_output; + ++#ifdef HAVE_ZLIBNG ++ err = zng_inflate(&context->z_stream, Z_NO_FLUSH); ++#else + err = inflate(&context->z_stream, Z_NO_FLUSH); ++#endif + + if (err < 0) { + /* Something went wrong inside the compression library */ +@@ -125,7 +133,11 @@ ImagingZipDecode(Imaging im, ImagingCodecState state, UINT8 *buf, Py_ssize_t byt + } + free(context->previous); + context->previous = NULL; ++#ifdef HAVE_ZLIBNG ++ zng_inflateEnd(&context->z_stream); ++#else + inflateEnd(&context->z_stream); ++#endif + return -1; + } + +@@ -196,7 +208,11 @@ ImagingZipDecode(Imaging im, ImagingCodecState state, UINT8 *buf, Py_ssize_t byt + state->errcode = IMAGING_CODEC_UNKNOWN; + free(context->previous); + context->previous = NULL; ++#ifdef HAVE_ZLIBNG ++ zng_inflateEnd(&context->z_stream); ++#else + inflateEnd(&context->z_stream); ++#endif + return -1; + } + break; +@@ -270,7 +286,11 @@ ImagingZipDecode(Imaging im, ImagingCodecState state, UINT8 *buf, Py_ssize_t byt + + free(context->previous); + context->previous = NULL; ++#ifdef HAVE_ZLIBNG ++ zng_inflateEnd(&context->z_stream); ++#else + inflateEnd(&context->z_stream); ++#endif + return -1; /* end of file (errcode=0) */ + } + +@@ -292,7 +312,11 @@ ImagingZipDecodeCleanup(ImagingCodecState state) { + + /* Clean up */ + if (context->previous) { ++#ifdef HAVE_ZLIBNG ++ zng_inflateEnd(&context->z_stream); ++#else + inflateEnd(&context->z_stream); ++#endif + free(context->previous); + context->previous = NULL; + } +diff --git a/src/libImaging/ZipEncode.c b/src/libImaging/ZipEncode.c +index 44f2629cc..0242f7b87 100644 +--- a/src/libImaging/ZipEncode.c ++++ b/src/libImaging/ZipEncode.c +@@ -88,7 +88,11 @@ ImagingZipEncode(Imaging im, ImagingCodecState state, UINT8 *buf, int bytes) { + compress_type = context->compress_type; + } + ++#ifdef HAVE_ZLIBNG ++ err = zng_deflateInit2( ++#else + err = deflateInit2( ++#endif + &context->z_stream, + /* compression level */ + compress_level, +@@ -106,7 +110,11 @@ ImagingZipEncode(Imaging im, ImagingCodecState state, UINT8 *buf, int bytes) { + } + + if (context->dictionary && context->dictionary_size > 0) { ++#ifdef HAVE_ZLIBNG ++ err = zng_deflateSetDictionary( ++#else + err = deflateSetDictionary( ++#endif + &context->z_stream, + (unsigned char *)context->dictionary, + context->dictionary_size +@@ -126,7 +134,11 @@ ImagingZipEncode(Imaging im, ImagingCodecState state, UINT8 *buf, int bytes) { + context->z_stream.avail_out = bytes; + if (context->z_stream.next_in && context->z_stream.avail_in > 0) { + /* We have some data from previous round, deflate it first */ ++#ifdef HAVE_ZLIBNG ++ err = zng_deflate(&context->z_stream, Z_NO_FLUSH); ++#else + err = deflate(&context->z_stream, Z_NO_FLUSH); ++#endif + + if (err < 0) { + /* Something went wrong inside the compression library */ +@@ -142,7 +154,11 @@ ImagingZipEncode(Imaging im, ImagingCodecState state, UINT8 *buf, int bytes) { + free(context->up); + free(context->prior); + free(context->previous); ++#ifdef HAVE_ZLIBNG ++ zng_deflateEnd(&context->z_stream); ++#else + deflateEnd(&context->z_stream); ++#endif + return -1; + } + } +@@ -279,7 +295,11 @@ ImagingZipEncode(Imaging im, ImagingCodecState state, UINT8 *buf, int bytes) { + context->z_stream.next_in = context->output; + context->z_stream.avail_in = state->bytes + 1; + ++#ifdef HAVE_ZLIBNG ++ err = zng_deflate(&context->z_stream, Z_NO_FLUSH); ++#else + err = deflate(&context->z_stream, Z_NO_FLUSH); ++#endif + + if (err < 0) { + /* Something went wrong inside the compression library */ +@@ -295,7 +315,11 @@ ImagingZipEncode(Imaging im, ImagingCodecState state, UINT8 *buf, int bytes) { + free(context->up); + free(context->prior); + free(context->previous); ++#ifdef HAVE_ZLIBNG ++ zng_deflateEnd(&context->z_stream); ++#else + deflateEnd(&context->z_stream); ++#endif + ImagingSectionLeave(&cookie); + return -1; + } +@@ -315,7 +339,11 @@ ImagingZipEncode(Imaging im, ImagingCodecState state, UINT8 *buf, int bytes) { + /* End of image data; flush compressor buffers */ + + while (context->z_stream.avail_out > 0) { ++#ifdef HAVE_ZLIBNG ++ err = zng_deflate(&context->z_stream, Z_FINISH); ++#else + err = deflate(&context->z_stream, Z_FINISH); ++#endif + + if (err == Z_STREAM_END) { + free(context->paeth); +@@ -324,7 +352,11 @@ ImagingZipEncode(Imaging im, ImagingCodecState state, UINT8 *buf, int bytes) { + free(context->prior); + free(context->previous); + ++#ifdef HAVE_ZLIBNG ++ zng_deflateEnd(&context->z_stream); ++#else + deflateEnd(&context->z_stream); ++#endif + + state->errcode = IMAGING_CODEC_END; + +@@ -364,7 +396,11 @@ ImagingZipEncodeCleanup(ImagingCodecState state) { + + const char * + ImagingZipVersion(void) { ++#ifdef HAVE_ZLIBNG ++ return zlibng_version(); ++#else + return zlibVersion(); ++#endif + } + + #endif +-- +2.51.0 + diff --git a/recipe/patches/0002-Added-patch-to-fix-failing-Windows-test.patch b/recipe/patches/0002-Added-patch-to-fix-failing-Windows-test.patch index 4d2e65b..ef145cd 100644 --- a/recipe/patches/0002-Added-patch-to-fix-failing-Windows-test.patch +++ b/recipe/patches/0002-Added-patch-to-fix-failing-Windows-test.patch @@ -1,20 +1,20 @@ -From 44424164e42e8aede8ff76d85500fe9bee5d7e12 Mon Sep 17 00:00:00 2001 +From 17a5ec5a144ae824443ca56d2787c43e81513920 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 12 Jan 2022 11:35:32 +1100 -Subject: [PATCH 2/4] Added patch to fix failing Windows test +Subject: [PATCH 2/3] Added patch to fix failing Windows test --- src/PIL/TiffImagePlugin.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/PIL/TiffImagePlugin.py b/src/PIL/TiffImagePlugin.py -index 88af9162e..3b42bddad 100644 +index de2ce066e..7c8d1f5fc 100644 --- a/src/PIL/TiffImagePlugin.py +++ b/src/PIL/TiffImagePlugin.py -@@ -1341,6 +1341,10 @@ class TiffImageFile(ImageFile.ImageFile): - # To be nice on memory footprint, if there's a +@@ -1346,6 +1346,10 @@ class TiffImageFile(ImageFile.ImageFile): # file descriptor, use that instead of reading # into a string in python. + assert self.fp is not None + position = self.fp.tell() + self.fp.seek(0) + fp = io.BytesIO(self.fp.read()) diff --git a/recipe/patches/0003-add-XCB_ROOT.patch b/recipe/patches/0003-add-XCB_ROOT.patch index 839ad11..6d3e700 100644 --- a/recipe/patches/0003-add-XCB_ROOT.patch +++ b/recipe/patches/0003-add-XCB_ROOT.patch @@ -1,17 +1,17 @@ -From ec14714f2a0af7fbcbdda2dc0c408fe042041f49 Mon Sep 17 00:00:00 2001 +From 04e2e0ffed387c1c7f63e738f4af540344858025 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Wed, 5 Jan 2022 18:51:42 +1100 -Subject: [PATCH 3/4] add XCB_ROOT +Subject: [PATCH 3/3] add XCB_ROOT --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py -index 3fef7ae15..4b859bbd5 100644 +index f7bfc518a..851cccc58 100644 --- a/setup.py +++ b/setup.py -@@ -43,6 +43,7 @@ LCMS_ROOT = None +@@ -54,6 +54,7 @@ LCMS_ROOT = None RAQM_ROOT = None TIFF_ROOT = None WEBP_ROOT = None @@ -19,7 +19,7 @@ index 3fef7ae15..4b859bbd5 100644 ZLIB_ROOT = None FUZZING_BUILD = "LIB_FUZZING_ENGINE" in os.environ -@@ -495,6 +496,7 @@ class pil_build_ext(build_ext): +@@ -518,6 +519,7 @@ class pil_build_ext(build_ext): "RAQM_ROOT": "raqm", "WEBP_ROOT": "libwebp", "LCMS_ROOT": "lcms2", diff --git a/recipe/recipe.yaml b/recipe/recipe.yaml index 4a028d1..6fc705d 100644 --- a/recipe/recipe.yaml +++ b/recipe/recipe.yaml @@ -1,43 +1,45 @@ schema_version: 1 context: - version: "11.3.0" - + version: "12.0.0" recipe: name: pillow-split version: ${{ version }} source: url: https://github.com/python-pillow/Pillow/archive/refs/tags/${{ version }}.tar.gz - sha256: fa4aca745b1e1c733589ebf0ef19491b145dd4225c4aa06958963b4e7f0734cf + sha256: 9d24d8c1197610e63eee5e5cfa60025e4aaaba3f5c3c592e9a62cdf734f0bb13 patches: - patches/0001-Build-without-USE_WIN32_FILEIO.patch # fix provided by upstream maintainer for failing test - patches/0002-Added-patch-to-fix-failing-Windows-test.patch # windows needs help detecting webpmux & xcb - patches/0003-add-XCB_ROOT.patch + # zlib-ng without full conda-forge-wide deployment + - patches/0001-Provide-a-clear-option-to-depend-on-zlib-ng.patch build: - number: 3 + number: 0 outputs: - package: name: pillow build: - script: + script: - if: unix then: build_pillow.sh else: build_pillow.bat requirements: build: - if: build_platform != target_platform - then: python - - if: build_platform != target_platform - then: cross-python_${{ target_platform }} + then: + - python + - cross-python_${{ target_platform }} - ${{ compiler('c') }} - ${{ stdlib("c") }} host: - python + - pybind11 - pip - setuptools >=77 # libraries, c.f. https://github.com/python-pillow/Pillow/blob/9.0.0/setup.py#L30-L38 @@ -56,7 +58,7 @@ outputs: - libwebp - libxcb - tk - - zlib + - zlib-ng run: - python tests: @@ -95,7 +97,7 @@ outputs: - import sys, pytest - 'tests_to_skip = ["_not_a_real_test"]' - if: win - then: + then: # compile smoke test failing to link python3x.lib - 'tests_to_skip.append("test_embeddable")' # #165: hard fail with no feedback on windows
VariantStatus
linux_64_channel_sourcesconda-forgelinux_64 - variant + variant
linux_64_channel_sourcesconda-forgeconda-forgelabelpython_rclinux_aarch64 - variant + variant
linux_aarch64_channel_sourcesconda-forgelinux_ppc64le - variant + variant
linux_aarch64_channel_sourcesconda-forgeconda-forgelabelpython_rcosx_64 - variant + variant
linux_ppc64le_channel_sourcesconda-forgeosx_arm64 - variant + variant
linux_ppc64le_channel_sourcesconda-forgeconda-forgelabelpython_rcwin_64 - variant - -
osx_64_channel_sourcesconda-forge - - variant - -
osx_64_channel_sourcesconda-forgeconda-forgelabelpython_rc - - variant - -
osx_arm64_channel_sourcesconda-forge - - variant - -
osx_arm64_channel_sourcesconda-forgeconda-forgelabelpython_rc - - variant - -
win_64_channel_sourcesconda-forge - - variant - -
win_64_channel_sourcesconda-forgeconda-forgelabelpython_rc - - variant + variant