diff options
author | Dom Heinzeller <dom.heinzeller@icloud.com> | 2024-07-02 01:19:04 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-02 01:19:04 -0600 |
commit | 6cab86d0c1124679f75db603f2e85571aa9faeee (patch) | |
tree | e70f4e19f33bc64781fcb4925eadfa0df275b2c5 | |
parent | 86e7e2e07093bf001e09218d165fadfe5f33b7b8 (diff) | |
download | spack-6cab86d0c1124679f75db603f2e85571aa9faeee.tar.gz spack-6cab86d0c1124679f75db603f2e85571aa9faeee.tar.bz2 spack-6cab86d0c1124679f75db603f2e85571aa9faeee.tar.xz spack-6cab86d0c1124679f75db603f2e85571aa9faeee.zip |
New package py-pyhdf (#44877)
* Add var/spack/repos/builtin/packages/py-pyhdf/package.py
* Address reviewer comments regarding dependencies for new package py-pyhdf
-rw-r--r-- | var/spack/repos/builtin/packages/py-pyhdf/package.py | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/py-pyhdf/package.py b/var/spack/repos/builtin/packages/py-pyhdf/package.py new file mode 100644 index 0000000000..7180798642 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-pyhdf/package.py @@ -0,0 +1,47 @@ +# 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 PyPyhdf(PythonPackage): + """pyhdf is a python wrapper around the NCSA HDF version 4 library. + The SD (Scientific Dataset), VS (Vdata) and V (Vgroup) APIs are + currently implemented. NetCDF files can also be read and modified.""" + + homepage = "https://github.com/fhs/pyhdf" + pypi = "pyhdf/pyhdf-0.10.4.tar.gz" + git = "https://github.com/fhs/pyhdf.git" + + maintainers("climbfuji") + + license("MIT") + + version("master", branch="master") + version("0.10.4", sha256="ea09b2bdafc9be0f7f43d72ff122d8efbde61881f4da3a659b33be5e29215f93") + + # Python versions + depends_on("py-setuptools", type="build") + + # Dependencies + depends_on("zlib-api", type=("build", "run")) + depends_on("hdf@4.2", type=("build", "run")) + depends_on("py-numpy", type=("build", "run")) + depends_on("jpeg", type=("build", "run")) + + def setup_build_environment(self, env): + inc_dirs = [] + lib_dirs = [] + # Strip -I and -L from spec include_flags / search_flags + inc_dirs.append(self.spec["zlib-api"].headers.include_flags.lstrip("-I")) + inc_dirs.append(self.spec["hdf"].headers.include_flags.lstrip("-I")) + inc_dirs.append(self.spec["jpeg"].headers.include_flags.lstrip("-I")) + lib_dirs.append(self.spec["zlib-api"].libs.search_flags.lstrip("-L")) + lib_dirs.append(self.spec["hdf"].libs.search_flags.lstrip("-L")) + lib_dirs.append(self.spec["jpeg"].libs.search_flags.lstrip("-L")) + env.set("INCLUDE_DIRS", ":".join(inc_dirs)) + env.set("LIBRARY_DIRS", ":".join(lib_dirs)) + if self.spec["hdf"].satisfies("@:4.1"): + env.set("NO_COMPRESS", "1") |