85 lines
3.4 KiB
Ruby
85 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 1
|
|
head "https://github.com/GenericMappingTools/gmt.git", branch: "master"
|
|
|
|
bottle do
|
|
sha256 arm64_monterey: "4f239d4f7ca0d249bcb2cd56c15ceb4c70b5836e8e49111598bb3e2d89687cce"
|
|
sha256 arm64_big_sur: "d5ed85d0b31405eb18b0116feab22615fb0698c45c07bc0164d8be885330d983"
|
|
sha256 monterey: "1ab8c4b67d164fb10b0698c31d7655e07c43feba0f1a86f70106e4e0d166fb16"
|
|
sha256 big_sur: "26e6012bc31f7fc8bdb6bed436d717075d206ff9fc5d02cded86c807bf04eaca"
|
|
sha256 catalina: "ef6cbd7344046dd7533c10e62373e8db1bf2e4e2795e244c54591470085bbf2b"
|
|
sha256 x86_64_linux: "b048d77b0c46671464dcf6dec66f919a37659c2781e6743721b92ce5c0360b16"
|
|
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
|