From 193386f6ac20c44a41b063aa966e3513bc448463 Mon Sep 17 00:00:00 2001 From: "John W. Parent" <45471568+johnwparent@users.noreply.github.com> Date: Mon, 18 Mar 2024 09:40:32 -0400 Subject: [PATCH] netcdfc: consider static build in pkgconf filtering (#43084) --- var/spack/repos/builtin/packages/netcdf-c/package.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/var/spack/repos/builtin/packages/netcdf-c/package.py b/var/spack/repos/builtin/packages/netcdf-c/package.py index 82d7d6792c..8753edb6e3 100644 --- a/var/spack/repos/builtin/packages/netcdf-c/package.py +++ b/var/spack/repos/builtin/packages/netcdf-c/package.py @@ -367,9 +367,9 @@ def patch_hdf5_pkgconfigcmake(self): settingsconfig_file = find(self.prefix, "libnetcdf.settings", recursive=True) files = pkgconfig_file + cmakeconfig_file + ncconfig_file + settingsconfig_file - - filter_file("hdf5-shared", "hdf5", *files, ignore_absent=True) - filter_file("hdf5_hl-shared", "hdf5_hl", *files, ignore_absent=True) + config = "shared" if self.spec.satisfies("+shared") else "static" + filter_file(f"hdf5-{config}", "hdf5", *files, ignore_absent=True) + filter_file(f"hdf5_hl-{config}", "hdf5_hl", *files, ignore_absent=True) class AutotoolsBuilder(BaseBuilder, autotools.AutotoolsBuilder):