# -*- 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.1.2
revision            0
python.versions     310 311 312 313 314
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  1db5c2910eff20f0dbb6894a04e0dff9d89182b6 \
                    sha256  2ed4ecb28320a433db18a5bf029986aa8afcfd740745e78847e330d5d94922a9 \
                    size    315489

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

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

    # 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
    }
}
