52 lines
1.5 KiB
Ruby
52 lines
1.5 KiB
Ruby
class Nco < Formula
|
|
desc "Command-line operators for netCDF and HDF files"
|
|
homepage "https://nco.sourceforge.io/"
|
|
url "https://github.com/nco/nco/archive/4.9.6.tar.gz"
|
|
sha256 "2b3da28e12e873ebf2ae154f1366827adfe51e4d7b65d2e44895b5d8920fbe92"
|
|
license "BSD-3-Clause"
|
|
|
|
livecheck do
|
|
url "https://github.com/nco/nco/releases/latest"
|
|
regex(%r{href=.*?/tag/v?(\d+(?:\.\d+)+)["' >]}i)
|
|
end
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "cd27bac9350db6d3c23f462672cb4b67dfabd9004dc911473cb31967c027ba0c" => :big_sur
|
|
sha256 "ec9295ebe49e0cb81d2806cf66780a95998e3268608c8a9607ec5391d41facf3" => :catalina
|
|
sha256 "aa9c507422bbc6b950847bfc30e4b3a4632baf0cff10213da3ca09da529f1797" => :mojave
|
|
end
|
|
|
|
head do
|
|
url "https://github.com/nco/nco.git"
|
|
depends_on "autoconf" => :build
|
|
depends_on "automake" => :build
|
|
end
|
|
|
|
depends_on "antlr@2" # requires C++ interface in Antlr2
|
|
depends_on "gsl"
|
|
depends_on "netcdf"
|
|
depends_on "texinfo"
|
|
depends_on "udunits"
|
|
|
|
resource "example_nc" do
|
|
url "https://www.unidata.ucar.edu/software/netcdf/examples/WMI_Lear.nc"
|
|
sha256 "e37527146376716ef335d01d68efc8d0142bdebf8d9d7f4e8cbe6f880807bdef"
|
|
end
|
|
|
|
def install
|
|
system "./autogen.sh" if build.head?
|
|
|
|
system "./configure", "--disable-dependency-tracking",
|
|
"--prefix=#{prefix}",
|
|
"--enable-netcdf4"
|
|
system "make", "install"
|
|
end
|
|
|
|
test do
|
|
testpath.install resource("example_nc")
|
|
output = shell_output("#{bin}/ncks --json -M WMI_Lear.nc")
|
|
assert_match "\"time\": 180", output
|
|
end
|
|
end
|