homebrew-core/Formula/cfitsio.rb

36 lines
1.1 KiB
Ruby
Raw Normal View History

require 'formula'
2011-03-10 05:11:03 +00:00
class Cfitsio < Formula
homepage 'http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html'
url 'http://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio3360.tar.gz'
mirror 'https://downloads.sourceforge.net/project/machomebrew/mirror/cfitsio-3.360.tar.gz'
2014-04-09 03:38:34 +00:00
sha1 '0d3099721a6bf1e763f158c447a74c5e8192412d'
version '3.360'
2012-08-23 04:37:04 +00:00
option 'with-examples', "Compile and install example programs"
2013-08-07 05:28:49 +00:00
resource 'examples' do
url 'http://heasarc.gsfc.nasa.gov/docs/software/fitsio/cexamples/cexamples.zip'
version '2014.01.23'
sha1 '39a66bb611bf611e7c88f0a410234c0d4955529c'
2013-08-07 05:28:49 +00:00
end if build.with? 'examples'
def install
system "./configure", "--prefix=#{prefix}"
system "make shared"
system "make install"
2013-08-07 05:28:49 +00:00
if build.with? 'examples'
system "make fpack funpack"
2012-02-22 04:48:36 +00:00
bin.install 'fpack', 'funpack'
2013-08-07 05:28:49 +00:00
resource('examples').stage do
# compressed_fits.c does not work (obsolete function call)
Dir['*.c'].reject{|f| f == 'compress_fits.c'}.each do |f|
system ENV.cc, f, "-I#{include}", "-L#{lib}", "-lcfitsio", "-lm", "-o", "#{bin}/#{f.sub('.c', '')}"
end
end
end
end
end