homebrew-core/Formula/ccfits.rb

40 lines
1.3 KiB
Ruby

class Ccfits < Formula
desc "Object oriented interface to the cfitsio library"
homepage "https://heasarc.gsfc.nasa.gov/fitsio/CCfits/"
url "https://heasarc.gsfc.nasa.gov/fitsio/CCfits/CCfits-2.5.tar.gz"
sha256 "938ecd25239e65f519b8d2b50702416edc723de5f0a5387cceea8c4004a44740"
revision 1
bottle do
cellar :any
sha256 "091f16fb6eb763125d88394d1baa092d005fe86723af6b0b2e0a04377f61293c" => :catalina
sha256 "b22ef6deaa692874052618ade2477edae7bfb364c7fc99a840cc5907663165e9" => :mojave
sha256 "aa4b8ed8430b08cc627e54c938901b85967e0050e61c359d31c18617092590a9" => :high_sierra
end
depends_on "cfitsio"
def install
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}"
system "make"
system "make", "install"
end
test do
(testpath/"test.cpp").write <<~EOS
#include <CCfits/CCfits>
#include <iostream>
int main() {
CCfits::FITS::setVerboseMode(true);
std::cout << "the answer is " << CCfits::VTbyte << std::endl;
}
EOS
system ENV.cxx, "-std=c++11", "test.cpp", "-o", "test", "-I#{include}",
"-L#{lib}", "-lCCfits"
assert_match /the answer is -11/, shell_output("./test")
end
end