# -*- 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-shapely
version             2.0.6
revision            0
python.versions     39 310 311 312 313
categories-append   devel
maintainers         {snc @nerdling} openmaintainer
license             BSD
homepage            https://shapely.readthedocs.io/en/stable/
description         Shapely is a Python package for manipulation \
                    and analysis of 2D geospatial geometries

long_description \
                    Shapely is a Python package for manipulation and \
                    analysis of 2D geospatial geometries. It is based on \
                    GEOS (http://geos.refractions.net). Shapely 1.0 is not \
                    concerned with data formats or coordinate reference \
                    systems.

checksums           rmd160  0d3607c93f5410b8491c6680148c89f2ce156580 \
                    sha256  997f6159b1484059ec239cacaa53467fd8b5564dabe186cd84ac2944663b0bf6 \
                    size    282361

if {${name} ne ${subport}} {
    depends_lib-append      port:geos \
                            port:py${python.version}-numpy
    depends_build-append    port:py${python.version}-cython

    # pycore_frame.h:134: error: ‘for’ loop initial declaration used outside C99 mode
    # Since it depends on py-numpy, which requires modern gcc, avoid Xcode one here.
    compiler.blacklist-append \
                            *gcc-4.0 *gcc-4.2

    # https://github.com/shapely/shapely/issues/2161
    if {[string match *gcc* ${configure.compiler}]} {
        patchfiles-append   patch-setup.py.diff
    }
}
