45 lines
1.9 KiB
Ruby
45 lines
1.9 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/23323/cdo-1.9.9.tar.gz"
|
|
sha256 "959b5b58f495d521a7fd1daa84644888ec87d6a0df43f22ad950d17aee5ba98d"
|
|
license "GPL-2.0-only"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "a9b7acb1b9e16a835b5c7430f0283d3eb1d58261e2c0a2187646276e90867021" => :big_sur
|
|
sha256 "52253227a742132e1ed2fadcc549025539d246abf899e13ef9572f0ae8e49c15" => :catalina
|
|
sha256 "07ee76a81ad678ed9608ad8460cae87fcc20398401dec3607558057e46abe39e" => :mojave
|
|
sha256 "a17b8f98e2470e75e8c0cffc4e838ab45188218a021683d866578063ad2aaecc" => :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
|