# -*- 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
PortGroup           compiler_wrapper 1.0

name                py-rasterio
version             1.5.0
revision            1
categories-append   gis
license             BSD

python.versions     310 311 312 313 314

maintainers         {stromnov @stromnov} openmaintainer

description         Rasterio reads and writes geospatial raster data.
long_description    {*}${description}

homepage            https://github.com/rasterio/rasterio

checksums           rmd160  a6ae8741412b44d65831337ef619ac490f48d358 \
                    sha256  1e0ea56b02eea4989b36edf8e58a5a3ef40e1b7edcb04def2603accd5ab3ee7b \
                    size    452184

if {${name} ne ${subport}} {
    depends_build-append \
                        path:bin/cython-${python.branch}:py${python.version}-cython

    depends_lib-append  port:py${python.version}-numpy \
                        port:gdal

    depends_run-append  port:py${python.version}-affine \
                        port:py${python.version}-attrs \
                        port:py${python.version}-certifi \
                        port:py${python.version}-click \
                        port:py${python.version}-cligj \
                        port:py${python.version}-parsing

    patchfiles-append   patch-pyproject.toml.diff

    if {${python.version} <= 311} {
        version             1.4.3
        revision            4
        checksums           rmd160  4bdeb32a8b07867227a1405bcbbdd6910f777146 \
                            sha256  201f05dbc7c4739dacb2c78a1cf4e09c0b7265b0a4d16ccbd1753ce4f2af350a \
                            size    442990
        depends_run-append  port:py${python.version}-click-plugins
        patchfiles-replace  patch-pyproject.toml.diff patch-pyproject.toml.1.4.3.diff

        # cc1plus: error: unrecognized command line option "-stdlib=libc++"
        if {${configure.cxx_stdlib} ne "libc++"} {
            patchfiles-append   patch-fix-setup.py.diff
        }
    }

    # pycore_frame.h: error: ‘for’ loop initial declaration used outside C99 mode
    # cc1plus: error: unrecognized command line option "-std=c++11"
    compiler.c_standard     1999
    compiler.cxx_standard   2011

    livecheck.type  none
}
