Packaging GMT

These recommendations are directed at package maintainers of GMT 5.

First split off DCW-GMT and GSHHG into separate architecture independent packages, e.g., gmt-dcw and gmt-gshhg, because they have a different development cycle. Files should go into directories /usr/share/gmt-dcw/ and /usr/share/gmt-gshhg/ or /usr/share/gmt/{dcw,gshhg}/. Then configure GMT 5 as shown in the table below. it is expected that the GMT supplements plugin be distributed with the core programs.

DCW-GMT

Homepage: http://www.soest.hawaii.edu/pwessel/dcw/index.html
Source: ftp://ftp.soest.hawaii.edu/dcw/dcw-gmt-x.x.x.tar.gz or
http://www.soest.hawaii.edu/pwessel/dcw/dcw-gmt-x.x.x.tar.gz
Description: Digital Chart of the World (DCW) for GMT
Long description: DCW-GMT is an enhancement to the original 1:1,000,000 scale vector basemap of the world available from the Princeton University Digital Map and Geospatial Information Center and from GeoCommunity at http://data.geocomm.com/readme/dcw/dcw.html. This data is for use by GMT, the Generic Mapping Tools.
License: LGPL-3+

GSHHG

Homepage: http://www.soest.hawaii.edu/pwessel/gshhg/index.html
Source: ftp://ftp.soest.hawaii.edu/gshhg/gshhg-gmt-x.x.x.tar.gz or
http://www.soest.hawaii.edu/pwessel/gshhg/gshhg-gmt-x.x.x.tar.gz
Description: Global Self-consistent Hierarchical High-resolution Geography (GSHHG)
Long description: GSHHG is a high-resolution shoreline data set amalgamated from two databases: Global Self-consistent Hierarchical High-resolution Shorelines (GSHHS) and CIA World Data Bank II (WDBII). GSHHG contains vector descriptions at five different resolutions of land outlines, lakes, rivers, and political boundaries. This data is for use by GMT, the Generic Mapping Tools.
License: LGPL-3+

GMT

Homepage: http://gmt.soest.hawaii.edu/
Source: ftp://ftp.soest.hawaii.edu/gmt/gmt-5.x.x-src.tar.xz or
ftp://ftp.soest.hawaii.edu/gmt/gmt-5.x.x-src.tar.gz
Build dependencies: cmake
Build+runtime dependencies: fftw3-single (optional)
gdal
gmt-dcw
gmt-gshhg (at least the crude resolution GSHHG files are mandatory)
libcurl
netcdf
pcre
zlib
Runtime dependencies: ghostscript
CMake arguments: -DCMAKE_BUILD_TYPE=RelWithDebInfo
-DCMAKE_C_FLAGS=-fstrict-aliasing
-DCMAKE_INSTALL_PREFIX=${prefix}
-DDCW_ROOT=${prefix}/share/gmt/dcw
-DGSHHG_ROOT=${prefix}/share/gmt/gshhg
-DNETCDF_ROOT=${prefix}
-DFFTW3_ROOT=${prefix}
-DGDAL_ROOT=${prefix}
-DPCRE_ROOT=${prefix}
-DGMT_INSTALL_MODULE_LINKS=off
-DGMT_INSTALL_TRADITIONAL_FOLDERNAMES=off
-DLICENSE_RESTRICTED=LGPL or -DLICENSE_RESTRICTED=no to include non-free code
Description: The Generic Mapping Tools
Long description: GMT is an open source collection of ~130 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.
License: GPL-3+, LGPL-3+, or Restrictive depending on LICENSE_RESTRICTED setting

Note that you have to configure and build out-of-source. It is safe to make a parallel build with make -j. Please configure with CMAKE_BUILD_TYPE=RelWithDebInfo (appends -O2 -g to CFLAGS) so that we get reliable backtraces from sighandler.

For reference, here is the link to the current MacPorts gmt5 Portfile: https://trac.macports.org/browser/trunk/dports/science/gmt5/Portfile