diff options
author | Beat Reichenbach <44111292+beatreichenbach@users.noreply.github.com> | 2024-10-27 04:37:49 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-27 09:37:49 +0100 |
commit | 12a475e648a01177ed7495e1410b2c0cb11ad7de (patch) | |
tree | c19fef38dc8cd98e0f04000d6cf54f7f5923dca4 | |
parent | c348891c07a3d6cdd4cd2b828086527bcc6f1e81 (diff) | |
download | spack-12a475e648a01177ed7495e1410b2c0cb11ad7de.tar.gz spack-12a475e648a01177ed7495e1410b2c0cb11ad7de.tar.bz2 spack-12a475e648a01177ed7495e1410b2c0cb11ad7de.tar.xz spack-12a475e648a01177ed7495e1410b2c0cb11ad7de.zip |
feat: Add OpenColorIO option to OpenImageIO (#47237)
* feat: Add OpenColorIO option to OpenImageIO
* style: Pep 8
---------
Co-authored-by: Beat Reichenbach <beatreichenbach@users.noreply.github.com>
-rw-r--r-- | var/spack/repos/builtin/packages/opencolorio/package.py | 39 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/openimageio/package.py | 3 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/pystring/package.py | 21 |
3 files changed, 63 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/opencolorio/package.py b/var/spack/repos/builtin/packages/opencolorio/package.py new file mode 100644 index 0000000000..bed7b22eb3 --- /dev/null +++ b/var/spack/repos/builtin/packages/opencolorio/package.py @@ -0,0 +1,39 @@ +# Copyright 2013-2024 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 Opencolorio(CMakePackage): + """OpenColorIO (OCIO) is a complete color management solution geared towards motion + picture production with an emphasis on visual effects and computer animation.""" + + homepage = "https://opencolorio.readthedocs.io" + git = "https://github.com/AcademySoftwareFoundation/OpenColorIO" + url = ( + "https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/refs/tags/v2.4.0.tar.gz" + ) + license("Apache-2.0") + + version("2.4.0", sha256="0ff3966b9214da0941b2b1cbdab3975a00a51fc6f3417fa860f98f5358f2c282") + + # Core dependencies + depends_on("cmake@3.14:", type="build") + depends_on("expat@2.2.8:") + depends_on("yaml-cpp@0.6.3:") + depends_on("imath@3.0.5:") + depends_on("pystring@1.1.3:") + + # Optional dependencies + variant("lcms", default=False, description="Little CMS for ociobakelut") + depends_on("lcms@2.2:", when="+lcms") + + variant("python", default=False, description="Build python bindings") + extends("python", when="+python") + depends_on("py-pybind11", when="+python", type=("build", "run")) + + def cmake_args(self): + args = ["-DOCIO_BUILD_PYTHON={0}".format("ON" if "+python" in self.spec else "OFF")] + return args diff --git a/var/spack/repos/builtin/packages/openimageio/package.py b/var/spack/repos/builtin/packages/openimageio/package.py index 4f03b0df35..fe48959156 100644 --- a/var/spack/repos/builtin/packages/openimageio/package.py +++ b/var/spack/repos/builtin/packages/openimageio/package.py @@ -42,6 +42,9 @@ class Openimageio(CMakePackage): variant("qt", default=False, description="Build qt viewer") depends_on("qt@5.6.0:+opengl", when="+qt") + variant("ocio", default=False, description="Support video frames") + depends_on("opencolorio@2.2:", when="+ocio") + def url_for_version(self, version): if version >= Version("2"): return super().url_for_version(version) diff --git a/var/spack/repos/builtin/packages/pystring/package.py b/var/spack/repos/builtin/packages/pystring/package.py new file mode 100644 index 0000000000..9d69f87adb --- /dev/null +++ b/var/spack/repos/builtin/packages/pystring/package.py @@ -0,0 +1,21 @@ +# Copyright 2013-2024 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 Pystring(CMakePackage): + """Pystring is a collection of C++ functions which match the interface and behavior + of python's string class methods using std::string.""" + + git = "https://github.com/imageworks/pystring" + url = "https://github.com/imageworks/pystring/archive/refs/tags/v1.1.4.tar.gz" + + license("Apache-2.0") + + version("1.1.4", sha256="49da0fe2a049340d3c45cce530df63a2278af936003642330287b68cefd788fb") + + # Core dependencies + depends_on("cmake@3.27.9:", type="build") |