summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/py-netcdf4/disable_pkgconf.patch6
-rw-r--r--var/spack/repos/builtin/packages/py-netcdf4/package.py7
2 files changed, 13 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/py-netcdf4/disable_pkgconf.patch b/var/spack/repos/builtin/packages/py-netcdf4/disable_pkgconf.patch
new file mode 100644
index 0000000000..b2b690c7c3
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-netcdf4/disable_pkgconf.patch
@@ -0,0 +1,6 @@
+--- a/setup.py
++++ b/setup.py
+@@ -309,2 +309,3 @@ except OSError:
+ HAS_PKG_CONFIG = False
++HAS_PKG_CONFIG = False
+
diff --git a/var/spack/repos/builtin/packages/py-netcdf4/package.py b/var/spack/repos/builtin/packages/py-netcdf4/package.py
index a9dd01db2c..5516bc751e 100644
--- a/var/spack/repos/builtin/packages/py-netcdf4/package.py
+++ b/var/spack/repos/builtin/packages/py-netcdf4/package.py
@@ -25,6 +25,13 @@ class PyNetcdf4(PythonPackage):
depends_on('netcdf-c')
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):
"""Ensure installed netcdf and hdf5 libraries are used"""
# Explicitly set these variables so setup.py won't erroneously pick up