-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Portfile
163 lines (141 loc) · 6.13 KB
/
Portfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
PortGroup cmake 1.0
PortGroup github 1.0
name gmt5
github.setup GenericMappingTools gmt 5.4.5
github.tarball_from releases
distname ${github.project}-${github.version}-src
revision 19
subport gmt6 {
github.setup GenericMappingTools gmt 6.5.0
revision 1
epoch 1
}
categories science
platforms darwin
maintainers {me.com:remko.scharroo @remkos} openmaintainer
license GPL-3
description The Generic Mapping Tools
long_description GMT is an open source collection of ~120 tools \
for manipulating geographic and Cartesian data sets and \
producing PostScript illustrations ranging from simple x-y \
plots via contour maps to artificially illuminated surfaces \
and 3D perspective views.
homepage https://www.generic-mapping-tools.org/
master_sites https://github.com/GenericMappingTools/gmt/releases/download/${version} \
ftp://ftp.soest.hawaii.edu/gmt \
ftp://ftp.star.nesdis.noaa.gov/pub/sod/lsa/gmt \
ftp://ftp.iris.washington.edu/pub/gmt \
ftp://ftp.iag.usp.br/pub/gmt \
ftp://gmt.mirror.ac.za/gmt \
http://mirrors.ustc.edu.cn/gmt \
http://www.scc.u-tokai.ac.jp/gmt
use_xz yes
distname gmt-${version}
distfiles ${distname}-src${extract.suffix}
if {${subport} eq "gmt5"} {
checksums rmd160 900befd66ec4a9aea75c53d99ed83f7e25163e35\
sha256 078d4997507cb15344c74a874568985e45bdbd6d3a72d330c74c47f4c0359bb1 \
size 59175704
} else {
checksums rmd160 3e47113d134bde756b98906a4704b3151902c4d1 \
sha256 4022adb44033f9c1d5a4d275b69506449e4d486efe2218313f3ff7a6c6c3141e \
size 58696516
}
depends_lib port:curl \
port:dcw-gmt \
port:ghostscript \
port:gshhg-gmt \
port:netcdf
if {${subport} eq "gmt5"} {
patchfiles patch-gmt5-arm64.diff
}
default_variants +gdal +pcre
if {![variant_isset lgpl]} {
default_variants-append +nonfree
}
cmake.out_of_source yes
cmake.install_prefix ${prefix}/lib/${subport}
# Mimic CMake's default FLAGS:
if {[variant_isset debug]} {
configure.optflags -O0
} else {
# optflags deliberately unset:
configure.optflags
# Set CMAKE_BUILD_TYPE=RelWithDebInfo to get reliable backtraces:
configure.args-delete -DCMAKE_BUILD_TYPE=Release
configure.args-append -DCMAKE_BUILD_TYPE=RelWithDebInfo
}
configure.cflags-append -fstrict-aliasing
configure.args-append -DDCW_ROOT=${prefix}/share/gmt/dcw \
-DCOPY_DCW=off \
-DGSHHG_ROOT=${prefix}/share/gmt/gshhg \
-DCOPY_GSHHG=off \
-DNETCDF_ROOT=${prefix} \
-DCURL_ROOT=${prefix} \
-DFFTW3_ROOT=off \
-DGDAL_ROOT=off \
-DPCRE_ROOT=off \
-DGMT_OPENMP=off \
-DGMT_INSTALL_MODULE_LINKS=off \
-DGMT_INSTALL_TRADITIONAL_FOLDERNAMES=off \
-DLICENSE_RESTRICTED=GPL
if {${subport} eq "gmt6"} {
configure.args-append -DGS_ROOT=${prefix}
}
post-destroot {
if {${subport} eq "gmt6"} {
foreach l {gmt postscriptlight} {
file delete ${destroot}${prefix}/lib/${subport}/bin/lib${l}.${version}.dylib
}
}
ln -s ${prefix}/lib/${subport}/bin/gmt ${destroot}${prefix}/bin/${subport}
}
variant fftw3 description {Optional support for FFTW-3 library} {
depends_lib-append port:fftw-3-single
configure.args-delete -DFFTW3_ROOT=off
configure.args-append -DFFTW3_ROOT=${prefix}
}
variant gdal description {GDAL import support} {
depends_lib-append port:gdal
configure.args-delete -DGDAL_ROOT=off
configure.args-append -DGDAL_ROOT=${prefix}
}
variant pcre description {PCRE regular expression support} {
depends_lib-append port:pcre
configure.args-delete -DPCRE_ROOT=off
configure.args-append -DPCRE_ROOT=${prefix}
}
variant openmp description {Enable experimental OpenMP parallel acceleration} {
configure.args-delete -DGMT_OPENMP=off
configure.args-append -DGMT_OPENMP=on
# FIXME: llvm-gcc42 is broken, https://trac.macports.org/ticket/40713
# Only clang really needs to be blacklisted
compiler.blacklist *gcc-4.2 *clang*
compiler.fallback macports-gcc-5 macports-gcc-4.9 macports-gcc-4.8 macports-gcc-4.7 macports-gcc-4.6 macports-gcc-4.5 macports-gcc-4.4 macports-gcc-4.3
# Needed for compiling with GCC and Accelerate Framework on OSX:
configure.cflags-append -flax-vector-conversions
}
variant lgpl conflicts nonfree description {disallow use of GPL code, license will be LGPL} {
license-delete GPL-3
license-append LGPL-3
configure.args-delete -DLICENSE_RESTRICTED=GPL
configure.args-append -DLICENSE_RESTRICTED=LGPL
}
variant nonfree conflicts lgpl description {enable nonfree code, libraries and binaries \
will not be redistributable} {
license-delete GPL-3
license-append Restrictive
configure.args-delete -DLICENSE_RESTRICTED=GPL
configure.args-append -DLICENSE_RESTRICTED=no
}
notes "
${subport} is installed in ${prefix}/lib/${subport}.
${prefix}/bin/${subport} is a symblic link to ${prefix}/lib/${subport}/bin/gmt.
"
# livecheck for the proper branch (5 or 6) and skipping any release candidates
set firstchar [string range ${version} 0 0]
livecheck.type regex
livecheck.url ${github.homepage}/releases/
livecheck.regex gmt-(${firstchar}\\.\[0-9]+\\.\[0-9]+)-src${extract.suffix}