86 lines
3.4 KiB
Ruby
86 lines
3.4 KiB
Ruby
class Gmt < Formula
|
|
desc "Tools for manipulating and plotting geographic and Cartesian data"
|
|
homepage "https://www.generic-mapping-tools.org/"
|
|
url "https://github.com/GenericMappingTools/gmt/releases/download/6.4.0/gmt-6.4.0-src.tar.xz"
|
|
mirror "https://mirrors.ustc.edu.cn/gmt/gmt-6.4.0-src.tar.xz"
|
|
sha256 "b46effe59cf96f50c6ef6b031863310d819e63b2ed1aa873f94d70c619490672"
|
|
license "LGPL-3.0-or-later"
|
|
revision 3
|
|
head "https://github.com/GenericMappingTools/gmt.git", branch: "master"
|
|
|
|
bottle do
|
|
sha256 arm64_ventura: "daba89a4d236c3efb50490ee9f8833b41e2eb6048d5092f33b77ef563097f209"
|
|
sha256 arm64_monterey: "e0b2e5582d84f915c012372b1d386e5f46b66693afdc74a72522c845e5d7b3a9"
|
|
sha256 arm64_big_sur: "c489af8af714fbc71685267856172761638d59b91c29a13067307ba1e0d09065"
|
|
sha256 ventura: "87759ae7ec911b5819f178748672edd1bc7d0b0bc9bf966273b1bc94a84cc03b"
|
|
sha256 monterey: "7fc98e7886bd99edb0533bed0c6ad5b69a12b7c36aa7dd027a44a45ce0b5f237"
|
|
sha256 big_sur: "9f3c9486007139908e33d5c605b599425a3a2e3a1d5052941559244921aa98ac"
|
|
sha256 x86_64_linux: "98a10b8a12a07d1708a8eea985c49be96316810c73e4a380f0f78837da4565ca"
|
|
end
|
|
|
|
depends_on "cmake" => :build
|
|
depends_on "fftw"
|
|
depends_on "gdal"
|
|
depends_on "netcdf"
|
|
depends_on "pcre2"
|
|
|
|
resource "gshhg" do
|
|
url "https://github.com/GenericMappingTools/gshhg-gmt/releases/download/2.3.7/gshhg-gmt-2.3.7.tar.gz"
|
|
mirror "https://mirrors.ustc.edu.cn/gmt/gshhg-gmt-2.3.7.tar.gz"
|
|
sha256 "9bb1a956fca0718c083bef842e625797535a00ce81f175df08b042c2a92cfe7f"
|
|
end
|
|
|
|
resource "dcw" do
|
|
url "https://github.com/GenericMappingTools/dcw-gmt/releases/download/2.1.1/dcw-gmt-2.1.1.tar.gz"
|
|
mirror "https://mirrors.ustc.edu.cn/gmt/dcw-gmt-2.1.1.tar.gz"
|
|
sha256 "d4e208dca88fbf42cba1bb440fbd96ea2f932185c86001f327ed0c7b65d27af1"
|
|
end
|
|
|
|
def install
|
|
(buildpath/"gshhg").install resource("gshhg")
|
|
(buildpath/"dcw").install resource("dcw")
|
|
|
|
# GMT_DOCDIR and GMT_MANDIR must be relative paths
|
|
args = %W[
|
|
-DGMT_DOCDIR=share/doc/gmt
|
|
-DGMT_MANDIR=share/man
|
|
-DGSHHG_ROOT=#{buildpath}/gshhg
|
|
-DCOPY_GSHHG:BOOL=TRUE
|
|
-DDCW_ROOT=#{buildpath}/dcw
|
|
-DCOPY_DCW:BOOL=TRUE
|
|
-DPCRE_ROOT=FALSE
|
|
-DFFTW3_ROOT=#{Formula["fftw"].opt_prefix}
|
|
-DGDAL_ROOT=#{Formula["gdal"].opt_prefix}
|
|
-DNETCDF_ROOT=#{Formula["netcdf"].opt_prefix}
|
|
-DPCRE2_ROOT=#{Formula["pcre2"].opt_prefix}
|
|
-DFLOCK:BOOL=TRUE
|
|
-DGMT_INSTALL_MODULE_LINKS:BOOL=FALSE
|
|
-DGMT_INSTALL_TRADITIONAL_FOLDERNAMES:BOOL=FALSE
|
|
-DLICENSE_RESTRICTED:BOOL=FALSE
|
|
]
|
|
|
|
system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args
|
|
system "cmake", "--build", "build"
|
|
system "cmake", "--install", "build"
|
|
inreplace bin/"gmt-config", Superenv.shims_path/ENV.cc, DevelopmentTools.locate(ENV.cc)
|
|
end
|
|
|
|
def caveats
|
|
<<~EOS
|
|
GMT needs Ghostscript for the 'psconvert' command to convert PostScript files
|
|
to other formats. To use 'psconvert', please 'brew install ghostscript'.
|
|
|
|
GMT needs FFmpeg for the 'movie' command to make movies in MP4 or WebM format.
|
|
If you need this feature, please 'brew install ffmpeg'.
|
|
|
|
GMT needs GraphicsMagick for the 'movie' command to make animated GIFs.
|
|
If you need this feature, please 'brew install graphicsmagick'.
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
system "#{bin}/gmt pscoast -R0/360/-70/70 -Jm1.2e-2i -Ba60f30/a30f15 -Dc -G240 -W1/0 -P > test.ps"
|
|
assert_predicate testpath/"test.ps", :exist?
|
|
end
|
|
end
|