# -*- 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           select 1.0

name                py-cython
python.rootname     Cython
version             3.1.4
revision            0
categories-append   devel
license             Apache-2

python.versions     27 35 36 37 38 39 310 311 312 313 314

maintainers         {stromnov @stromnov} openmaintainer

description         A language for writing C extension modules for Python.

long_description    Cython is a language that makes writing C extensions for \
                    the Python language as easy as Python itself. Cython is  \
                    based on the well-known Pyrex, but supports more cutting \
                    edge functionality and optimizations

homepage            https://cython.org/

distname            cython-${version}

checksums           rmd160  612b9452716623cf945b5827958546ab0799f3c6 \
                    sha256  9aefefe831331e2d66ab31799814eae4d0f8a2d246cbaaaa14d1be29ef777683 \
                    size    3190778

if {${name} ne ${subport}} {
    depends_lib-append \
                        port:py${python.version}-setuptools

    # https://github.com/macports/macports-ports/commit/760996927a0a2b5c0d9871670155d64f840dff8e#commitcomment-74373855
    # https://trac.macports.org/ticket/67380
    compiler.blacklist-append *gcc-3.* *gcc-4.* {clang < 421}

    if {${python.version} < 39} {
        version             3.0.12
        revision            0
        distname            cython-${version}
        checksums           rmd160  6dedbcaf80887291bca81fb558d44e2cb74c7868 \
                            sha256  b988bb297ce76c671e28c97d017b95411010f7c77fa6623dd0bb47eed1aee1bc \
                            size    2757617
    }

    depends_run         port:cython_select
    test.run            no

    select.group        cython
    select.file         ${filespath}/cython${python.version}

    notes "
To make the Python ${python.branch} version of Cython the one that is run\
when you execute the commands without a version suffix, e.g. 'cython', run:

port select --set ${select.group} [file tail ${select.file}]
"

    livecheck.type      none
}
