homebrew-core/Formula/cdo.rb

51 lines
2.4 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/26654/cdo-2.0.2.tar.gz"
sha256 "34dfdd0d4126cfd35fc69e37e60901c8622d13ec5b3fa5f0fe6a1cc866cc5a70"
license "GPL-2.0-only"
livecheck do
url "https://code.mpimet.mpg.de/projects/cdo/files"
regex(/href=.*?cdo[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 cellar: :any, arm64_monterey: "c4262a60d62a538198f5cf663528a9e7fb0589a8cdc1d6e68484c5739543186d"
sha256 cellar: :any, arm64_big_sur: "614b77476e08e71f8f000d1ad2192fc9f5068b6bc9257c8579225be5575d4f1a"
sha256 cellar: :any, monterey: "0268e78af48b1a7ce05651cf5dd30b04c83d6e2cc75c15f00d2c09eccbfa352d"
sha256 cellar: :any, big_sur: "84a66a6c68e60aa42de367533cd8716c7f0ff1427ef471f13bad7b2f9221a456"
sha256 cellar: :any, catalina: "9ae95b7f43b0d420192fd612edc69fedf000c78de4b6b0503f50b25e812983c4"
sha256 cellar: :any_skip_relocation, x86_64_linux: "7c86e0e97eab249a1bf5e913e1753adad5f9779cb0719d241d940fd9b4bdc33e"
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