homebrew-core/Formula/netcdf.rb

37 lines
946 B
Ruby
Raw Normal View History

require 'formula'
def fortran?
ARGV.include? '--enable-fortran'
end
2011-03-10 05:11:03 +00:00
class Netcdf < Formula
url 'http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-4.1.3.tar.gz'
homepage 'http://www.unidata.ucar.edu/software/netcdf/'
md5 'ead16cb3b671f767396387dcb3c1a814'
depends_on 'hdf5'
2010-08-08 17:05:32 +00:00
def options
[['--enable-fortran', 'Compile Fortran bindings']]
2010-08-08 17:05:32 +00:00
end
def install
ENV.fortran if fortran?
ENV.append 'LDFLAGS', '-lsz' # So configure finds szip during HDF5 tests
2010-08-08 17:05:32 +00:00
# HDF5 is required to create and access files in the version 4 format
hdf5 = Formula.factory 'hdf5'
2010-08-08 17:05:32 +00:00
args = ["--disable-dependency-tracking",
"--prefix=#{prefix}",
"--with-hdf5=#{hdf5.prefix}",
"--enable-netcdf4",
"--enable-shared",
"--with-szlib=#{HOMEBREW_PREFIX}"]
args << "--disable-fortran" unless fortran?
2010-08-08 17:05:32 +00:00
system "./configure", *args
system "make install"
end
end