51 lines
1.6 KiB
Ruby
51 lines
1.6 KiB
Ruby
class Nco < Formula
|
|
desc "Command-line operators for netCDF and HDF files"
|
|
homepage "https://nco.sourceforge.io/"
|
|
url "https://downloads.sourceforge.net/project/nco/nco-4.7.1.tar.gz"
|
|
sha256 "3e350658117e12f0f102de0c3d1ad1756b7ebf7f43821f3d2044b4659633938b"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "3fd90ad3427cc7242a44c0539c1b9c0bf5c95e80f9a2a4e2a83cb60782309b7c" => :high_sierra
|
|
sha256 "519fe64c152934fbf43c775ae8752605693b6d71e7b00c06667caeaae184d26c" => :sierra
|
|
sha256 "b92b86ace8bc78594fb054742b274cfe69ece78022eb95fd1bbd9e6e0a5eb4c0" => :el_capitan
|
|
end
|
|
|
|
head do
|
|
url "https://github.com/czender/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?
|
|
|
|
inreplace "configure" do |s|
|
|
# The Antlr 2.x program installed by Homebrew is called antlr2
|
|
s.gsub! "for ac_prog in runantlr antlr", "for ac_prog in runantlr antlr2"
|
|
end
|
|
|
|
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
|