2012-04-16 16:53:42 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Cdo < Formula
|
|
|
|
homepage 'https://code.zmaw.de/projects/cdo'
|
2012-08-06 22:09:37 +00:00
|
|
|
url 'https://code.zmaw.de/attachments/download/3605/cdo-1.5.6.1.tar.gz'
|
|
|
|
sha1 '180517a3c234a47e5e19ae15084bb2fe2bda2d06'
|
2012-04-16 16:53:42 +00:00
|
|
|
|
2012-08-23 11:07:11 +00:00
|
|
|
option 'enable-grib2', 'Compile Fortran bindings'
|
2012-08-23 04:36:27 +00:00
|
|
|
|
2012-04-16 16:53:42 +00:00
|
|
|
depends_on 'netcdf'
|
|
|
|
depends_on 'hdf5'
|
2012-08-23 04:36:27 +00:00
|
|
|
depends_on 'grib-api' => :optional if build.include? 'enable-grib2'
|
2012-04-16 16:53:42 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
args = ["--disable-debug", "--disable-dependency-tracking",
|
|
|
|
"--prefix=#{prefix}",
|
|
|
|
"--with-netcdf=#{HOMEBREW_PREFIX}",
|
|
|
|
"--with-hdf5=#{HOMEBREW_PREFIX}",
|
|
|
|
"--with-szlib=#{HOMEBREW_PREFIX}"]
|
|
|
|
|
2012-08-23 04:36:27 +00:00
|
|
|
if build.include? 'enable-grib2'
|
2012-04-16 16:53:42 +00:00
|
|
|
args << "--with-grib_api=#{HOMEBREW_PREFIX}"
|
|
|
|
args << "--with-jasper=#{HOMEBREW_PREFIX}"
|
|
|
|
end
|
|
|
|
|
|
|
|
system "./configure", *args
|
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
|
|
|
|
def test
|
2012-05-15 21:36:45 +00:00
|
|
|
system "#{bin}/cdo", "-h"
|
2012-04-16 16:53:42 +00:00
|
|
|
end
|
|
|
|
end
|