Skip to content

Commit

Permalink
gmt 5.1.1
Browse files Browse the repository at this point in the history
Add conflicts_with GMT 4, provided by gmt4 formula.
GMT build system has now moved to cmake.

Closes #473.
  • Loading branch information
claudiodsf authored and ianml committed Mar 3, 2014
1 parent 812b454 commit 19e7a0a
Showing 1 changed file with 52 additions and 18 deletions.
70 changes: 52 additions & 18 deletions gmt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,67 @@

class Gmt < Formula
homepage 'http://gmt.soest.hawaii.edu/'
url 'ftp://ftp.soest.hawaii.edu/gmt/gmt-4.5.12-src.tar.bz2'
sha1 'a5ce7419a1aeb523540d2f93ca62153e47ce72fc'
url 'ftp://ftp.soest.hawaii.edu/gmt/gmt-5.1.1-src.tar.bz2'
sha1 'ff64936dfdec8a57a89d29f505f27e435169d33f'

depends_on 'cmake' => :build
depends_on 'gdal'
depends_on 'netcdf'
depends_on 'fftw'
depends_on 'pcre'

conflicts_with 'gmt4', :because => 'Both versions install the same binaries.'

resource 'gshhg' do
url 'ftp://ftp.soest.hawaii.edu/gmt/gshhg-gmt-2.3.0.tar.gz'
sha1 'eb62a0a9bceee4297055be18b8727b603cd0e9cb'
end

resource 'dcw' do
url 'ftp://ftp.soest.hawaii.edu/gmt/dcw-gmt-1.1.1.tar.gz'
sha1 'deca85f21426604c8574a18d16c931a1fd9ae27b'
end

def install
ENV.deparallelize # Parallel builds don't work due to missing makefile dependencies
datadir = share/name
system "./configure", "--prefix=#{prefix}",
"--datadir=#{datadir}",
"--enable-gdal=#{HOMEBREW_PREFIX}",
"--enable-netcdf=#{HOMEBREW_PREFIX}",
"--enable-shared",
"--enable-triangle",
"--disable-xgrid",
"--disable-mex"
system "make"
system "make install-gmt"
system "make install-data"
system "make install-suppl"
system "make install-man"
datadir.install resource('gshhg')
gshhgdir = buildpath/'gshhg'
dcwdir = buildpath/'dcw'
args = std_cmake_args.concat %W[
-DCMAKE_INSTALL_PREFIX=#{prefix}
-DGMT_INSTALL_TRADITIONAL_FOLDERNAMES:BOOL=FALSE
-DGMT_INSTALL_MODULE_LINKS:BOOL=TRUE
-DGMT_DOCDIR=#{share}/doc/gmt
-DGMT_MANDIR=#{man}
-DGSHHG_ROOT=#{gshhgdir}
-DCOPY_GSHHG:BOOL=TRUE
-DDCW_ROOT=#{dcwdir}
-DCOPY_DCW:BOOL=TRUE
-DNETCDF_ROOT=#{HOMEBREW_PREFIX}
-DGDAL_ROOT=#{HOMEBREW_PREFIX}
-DPCRE_ROOT=#{HOMEBREW_PREFIX}
-DFFTW3_ROOT=#{HOMEBREW_PREFIX}
-DLICENSE_RESTRICTED:BOOL=FALSE
-DFLOCK:BOOL=TRUE
]
Dir.mkdir 'build'
Dir.chdir 'build' do
gshhgdir.install resource('gshhg')
dcwdir.install resource('dcw')
system 'cmake', '..', *args
system 'make install'
end
end

def caveats; <<-EOS.undent
GMT 5 is mostly (but not 100%) compatible with previous versions.
Moreover, the compatibility mode is expected to exist only during a
transitional period.
If you want to continue using GMT 4:
`brew install gmt4`
We agreed to the `triangle` license
(http://www.cs.cmu.edu/~quake/triangle.html) for you.
If this is unacceptable you should uninstall.
EOS
end
end

0 comments on commit 19e7a0a

Please sign in to comment.