summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2024-10-16 18:35:30 +0200
committerGitHub <noreply@github.com>2024-10-16 10:35:30 -0600
commit49489a48151f37b285766be52197820093732f33 (patch)
tree28ff833f23b6a8011481909e568e4c9691ca4746
parentfb53d31d09e2d8229ae529f0561207da2bd68bf3 (diff)
downloadspack-49489a48151f37b285766be52197820093732f33.tar.gz
spack-49489a48151f37b285766be52197820093732f33.tar.bz2
spack-49489a48151f37b285766be52197820093732f33.tar.xz
spack-49489a48151f37b285766be52197820093732f33.zip
py-pillow: add v11.0.0 (#47010)
-rw-r--r--var/spack/repos/builtin/packages/py-pillow/package.py77
1 files changed, 54 insertions, 23 deletions
diff --git a/var/spack/repos/builtin/packages/py-pillow/package.py b/var/spack/repos/builtin/packages/py-pillow/package.py
index 7eff0630db..1e0e537420 100644
--- a/var/spack/repos/builtin/packages/py-pillow/package.py
+++ b/var/spack/repos/builtin/packages/py-pillow/package.py
@@ -9,17 +9,18 @@ from spack.package import *
class PyPillowBase(PythonPackage):
"""Base class for Pillow and its fork Pillow-SIMD."""
- maintainers("adamjstewart")
license("HPND")
+ maintainers("adamjstewart")
provides("pil")
# These defaults correspond to Pillow defaults
# https://pillow.readthedocs.io/en/stable/installation/building-from-source.html
- VARIANTS_IN_SETUP_CFG = (
+ VARIANTS = (
"zlib",
"jpeg",
"tiff",
"freetype",
+ "raqm",
"lcms",
"webp",
"webpmux",
@@ -31,18 +32,19 @@ class PyPillowBase(PythonPackage):
variant("jpeg", default=True, description="JPEG functionality")
variant("tiff", default=False, description="Compressed TIFF functionality")
variant("freetype", default=False, description="Type related services")
+ variant("raqm", when="@8.2:+freetype", default=False, description="RAQM support")
variant("lcms", default=False, description="Color management")
variant("webp", default=False, description="WebP format")
- variant("webpmux", when="+webp", default=False, description="WebP metadata")
+ variant("webpmux", when="@:10+webp", default=False, description="WebP metadata")
variant("jpeg2000", default=False, description="JPEG 2000 functionality")
variant("imagequant", when="@3.3:", default=False, description="Improved color quantization")
variant("xcb", when="@7.1:", default=False, description="X11 screengrab support")
- variant("raqm", when="@8.2:", default=False, description="RAQM support")
# Required dependencies
# https://pillow.readthedocs.io/en/stable/installation/python-support.html
with default_args(type=("build", "link", "run")):
- depends_on("python@3.8:3.13", when="@10.4:")
+ depends_on("python@3.9:3.13", when="@11:")
+ depends_on("python@3.8:3.13", when="@10.4")
depends_on("python@3.8:3.12", when="@10.1:10.3")
depends_on("python@3.8:3.11", when="@10.0")
depends_on("python@3.7:3.11", when="@9.3:9.5")
@@ -54,6 +56,7 @@ class PyPillowBase(PythonPackage):
# pyproject.toml
with default_args(type="build"):
+ depends_on("py-pip@22.1:", when="@10:")
depends_on("py-setuptools@67.8:", when="@10:")
depends_on("py-setuptools")
@@ -63,21 +66,28 @@ class PyPillowBase(PythonPackage):
depends_on("jpeg", when="+jpeg")
depends_on("libtiff", when="+tiff")
depends_on("freetype", when="+freetype")
+ depends_on("libraqm", when="+raqm")
depends_on("lcms@2:", when="+lcms")
depends_on("libwebp", when="+webp")
depends_on("libwebp+libwebpmux+libwebpdemux", when="+webpmux")
depends_on("openjpeg", when="+jpeg2000")
depends_on("libimagequant", when="+imagequant")
depends_on("libxcb", when="+xcb")
- depends_on("libraqm", when="+raqm")
- # Conflicting options
- conflicts("+raqm", when="~freetype")
+ @when("@10:")
+ def config_settings(self, spec, prefix):
+ settings = {"parallel": make_jobs}
- def patch(self):
- """Patch setup.py to provide library and include directories
- for dependencies."""
+ for variant in self.VARIANTS:
+ if spec.satisfies(f"+{variant}"):
+ settings[variant] = "enable"
+ elif spec.satisfies(f"~{variant}"):
+ settings[variant] = "disable"
+ return settings
+
+ def patch(self):
+ """Patch setup.py to provide library and include directories for dependencies."""
library_dirs = []
include_dirs = []
for dep in self.spec.dependencies(deptype="link"):
@@ -86,21 +96,40 @@ class PyPillowBase(PythonPackage):
include_dirs.extend(query.headers.directories)
setup = FileFilter("setup.py")
- setup.filter("library_dirs = []", "library_dirs = {0}".format(library_dirs), string=True)
- setup.filter("include_dirs = []", "include_dirs = {0}".format(include_dirs), string=True)
+ if self.version >= Version("11"):
+ setup.filter(
+ "library_dirs: list[str] = []",
+ "library_dirs = {0}".format(library_dirs),
+ string=True,
+ )
+ setup.filter(
+ "include_dirs: list[str] = []",
+ "include_dirs = {0}".format(include_dirs),
+ string=True,
+ )
+ else:
+ setup.filter(
+ "library_dirs = []", "library_dirs = {0}".format(library_dirs), string=True
+ )
+ setup.filter(
+ "include_dirs = []", "include_dirs = {0}".format(include_dirs), string=True
+ )
+
+ if self.spec.satisfies("@:9"):
- def variant_to_cfg(variant):
- able = "enable" if "+" + variant in self.spec else "disable"
- return "{0}_{1}=1\n".format(able, variant)
+ def variant_to_cfg(variant):
+ able = "enable" if "+" + variant in self.spec else "disable"
+ return "{0}_{1}=1\n".format(able, variant)
- with open("setup.cfg", "a") as setup:
- setup.write("[build_ext]\n")
- for variant in self.VARIANTS_IN_SETUP_CFG:
- setup.write(variant_to_cfg(variant))
+ with open("setup.cfg", "a") as setup:
+ setup.write("[build_ext]\n")
+ for variant in self.VARIANTS:
+ setup.write(variant_to_cfg(variant))
- setup.write("rpath={0}\n".format(":".join(self.rpath)))
- setup.write("[install]\n")
+ setup.write("rpath={0}\n".format(":".join(self.rpath)))
+ setup.write("[install]\n")
+ @when("@:9")
def setup_build_environment(self, env):
env.set("MAX_CONCURRENCY", make_jobs)
@@ -114,6 +143,7 @@ class PyPillow(PyPillowBase):
homepage = "https://python-pillow.org/"
pypi = "pillow/pillow-10.2.0.tar.gz"
+ version("11.0.0", sha256="72bacbaf24ac003fea9bff9837d1eedb6088758d41e100c1552930151f677739")
version("10.4.0", sha256="166c1cd4d24309b30d61f79f4a9114b7b2313d7450912277855ff5dfd7cd4a06")
version("10.3.0", sha256="9d2455fbf44c914840c793e89aa82d0e1763a14253a000743719ae5946814b2d")
version("10.2.0", sha256="e87f0b2c78157e12d7686b27d63c070fd65d994e8ddae6f328e0dcf4a0cd007e")
@@ -135,9 +165,10 @@ class PyPillow(PyPillowBase):
version("6.2.2", sha256="db9ff0c251ed066d367f53b64827cc9e18ccea001b986d08c265e53625dab950")
version("6.2.1", sha256="bf4e972a88f8841d8fdc6db1a75e0f8d763e66e3754b03006cbc3854d89f1cb1")
- depends_on("c", type="build") # generated
+ depends_on("c", type="build")
for ver in [
+ "11.0.0",
"10.4.0",
"10.3.0",
"10.2.0",