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 5
|
|
head "https://github.com/GenericMappingTools/gmt.git", branch: "master"
|
|
|
|
bottle do
|
|
sha256 arm64_ventura: "fef46f4de1c3f752d063310d346eb609479fea6cd04d6727533734f703aae778"
|
|
sha256 arm64_monterey: "630974184d2ae106d0c3cbca312086a6ecfb3f716988a006422d454f541d6d41"
|
|
sha256 arm64_big_sur: "f701e8d961581f7fc71ea2e1fd944fca6e7d0fb40006c6631c161fdef105978a"
|
|
sha256 ventura: "909621edde7e0269f38d195b4f85a190b91f0f2aafeb5eb9ef76aaf62d9e2932"
|
|
sha256 monterey: "f36d0d0ff4c70b7f2d8a6adcb2061b687187620839350ef58b9f4758763f8c67"
|
|
sha256 big_sur: "594113edd85dc420fe01d2dc5ac69a9e0902e70db918bd921024ae329198a5aa"
|
|
sha256 x86_64_linux: "c788ac81e850a5431399b58095cc35fb3bf5036709b455bbdda2d64aab66c3c7"
|
|
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
|