homebrew-core/Formula/cfitsio.rb

36 lines
1.3 KiB
Ruby
Raw Normal View History

2017-08-09 17:41:03 +00:00
class Cfitsio < Formula
desc "C access to FITS data files with optional Fortran wrappers"
homepage "https://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html"
url "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio3420.tar.gz"
2017-10-19 03:13:24 +00:00
mirror "https://fossies.org/linux/misc/cfitsio3420.tar.gz"
version "3.420"
sha256 "6c10aa636118fa12d9a5e2e66f22c6436fb358da2af6dbf7e133c142e2ac16b8"
2017-08-09 17:41:03 +00:00
2017-08-09 22:34:57 +00:00
bottle do
cellar :any
2017-10-12 23:22:59 +00:00
sha256 "8b21e0a610d1caa8d8900546d2b2d9f83f74a9f1bd0d3e729f1ab1ad28b81813" => :high_sierra
sha256 "b2f55b8504d79e27d23b5fa93f77ff9bc2488eef4f5ed94c7a16757505df4462" => :sierra
sha256 "7681f60baee8d9a73639be3f54d7f4a1c71c9fc9f4ac7fd0e3ba20cb2a2c3c7b" => :el_capitan
2017-08-09 22:34:57 +00:00
end
2017-10-15 10:23:11 +00:00
option "with-reentrant", "Build with support for concurrency"
2017-08-09 17:41:03 +00:00
def install
2017-10-15 10:23:11 +00:00
args = ["--prefix=#{prefix}"]
args << "--enable-reentrant" if build.with? "reentrant"
system "./configure", *args
2017-08-09 17:41:03 +00:00
system "make", "shared"
system "make", "install"
(pkgshare/"testprog").install Dir["testprog*"]
end
test do
cp Dir["#{pkgshare}/testprog/testprog*"], testpath
system ENV.cc, "testprog.c", "-o", "testprog", "-I#{include}",
"-L#{lib}", "-lcfitsio"
system "./testprog > testprog.lis"
cmp "testprog.lis", "testprog.out"
cmp "testprog.fit", "testprog.std"
end
end