2010-04-08 10:04:37 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-08-29 15:36:01 +00:00
|
|
|
class CfitsioExamples < Formula
|
|
|
|
url 'http://heasarc.gsfc.nasa.gov/docs/software/fitsio/cexamples/cexamples.zip'
|
|
|
|
version '2010.08.19'
|
2012-09-03 18:33:56 +00:00
|
|
|
sha1 '35360dccc69dc5f12efb6fc9096ad951b59244d5'
|
2011-08-29 15:36:01 +00:00
|
|
|
end
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Cfitsio < Formula
|
2010-04-08 10:04:37 +00:00
|
|
|
homepage 'http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html'
|
2012-08-06 22:10:20 +00:00
|
|
|
url 'ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/cfitsio3310.tar.gz'
|
|
|
|
sha1 '35360dccc69dc5f12efb6fc9096ad951b59244d5'
|
|
|
|
version '3.310'
|
2010-04-08 10:04:37 +00:00
|
|
|
|
2012-08-23 04:37:04 +00:00
|
|
|
option 'with-examples', "Compile and install example programs"
|
2011-08-29 15:36:01 +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
|
|
|
|
2012-08-23 04:37:04 +00:00
|
|
|
if build.include? 'with-examples'
|
2011-08-29 15:36:01 +00:00
|
|
|
system "make fpack funpack"
|
2012-02-22 04:48:36 +00:00
|
|
|
bin.install 'fpack', 'funpack'
|
2011-08-29 15:36:01 +00:00
|
|
|
|
|
|
|
# fetch, compile and install examples programs
|
|
|
|
CfitsioExamples.new.brew do
|
|
|
|
mkdir 'bin'
|
2012-02-21 06:04:21 +00:00
|
|
|
Dir['*.c'].each do |f|
|
2011-08-29 15:36:01 +00:00
|
|
|
# compressed_fits.c does not work (obsolete function call)
|
2012-01-02 22:42:29 +00:00
|
|
|
next if f == 'compress_fits.c'
|
2012-05-15 18:31:21 +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
|
|
|
|
bin.install Dir['bin/*']
|
|
|
|
end
|
|
|
|
end
|
2010-04-08 10:04:37 +00:00
|
|
|
end
|
|
|
|
end
|