homebrew-core/Formula/cdo.rb

51 lines
2.3 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/24638/cdo-1.9.10.tar.gz"
sha256 "cc39c89bbb481d7b3945a06c56a8492047235f46ac363c4f0d980fccdde6677e"
license "GPL-2.0-only"
revision 2
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_big_sur: "7a43db43e80e273009a45a8eacae5fc8598650fa48f1a3a8045d2b675fae5883"
sha256 cellar: :any, big_sur: "6f3d10dfcc8bf35c102f3ee8595e95f71e5d6acbcae4e000d7bc7323c50dfbcf"
sha256 cellar: :any, catalina: "8ea69492689eaf80fec52045743e19825b7892bc19ea2f962d2be74dad6a883c"
sha256 cellar: :any, mojave: "7d4033220e3fa18f3e4a18c775e69b1f50e8949a67d6109d6a8544301599cfc9"
sha256 cellar: :any_skip_relocation, x86_64_linux: "4b3ac6d4c8d33aebe1ffa457dab422e35a389a2e54e67e2fd2772b01924e8e39"
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