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

github.setup        numba numba 0.53.1
name                py-numba
revision            0
categories-append   devel
platforms           darwin
license             BSD

python.versions     27 35 36 37 38 39

maintainers         {stromnov @stromnov} openmaintainer

description         Numba is a NumPy aware dynamic compiler for Python.

long_description    Numba is an Open Source NumPy-aware optimizing compiler \
                    for Python. It uses the remarkable LLVM compiler \
                    infrastructure to compile Python syntax to machine code.

homepage            https://numba.pydata.org/

checksums           rmd160  4d9831de01e02a0bcf146f71a5c5ec0de52e49b9 \
                    sha256  3e1081eac904af3e59d4c41b0d64fd5f34d5cfb65ce7f9063cdb268e313ad0fc \
                    size    2241482

variant tbb description "Add support for TBB" {
    depends_lib-append  port:tbb
    build.env-append    TBBROOT=${prefix}
}

if {${name} ne ${subport}} {

    use_parallel_build  no

    if {${python.version} <= 35} {
        version             0.47.0
        revision            0
        distname            ${python.rootname}-${version}
        checksums           rmd160  316a2fef2accf2cb829bf2c008085ca77e52fe52 \
                            sha256  20818b20c74d763bb022d59201c9796d5812e0071abb3405a841ef1524553f48 \
                            size    2351240

        if {${python.version} < 33} {
            depends_lib-append  port:py${python.version}-funcsigs
        }

        if {${python.version} < 34} {
            depends_lib-append  port:py${python.version}-enum34 \
                                port:py${python.version}-singledispatch
        }
    }

    depends_build-append \
                        port:py${python.version}-setuptools

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

    livecheck.type      none
} else {
    livecheck.name      ${python.rootname}
    livecheck.url       https://pypi.org/pypi/${livecheck.name}/json
    livecheck.type      regex
    livecheck.regex     {"version":"([^"]+)"[,\}]}
}
