Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Add compatible netCDF C++ bindings #15264

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 13 additions & 1 deletion Library/Formula/netcdf.rb
Expand Up @@ -6,6 +6,12 @@ class NetcdfCXX < Formula
sha1 '59628c9f06c211a47517fc00d8b068da159ffa9d' sha1 '59628c9f06c211a47517fc00d8b068da159ffa9d'
end 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 class NetcdfFortran < Formula
homepage 'http://www.unidata.ucar.edu/software/netcdf' homepage 'http://www.unidata.ucar.edu/software/netcdf'
url 'http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-fortran-4.2.tar.gz' url 'http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-fortran-4.2.tar.gz'
Expand All @@ -19,8 +25,9 @@ class Netcdf < Formula


depends_on 'hdf5' depends_on 'hdf5'


option 'enable-fortran', 'Compile Fortran Bindings' option 'enable-fortran', 'Compile Fortran bindings'
option 'disable-cxx', "Don't compile C++ bindings" option 'disable-cxx', "Don't compile C++ bindings"
option 'enable-cxx-compat', 'Compile C++ bindings for compatibility'


def install def install
if build.include? 'enable-fortran' if build.include? 'enable-fortran'
Expand Down Expand Up @@ -56,6 +63,11 @@ def install
system 'make install' system 'make install'
end unless build.include? 'disable-cxx' 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 NetcdfFortran.new.brew do
system './configure', *common_args system './configure', *common_args
system 'make install' system 'make install'
Expand Down