py-netcdf4: make sure we don't use system hdf5. (#16492)

This commit is contained in:
Sergey Kosukhin 2020-05-07 01:14:10 +02:00 committed by GitHub
parent b14befe61a
commit 2139c8e53e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View file

@ -0,0 +1,6 @@
--- a/setup.py
+++ b/setup.py
@@ -309,2 +309,3 @@ except OSError:
HAS_PKG_CONFIG = False
+HAS_PKG_CONFIG = False

View file

@ -25,6 +25,13 @@ class PyNetcdf4(PythonPackage):
depends_on('netcdf-c') depends_on('netcdf-c')
depends_on('hdf5@1.8.0:+hl') depends_on('hdf5@1.8.0:+hl')
# The installation script tries to find hdf5 using pkg-config. However, the
# version of hdf5 installed with Spack does not have pkg-config files.
# Therefore, if pkg-config finds hdf5.pc at all (e.g. provided by
# Ubuntu/Debian package manager), it is definitely not what we need. The
# following patch disables the usage of pkg-config at all.
patch('disable_pkgconf.patch')
def setup_build_environment(self, env): def setup_build_environment(self, env):
"""Ensure installed netcdf and hdf5 libraries are used""" """Ensure installed netcdf and hdf5 libraries are used"""
# Explicitly set these variables so setup.py won't erroneously pick up # Explicitly set these variables so setup.py won't erroneously pick up