diff --git a/var/spack/repos/builtin/packages/grads/package.py b/var/spack/repos/builtin/packages/grads/package.py index 70146e6720..e384e1a88a 100644 --- a/var/spack/repos/builtin/packages/grads/package.py +++ b/var/spack/repos/builtin/packages/grads/package.py @@ -63,10 +63,14 @@ def url_for_version(self, version): return url.format(version.up_to(2), version) # Name of grib2 C library has changed in recent versions - with when("+grib2"): + def patch(self): + if self.spec.satisfies("@:2.2.2"): + filter_file("png15", "png", "configure") - def patch(self): + if self.spec.satisfies("+grib2"): filter_file("grib2c", "g2c", "configure") + if self.spec.satisfies("^g2c@1.8.0:"): + filter_file("G2_VERSION", "G2C_VERSION", "src/gacfg.c") def setup_build_environment(self, env): env.set("SUPPLIBS", "/")