aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorLuiz Irber2012-04-16 13:53:42 -0300
committerAdam Vandenberg2012-04-17 20:58:26 -0700
commit561d0ac02fc5400c4027679d1399d4b138ff8a4e (patch)
tree765951ed8d3280437a1eeed564e344cc77d934cd /Library
parent4938c1f41a1e05379816f4cad91bf51c70cabfd0 (diff)
downloadhomebrew-561d0ac02fc5400c4027679d1399d4b138ff8a4e.tar.bz2
CDO 1.5.4
Added new formula for CDO (Climate Data Operators). Based on Portfile available at http://trac.macports.org/browser/trunk/dports/science/cdo/Portfile, but without Proj support (CDO depends on a private header that Proj version currently in Homebrew doesn't install). Closes #11685. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/cdo.rb41
1 files changed, 41 insertions, 0 deletions
diff --git a/Library/Formula/cdo.rb b/Library/Formula/cdo.rb
new file mode 100644
index 000000000..02c108d65
--- /dev/null
+++ b/Library/Formula/cdo.rb
@@ -0,0 +1,41 @@
+require 'formula'
+
+def grib2?
+ ARGV.include? '--enable-grib2'
+end
+
+class Cdo < Formula
+ homepage 'https://code.zmaw.de/projects/cdo'
+ url 'https://code.zmaw.de/attachments/download/2372'
+ version '1.5.4'
+ md5 'ceacb1acfa921a5bf1a3e4cda1097405'
+
+ depends_on 'szlib'
+ depends_on 'netcdf'
+ depends_on 'hdf5'
+ depends_on 'grib-api' if grib2?
+
+ def options
+ [['--enable-grib2', 'Compile Fortran bindings']]
+ end
+
+ def install
+ args = ["--disable-debug", "--disable-dependency-tracking",
+ "--prefix=#{prefix}",
+ "--with-netcdf=#{HOMEBREW_PREFIX}",
+ "--with-hdf5=#{HOMEBREW_PREFIX}",
+ "--with-szlib=#{HOMEBREW_PREFIX}"]
+
+ if grib2?
+ args << "--with-grib_api=#{HOMEBREW_PREFIX}"
+ args << "--with-jasper=#{HOMEBREW_PREFIX}"
+ end
+
+ system "./configure", *args
+ system "make install"
+ end
+
+ def test
+ system "#{bin}/cdo -h"
+ end
+end