netcdf: Fix build if curl is not installed (#11387)

For 4.7.0, configure fails if curl is not installed.
This commit is contained in:
Michael Kuhn 2019-05-09 19:23:49 +02:00 committed by Chuck Atkins
parent 4e0c909d0a
commit ebc32319f6

View file

@ -50,6 +50,10 @@ def url_for_version(self, version):
version('4.3.3.1', sha256='bdde3d8b0e48eed2948ead65f82c5cfb7590313bc32c4cf6c6546e4cea47ba19')
version('4.3.3', sha256='83223ed74423c685a10f6c3cfa15c2d6bf7dc84b46af1e95b9fa862016aaa27e')
# configure fails if curl is not installed.
# See https://github.com/Unidata/netcdf-c/issues/1390
patch('https://github.com/Unidata/netcdf-c/commit/e5315da1e748dc541d50796fb05233da65e86b6b.patch', sha256='10a1c3f7fa05e2c82457482e272bbe04d66d0047b237ad0a73e87d63d848b16c', when='@4.7.0')
variant('mpi', default=True,
description='Enable parallel I/O for netcdf-4')
variant('parallel-netcdf', default=False,
@ -82,6 +86,11 @@ def url_for_version(self, version):
values=is_integral
)
# The patch for 4.7.0 touches configure.ac. See force_autoreconf below.
depends_on('autoconf', type='build', when='@4.7.0')
depends_on('automake', type='build', when='@4.7.0')
depends_on('libtool', type='build', when='@4.7.0')
depends_on("m4", type='build')
depends_on("hdf", when='+hdf4')
@ -137,6 +146,11 @@ def url_for_version(self, version):
conflicts('+parallel-netcdf', when='@:4.0')
conflicts('+hdf4', when='@:4.0')
@property
def force_autoreconf(self):
# The patch for 4.7.0 touches configure.ac.
return self.spec.satisfies('@4.7.0')
def patch(self):
try:
max_dims = int(self.spec.variants['maxdims'].value)