summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndřej Čertík <ondrej@certik.us>2022-09-13 14:13:57 -0600
committerGitHub <noreply@github.com>2022-09-13 14:13:57 -0600
commit463c5eacca984a19badc6f54538cac9fb48e0496 (patch)
tree8e28ab1a9fae0785553ab1e865314df2b9e27359
parent83d6aff03a4dd20679b46612ade26251374fe1a2 (diff)
downloadspack-463c5eacca984a19badc6f54538cac9fb48e0496.tar.gz
spack-463c5eacca984a19badc6f54538cac9fb48e0496.tar.bz2
spack-463c5eacca984a19badc6f54538cac9fb48e0496.tar.xz
spack-463c5eacca984a19badc6f54538cac9fb48e0496.zip
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 <ajstewart426@gmail.com>
-rw-r--r--var/spack/repos/builtin/packages/libraqm/package.py19
-rw-r--r--var/spack/repos/builtin/packages/py-pillow/package.py7
2 files changed, 25 insertions, 1 deletions
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")