diff --git a/Library/Formula/netcdf.rb b/Library/Formula/netcdf.rb index 01a53770007b..9847a2c13ca0 100644 --- a/Library/Formula/netcdf.rb +++ b/Library/Formula/netcdf.rb @@ -1,13 +1,5 @@ require 'formula' -def fortran? - ARGV.include? '--enable-fortran' -end - -def no_cxx? - ARGV.include? '--disable-cxx' -end - class NetcdfCXX < Formula homepage 'http://www.unidata.ucar.edu/software/netcdf' url 'http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-cxx4-4.2.tar.gz' @@ -22,20 +14,16 @@ class NetcdfFortran < Formula class Netcdf < Formula homepage 'http://www.unidata.ucar.edu/software/netcdf' - url 'http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-4.2.1.tar.gz' - sha1 'dfb6b10ef8dd20e785efa5e29b448383090f144d' + url 'http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-4.2.1.1.tar.gz' + sha1 '76631cb4e6b767c224338415cf6e5f5ff9bd1238' depends_on 'hdf5' - def options - [ - ['--enable-fortran', 'Compile Fortran bindings'], - ['--disable-cxx', "Don't compile C++ bindings"] - ] - end + option 'enable-fortran', 'Compile Fortran Bindings' + option 'disable-cxx', "Don't compile C++ bindings" def install - if fortran? + if build.include? 'enable-fortran' ENV.fortran # fix for ifort not accepting the --force-load argument, causing # the library libnetcdff.dylib to be missing all the f90 symbols. @@ -66,11 +54,11 @@ def install NetcdfCXX.new.brew do system './configure', *common_args system 'make install' - end unless no_cxx? + end unless build.include? 'disable-cxx' NetcdfFortran.new.brew do system './configure', *common_args system 'make install' - end if fortran? + end if build.include? 'enable-fortran' end end