2010-02-11 18:01:59 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-04-01 20:43:30 +00:00
|
|
|
def fortran?
|
|
|
|
ARGV.include? '--enable-fortran'
|
|
|
|
end
|
|
|
|
|
|
|
|
def threadsafe?
|
|
|
|
ARGV.include? '--enable-threadsafe'
|
|
|
|
end
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Hdf5 < Formula
|
2011-02-18 02:18:38 +00:00
|
|
|
url 'http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-1.8.6.tar.bz2'
|
2010-02-11 18:01:59 +00:00
|
|
|
homepage 'http://www.hdfgroup.org/HDF5/'
|
2011-02-18 02:18:38 +00:00
|
|
|
sha1 '348bd881c03a9568ac4ea9071833d6119c733757'
|
|
|
|
version '1.8.6'
|
2010-02-11 18:01:59 +00:00
|
|
|
|
|
|
|
depends_on 'szip'
|
|
|
|
|
2011-04-01 20:43:30 +00:00
|
|
|
def options
|
|
|
|
[
|
|
|
|
['--enable-fortran', 'Compile Fortran bindings at the expense of having shared libraries'],
|
|
|
|
['--enable-threadsafe', 'Trade performance and C++ or Fortran support for thread safety']
|
|
|
|
]
|
|
|
|
end
|
|
|
|
|
2010-02-11 18:01:59 +00:00
|
|
|
def install
|
2011-04-01 20:43:30 +00:00
|
|
|
ENV.fortran if fortran?
|
|
|
|
|
|
|
|
args = [
|
|
|
|
"--prefix=#{prefix}",
|
|
|
|
'--disable-debug',
|
|
|
|
'--disable-dependency-tracking',
|
|
|
|
'--enable-production',
|
|
|
|
'--with-zlib=yes',
|
|
|
|
'--with-szlib=yes',
|
|
|
|
'--enable-filters=all'
|
|
|
|
]
|
|
|
|
args.concat ['--with-pthread=/usr', '--enable-threadsafe'] if threadsafe?
|
|
|
|
args << '--enable-cxx' unless threadsafe?
|
|
|
|
args << '--enable-fortran' if fortran? and not threadsafe?
|
|
|
|
|
|
|
|
system "./configure", *args
|
2010-02-11 18:01:59 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
end
|