52 lines
2.4 KiB
Ruby
52 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/26823/cdo-2.0.5.tar.gz"
|
|
sha256 "edeebbf1c3b1a1f0c642dae6bc8c7624e0c54babe461064dc5c7daca4a5b0dce"
|
|
license "GPL-2.0-only"
|
|
revision 1
|
|
|
|
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: "6263a211f02fdafd51bbfa3a0773a9fa81979b4c29b9d4e33da4417ab6dc6d51"
|
|
sha256 cellar: :any, arm64_big_sur: "2656dc32acb71d11f5288aba8571de98a4411ee58e426437971759edfd38f1c3"
|
|
sha256 cellar: :any, monterey: "043bece96c7875b42f3f5315a4beea11f2eeda4947199c206b01b29173c22e9f"
|
|
sha256 cellar: :any, big_sur: "dd422128a9b8b836e849abcec45448435d3c2b21c33f9374cada7d98eed057e7"
|
|
sha256 cellar: :any, catalina: "95c9af1513fe44f93dea7e59677c57d165588febe490b02b322701517e6e823b"
|
|
sha256 cellar: :any_skip_relocation, x86_64_linux: "bd9ff737755e92c5a1a21d5a9aa8f30ef8f66eab9c8e3e1f62c0e4b0d4e5dd01"
|
|
end
|
|
|
|
depends_on "eccodes"
|
|
depends_on "hdf5"
|
|
depends_on "libaec"
|
|
depends_on "netcdf"
|
|
depends_on "proj"
|
|
|
|
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["libaec"].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
|