44 lines
1.8 KiB
Ruby
44 lines
1.8 KiB
Ruby
class Cdo < Formula
|
|
desc "Climate Data Operators"
|
|
homepage "https://code.mpimet.mpg.de/projects/cdo"
|
|
url "https://code.mpimet.mpg.de/attachments/download/20826/cdo-1.9.8.tar.gz"
|
|
sha256 "f2660ac6f8bf3fa071cf2a3a196b3ec75ad007deb3a782455e80f28680c5252a"
|
|
license "GPL-2.0"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "7642f67bf1e8b5eb28faa6b31b9c5c8800d971d584a2b8ef5c218fd39f3929c4" => :catalina
|
|
sha256 "6bee75bcd2637789145bcfb627c6faf7f4eb2a156ada667ddcfa9c97ad374666" => :mojave
|
|
sha256 "1f7aef8ac91a7f368b6e571537a59d8a83220657b8a051d7a85ac820a67cb853" => :high_sierra
|
|
end
|
|
|
|
depends_on "eccodes"
|
|
depends_on "hdf5"
|
|
depends_on "netcdf"
|
|
depends_on "proj"
|
|
depends_on "szip"
|
|
|
|
def install
|
|
args = %W[
|
|
--disable-dependency-tracking
|
|
--prefix=#{prefix}
|
|
--with-eccodes=#{Formula["eccodes"].opt_prefix}
|
|
--with-netcdf=#{Formula["netcdf"].opt_prefix}
|
|
--with-hdf5=#{Formula["hdf5"].opt_prefix}
|
|
--with-szlib=#{Formula["szip"].opt_prefix}
|
|
]
|
|
|
|
system "./configure", *args
|
|
system "make", "install"
|
|
end
|
|
|
|
test do
|
|
data = <<~EOF.unpack1("m")
|
|
R1JJQgABvAEAABz/AAD/gAEBAABkAAAAAAEAAAoAAAAAAAAAAAAgAP8AABIACgB+9IBrbIABLrwA4JwTiBOIQAAAAAAAAXQIgAPEFI2rEBm9AACVLSuNtwvRALldqDul2GV1pw1CbXsdub2q9a/17Yi9o11DE0UFWwRjqsvH80wgS82o3UJ9rkitLcPgxJDVaO9No4XV6EWNPeUSSC7txHi7/aglVaO5uKKtwr2slV5DYejEoKOwpdirLXPIGUAWCya7ntil1amLu4PCtafNp5OpPafFqVWmxaQto72sMzGQJeUxcJkbqEWnOKM9pTOlTafdqPCoc6tAq0WqFarTq2i5M1NdRq2AHWzFpFWj1aJtmAOrhaJzox2nwKr4qQWofaggqz2rkHcog2htuI2YmOB9hZDIpxXA3ahdpzOnDarjqj2k0KlIqM2oyJsjjpODmGu1YtU6WHmNZ5uljcbVrduuOK1DrDWjGKM4pQCmfdVFprWbnVd7Vw1QY1s9VnNzvZiLmGucPZwVnM2bm5yFqb2cHdRQqs2hhZrrm1VGeEQgOduhjbWrqAWfzaANnZOdWJ0NnMWeJQA3Nzc3AAAAAA==
|
|
EOF
|
|
File.binwrite("test.grb", data)
|
|
system "#{bin}/cdo", "-f", "nc", "copy", "test.grb", "test.nc"
|
|
assert_predicate testpath/"test.nc", :exist?
|
|
end
|
|
end
|