From 463c5eacca984a19badc6f54538cac9fb48e0496 Mon Sep 17 00:00:00 2001 From: Ondřej Čertík Date: Tue, 13 Sep 2022 14:13:57 -0600 Subject: Add libraqm package; enable in py-pillow (#32619) * Add libraqm package * py-pillow: Add optional raqm dependency/variant * Use sha256 * Use " instead of ' * Use more explicit import * Only add raqm from @8.4.0: * Make the docstring shorter to satisfy flake * Add conflict, silence warning, adjust version Co-authored-by: Adam J. Stewart --- var/spack/repos/builtin/packages/libraqm/package.py | 19 +++++++++++++++++++ var/spack/repos/builtin/packages/py-pillow/package.py | 7 ++++++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 var/spack/repos/builtin/packages/libraqm/package.py diff --git a/var/spack/repos/builtin/packages/libraqm/package.py b/var/spack/repos/builtin/packages/libraqm/package.py new file mode 100644 index 0000000000..e15f98a0bc --- /dev/null +++ b/var/spack/repos/builtin/packages/libraqm/package.py @@ -0,0 +1,19 @@ +# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class Libraqm(MesonPackage): + """Raqm provides a convenient API for the logic of complex text layout.""" + + homepage = "https://github.com/HOST-Oman/libraqm" + url = "https://github.com/HOST-Oman/libraqm/releases/download/v0.9.0/raqm-0.9.0.tar.xz" + git = "https://github.com/HOST-Oman/libraqm.git" + + version("0.9.0", sha256="9ed6fdf41da6391fc9bf7038662cbe412c330aa6eb22b19704af2258e448107c") + + depends_on("freetype") + depends_on("harfbuzz") diff --git a/var/spack/repos/builtin/packages/py-pillow/package.py b/var/spack/repos/builtin/packages/py-pillow/package.py index f5e1f26f19..8f3488fce3 100644 --- a/var/spack/repos/builtin/packages/py-pillow/package.py +++ b/var/spack/repos/builtin/packages/py-pillow/package.py @@ -25,6 +25,7 @@ class PyPillowBase(PythonPackage): 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/latest/installation.html#notes @@ -52,6 +53,10 @@ class PyPillowBase(PythonPackage): 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") def patch(self): """Patch setup.py to provide library and include directories @@ -70,7 +75,7 @@ class PyPillowBase(PythonPackage): def variant_to_cfg(variant): able = "enable" if "+" + variant in self.spec else "disable" - return "{0}-{1}=1\n".format(able, variant) + return "{0}_{1}=1\n".format(able, variant) with open("setup.cfg", "a") as setup: setup.write("[build_ext]\n") -- cgit v1.2.3-70-g09d2