Skip to content

Commit

Permalink
netcdf: Update to 4.2.1.1
Browse files Browse the repository at this point in the history
Also, use the new options DSL.
  • Loading branch information
Sharpie committed Aug 18, 2012
1 parent ca24ee0 commit c02f6da
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions 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'
Expand All @@ -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.
Expand Down Expand Up @@ -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

0 comments on commit c02f6da

Please sign in to comment.