class Gmt < Formula desc "Collection of tools for processing and displaying xy and xyz datasets" homepage "http://gmt.soest.hawaii.edu/" url "ftp://ftp.soest.hawaii.edu/gmt/gmt-5.2.1-src.tar.xz" mirror "ftp://ftp.star.nesdis.noaa.gov/pub/sod/lsa/gmt/gmt-5.2.1-src.tar.xz" mirror "ftp://gd.tuwien.ac.at/pub/gmt/gmt-5.2.1-src.tar.xz" sha256 "01c199525bdfa78ad388959e739f34eca8effb8d82475c8786a066e04b5e19af" bottle do sha256 "3187beea5a7e66a8b6f406ffa987d7e6379cba36fba4c0d62ce62800aa46c155" => :el_capitan sha256 "91f2ea626fc5a81cf979b8e9094fa51635fd709fd59e033435c39c5574050bd1" => :yosemite sha256 "e3f739a7f590011af88cf6a1292c2687931faa9a2fd213dc6ac3cf5b6fd8f276" => :mavericks end 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.4.tar.gz" mirror "ftp://ftp.star.nesdis.noaa.gov/pub/sod/lsa/gmt/gshhg-gmt-2.3.4.tar.gz" mirror "ftp://gd.tuwien.ac.at/pub/gmt/gshhg-gmt-2.3.4.tar.gz" sha256 "420c6c0df9170015ac0f7c7d472c5a58f8b70a7bf89f162c59dcd70735389110" end resource "dcw" do url "ftp://ftp.soest.hawaii.edu/gmt/dcw-gmt-1.1.2.tar.gz" mirror "ftp://ftp.star.nesdis.noaa.gov/pub/sod/lsa/gmt/dcw-gmt-1.1.2.tar.gz" mirror "ftp://gd.tuwien.ac.at/pub/gmt/dcw-gmt-1.1.2.tar.gz" sha256 "f719054f8d657e7b10b5182d4c15bc7f38ef7483ed05cdaa9f94ab1a0008bfb6" end def install 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=#{Formula["netcdf"].opt_prefix} -DGDAL_ROOT=#{Formula["gdal"].opt_prefix} -DPCRE_ROOT=#{Formula["pcre"].opt_prefix} -DFFTW3_ROOT=#{Formula["fftw"].opt_prefix} -DLICENSE_RESTRICTED:BOOL=FALSE -DFLOCK:BOOL=TRUE ] mkdir "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