diff options
author | Adam J. Stewart <ajstewart426@gmail.com> | 2022-08-10 00:20:07 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-10 09:20:07 +0200 |
commit | 03a91df81a7a7f4f8436d81025cfe74be9755e19 (patch) | |
tree | 388c008be068ca501902787c54bce0c57084a7a5 /var/spack/repos/builtin/packages/libjxl/package.py | |
parent | e7d8a7765b23a52cb12e5262ee8ba327bd9c3565 (diff) | |
download | spack-03a91df81a7a7f4f8436d81025cfe74be9755e19.tar.gz spack-03a91df81a7a7f4f8436d81025cfe74be9755e19.tar.bz2 spack-03a91df81a7a7f4f8436d81025cfe74be9755e19.tar.xz spack-03a91df81a7a7f4f8436d81025cfe74be9755e19.zip |
libjxl: add new package (#31983)
Diffstat (limited to 'var/spack/repos/builtin/packages/libjxl/package.py')
-rw-r--r-- | var/spack/repos/builtin/packages/libjxl/package.py | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/libjxl/package.py b/var/spack/repos/builtin/packages/libjxl/package.py new file mode 100644 index 0000000000..8468b216a9 --- /dev/null +++ b/var/spack/repos/builtin/packages/libjxl/package.py @@ -0,0 +1,41 @@ +# 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 Libjxl(CMakePackage): + """JPEG XL image format reference implementation.""" + + homepage = "https://github.com/libjxl/libjxl" + url = "https://github.com/libjxl/libjxl/archive/refs/tags/v0.6.1.tar.gz" + git = "https://github.com/libjxl/libjxl.git" + + version("main", branch="main", submodules=True) + version("0.6.1", tag="v0.6.1", submodules=True) + + depends_on("cmake@3.10:", type="build") + depends_on("brotli") + depends_on("highway") + + # Only needed at test time, but unfortunately "test" doesn't cause the dep to be added + # by Spack's compiler wrappers. Solution of adding "link" means that dependency is now + # always required... + depends_on("googletest+gmock", type=("link", "test")) + + # https://github.com/libjxl/libjxl/pull/582 + conflicts("%clang", when="@0.6") + conflicts("%apple-clang", when="@0.6") + + def cmake_args(self): + args = [ + self.define("JPEGXL_FORCE_SYSTEM_BROTLI", True), + self.define("JPEGXL_FORCE_SYSTEM_HWY", True), + ] + + if self.run_tests: + args.append(self.define("JPEGXL_FORCE_SYSTEM_GTEST", True)) + + return args |