From dbd425f0f83d4dcda8dd0e7c843ad15ba8ce261f Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Tue, 17 Jan 2023 01:30:52 -0700 Subject: [PATCH] ncview: bypass compiler check against netcdf-c compiler (#34580) --- .../repos/builtin/packages/ncview/package.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/var/spack/repos/builtin/packages/ncview/package.py b/var/spack/repos/builtin/packages/ncview/package.py index b396868c8d..9d2b39fbc3 100644 --- a/var/spack/repos/builtin/packages/ncview/package.py +++ b/var/spack/repos/builtin/packages/ncview/package.py @@ -20,12 +20,13 @@ class Ncview(AutotoolsPackage): depends_on("libpng") depends_on("libxaw") - def configure_args(self): - spec = self.spec - - config_args = [] - - if spec.satisfies("^netcdf-c+mpi"): - config_args.append("CC={0}".format(spec["mpi"].mpicc)) - - return config_args + def patch(self): + # Disable the netcdf-c compiler check, save and restore the + # modification timestamp of the file to prevent autoreconf. + patched_file = "configure" + with keep_modification_time(patched_file): + filter_file( + "if test x\$CC_TEST_SAME != x\$NETCDF_CC_TEST_SAME; then", # noqa: W605 + "if false; then", + patched_file, + )