# -*- 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.4.3
revision            0
categories-append   gis
license             BSD

python.versions     39 310 311 312 313

maintainers         {stromnov @stromnov} openmaintainer

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

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

checksums           rmd160  4bdeb32a8b07867227a1405bcbbdd6910f777146 \
                    sha256  201f05dbc7c4739dacb2c78a1cf4e09c0b7265b0a4d16ccbd1753ce4f2af350a \
                    size    442990

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}-click-plugins \
                        port:py${python.version}-parsing

    if {${python.version} < 310} {
        depends_lib-append  port:py${python.version}-importlib-metadata
    }

    patchfiles-append   patch-numpy_version.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
}
