2014-06-23 01:34:44 +00:00
|
|
|
require "formula"
|
2010-04-08 10:04:37 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Cfitsio < Formula
|
2014-06-23 01:34:44 +00:00
|
|
|
homepage "http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html"
|
|
|
|
url "http://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio3370.tar.gz"
|
2014-08-21 02:39:55 +00:00
|
|
|
mirror "ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/cfitsio3370.tar.gz"
|
|
|
|
sha1 "48bd6389dcff3228508eec70384f2cae3a88ff32"
|
2014-06-23 01:34:44 +00:00
|
|
|
version "3.370"
|
2010-04-08 10:04:37 +00:00
|
|
|
|
2014-06-23 01:34:44 +00:00
|
|
|
option "with-examples", "Compile and install example programs"
|
2011-08-29 15:36:01 +00:00
|
|
|
|
2014-06-23 01:34:44 +00:00
|
|
|
resource "examples" do
|
|
|
|
url "http://heasarc.gsfc.nasa.gov/docs/software/fitsio/cexamples/cexamples.zip"
|
|
|
|
version "2014.01.23"
|
|
|
|
sha1 "39a66bb611bf611e7c88f0a410234c0d4955529c"
|
2014-08-25 01:20:49 +00:00
|
|
|
end
|
2013-08-07 05:28:49 +00:00
|
|
|
|
2010-04-08 10:04:37 +00:00
|
|
|
def install
|
|
|
|
system "./configure", "--prefix=#{prefix}"
|
|
|
|
system "make shared"
|
|
|
|
system "make install"
|
2011-08-29 15:36:01 +00:00
|
|
|
|
2014-06-23 01:34:44 +00:00
|
|
|
if build.with? "examples"
|
2011-08-29 15:36:01 +00:00
|
|
|
system "make fpack funpack"
|
2014-06-23 01:34:44 +00:00
|
|
|
bin.install "fpack", "funpack"
|
2011-08-29 15:36:01 +00:00
|
|
|
|
2014-06-23 01:34:44 +00:00
|
|
|
resource("examples").stage do
|
2013-08-07 05:28:49 +00:00
|
|
|
# compressed_fits.c does not work (obsolete function call)
|
2014-05-31 15:03:18 +00:00
|
|
|
(Dir["*.c"] - ["compress_fits.c"]).each do |f|
|
2013-06-13 18:43:03 +00:00
|
|
|
system ENV.cc, f, "-I#{include}", "-L#{lib}", "-lcfitsio", "-lm", "-o", "#{bin}/#{f.sub('.c', '')}"
|
2011-08-29 15:36:01 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2010-04-08 10:04:37 +00:00
|
|
|
end
|
|
|
|
end
|