# -*- 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           python 1.0

name                py-cartopy
version             0.25.0
revision            0

categories-append   science gis graphics
license             LGPL-3
maintainers         {petr @petrrr} openmaintainer

description         A cartographic python library with matplotlib support
long_description    Cartopy is a Python package designed for geospatial data \
                    processing in order to produce maps and other geospatial \
                    data analyses.\
                    Cartopy makes use of the powerful PROJ, NumPy and Shapely \
                    libraries and includes a programmatic interface built on top \
                    of Matplotlib for the creation of publication quality maps.

homepage            https://scitools.org.uk/cartopy/docs/latest

checksums           rmd160  e189667a8cbdf3f52a3a65353651e6ce6952855c \
                    sha256  55f1a390e5f3f075b221c7d91fb10258ad978db786c7930eba06eb45d28753fe \
                    size    10767728

python.versions     39 310 311 312 313

if {${name} ne ${subport}} {
    if {${python.version} < 310} {
        version     0.21.1
        revision    0

        checksums   rmd160  80066676fe504980d639b5b0bfe5cb5cfdc97d25 \
                    sha256  89d5649712c8582231c6e11825a04c85f6f0cee94dbb89e4db23eabca1cc250a \
                    size    10917080

        patchfiles  patch-pyproject.toml.0.21.1.diff

        distname    Cartopy-${version}

        # Adding documentation
        post-destroot {
            set dest_doc ${destroot}${prefix}/share/doc/${subport}
            xinstall -d ${dest_doc}
            xinstall -m 0644 -W ${worksrcpath} README.md INSTALL \
                CHANGES COPYING COPYING.LESSER ${dest_doc}
        }
   } else {

        # Adding documentation
        post-destroot {
            set dest_doc ${destroot}${prefix}/share/doc/${subport}
            xinstall -d ${dest_doc}
            xinstall -m 0644 -W ${worksrcpath} README.md INSTALL \
                CHANGES LICENSE ${dest_doc}
        }
    }

    depends_build-append    port:py${python.version}-setuptools \
                            port:py${python.version}-setuptools_scm \
                            port:py${python.version}-setuptools_scm_git_archive \
                            port:py${python.version}-numpy \
                            port:py${python.version}-wheel \
                            path:bin/cython-${python.branch}:py${python.version}-cython

    # default
    depends_lib-append      port:py${python.version}-numpy \
                            port:py${python.version}-matplotlib \
                            port:py${python.version}-packaging \
                            port:py${python.version}-pyproj \
                            port:py${python.version}-pyshp \
                            port:py${python.version}-shapely

    # optional (but keep port simple): plotting, ows, srtm
    depends_lib-append      \
                            port:py${python.version}-Pillow \
                            port:py${python.version}-scipy \
                            port:py${python.version}-owslib \
                            port:py${python.version}-beautifulsoup4

}
