# -*- 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           github 1.0
PortGroup           legacysupport 1.1

# _getline
legacysupport.newest_darwin_requires_legacy 10

github.setup        gmtsar gmtsar 6.1 v
revision            5
checksums           rmd160  38e267a7d12536d3d411d51d2d3ad9957b2a8987 \
                    sha256  b50bd3f01d2a53f68ece27e30e84f122b7239bb50028c4d0a8eaf450bd1c0ad2 \
                    size    1380815

categories          science
license             GPL-3
maintainers         {ucsd.edu:jdesanto @johndesanto} \
                    openmaintainer
description         An InSAR processing system based on GMT
long_description    GMTSAR is an open source InSAR processing system \
                    designed for users familiar with Generic Mapping Tools (GMT). \
                    It may be used at all stages of InSAR processing, from \
                    preprocessing raw data and orbit files, \
                    forming a complex interferogram, and post-processing \
                    interferograms to create products of phase, coherence, \
                    and line-of-sight displacement. \
                    By default, GMTSAR supports data from the ALOS-1, \
                    TerraSAR-X, COSMOS-SkyMed, Radarsat-2, Sentinel-1A/B, \
                    and ALOS-2 satellites. \
                    To enable support for data from the ERS-1/2 and Envisat \
                    satellites, append the +orbits flag during installation \
                    to fetch the required orbit solutions for these data.

homepage            https://topex.ucsd.edu/gmtsar/
github.tarball_from archive

depends_lib         port:gmt5 \
                    port:hdf5 \
                    port:tiff

use_autoconf        yes

use_parallel_build  no

configure.args-append \
                    --with-gmt-config=${prefix}/lib/gmt5/bin/gmt-config \
                    --with-orbits-dir=${prefix}/share/gmtsar-data/ORBITS

notes "
If you require (optional) support for ERS-1/2 and Envisat satellites, please download the\
ORITS data and copy it to ${prefix}/share/gmtsar-data.

For example using:
    mkdir -p gmtsar-data/ORBITS
    curl -L ftp://topex.ucsd.edu/pub/gmtsar/ORBITS.tar | tar xv --directory gmtsar-data/ORBITS
    sudo mv gmtsar-data ${prefix}/share/
"
