This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Add compatible netCDF C++ bindings

In some old codes, the old C++ netCDF API has been used, so we should
provide the compatible C++ bindings by adding an option
"--enable-cxx-compat".
  • Loading branch information...
1 parent 9f3838c commit 87bac91cb2200a870d98af90492af11017671b96 @dongli dongli committed Oct 3, 2012
Showing with 13 additions and 1 deletion.
  1. +13 −1 Library/Formula/netcdf.rb
View
@@ -6,6 +6,12 @@ class NetcdfCXX < Formula
sha1 '59628c9f06c211a47517fc00d8b068da159ffa9d'
end
+class NetcdfCXX_compat < Formula
+ homepage 'http://www.unidata.ucar.edu/software/netcdf'
+ url 'http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-cxx-4.2.tar.gz'
+ sha1 'bab9b2d873acdddbdbf07ab35481cd0267a3363b'
+end
+
class NetcdfFortran < Formula
homepage 'http://www.unidata.ucar.edu/software/netcdf'
url 'http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-fortran-4.2.tar.gz'
@@ -19,8 +25,9 @@ class Netcdf < Formula
depends_on 'hdf5'
- option 'enable-fortran', 'Compile Fortran Bindings'
+ option 'enable-fortran', 'Compile Fortran bindings'
option 'disable-cxx', "Don't compile C++ bindings"
+ option 'enable-cxx-compat', 'Compile C++ bindings for compatibility'
def install
if build.include? 'enable-fortran'
@@ -56,6 +63,11 @@ def install
system 'make install'
end unless build.include? 'disable-cxx'
+ NetcdfCXX_compat.new.brew do
+ system './configure', *common_args
+ system 'make install'
+ end if build.include? 'enable-cxx-compat'
+
NetcdfFortran.new.brew do
system './configure', *common_args
system 'make install'

0 comments on commit 87bac91

Please sign in to comment.