# -*- 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.1
PortGroup           legacysupport 1.1

# NOTE: When updating this port, check whether the dylib name and/or version
# changes. If so, all dependents will need to be rev-bumped.

name                geos
version             3.14.1
revision            0
categories          science math gis
license             LGPL-2.1

maintainers         {stromnov @stromnov} openmaintainer

description         GEOS Geometry Engine - Open Source

long_description    A C++ port of the Java Topology Suite, providing OpenGIS \
                    Simple Features for SQL spatial predicate functions \
                    and spatial operators, as well as specific JTS topology \
                    functions.

homepage            https://libgeos.org
master_sites        https://download.osgeo.org/geos/

use_bzip2           yes

checksums           rmd160  3cb6514e8e5c32e0477c037114b46fe9ba2e8fd3 \
                    sha256  3c20919cda9a505db07b5216baa980bacdaa0702da715b43f176fb07eff7e716 \
                    size    7013834

compiler.cxx_standard 2017

# Avoid compilation errors observed for Xcode 4.6.3 (clang 425) on 10.7
# and linking errors observed for Xcode 5.1.1 (clang 503) on 10.8.
# See https://github.com/macports/macports-ports/pull/6159
# Also avoid compilation errors observed for Xcode 6, 7, and 8.
compiler.blacklist-append {clang < 900}

legacysupport.newest_darwin_requires_legacy \
                    19

use_parallel_build  yes

post-destroot {
    set docdir ${prefix}/share/doc/${name}
    xinstall -d ${destroot}${docdir}
    xinstall -m 644 -W ${worksrcpath} AUTHORS COPYING NEWS.md \
        ${destroot}${docdir}
}

test.run            yes
test.cmd            make
test.target         check

livecheck.regex     {geos-(\d+(?:\.\d+)*)\.[tz]}
