ncview: bypass compiler check against netcdf-c compiler (#34580)

This commit is contained in:
Dom Heinzeller 2023-01-17 01:30:52 -07:00 committed by GitHub
parent 3161784e9a
commit dbd425f0f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,
)