From 2139c8e53ebde69095b643302291a35c4474515c Mon Sep 17 00:00:00 2001 From: Sergey Kosukhin Date: Thu, 7 May 2020 01:14:10 +0200 Subject: py-netcdf4: make sure we don't use system hdf5. (#16492) --- var/spack/repos/builtin/packages/py-netcdf4/disable_pkgconf.patch | 6 ++++++ var/spack/repos/builtin/packages/py-netcdf4/package.py | 7 +++++++ 2 files changed, 13 insertions(+) create mode 100644 var/spack/repos/builtin/packages/py-netcdf4/disable_pkgconf.patch 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 -- cgit v1.2.3-70-g09d2