# -*- 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.24.1
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  ca483cb52d9669bfeff50a3bf2ff4a3d7f534e73 \
                    sha256  01c910d5634c69a7efdec46e0a17d473d2328767f001d4dc0b5c4b48e585c8bd \
                    size    10741277

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.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 {
        patchfiles          patch-pyproject.toml.0.23.diff

        # 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

}
