# -*- 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-jaraco.functools
version             3.2.1
revision            0

platforms           darwin
supported_archs     noarch
license             MIT
maintainers         {khindenburg @kurthindenburg} openmaintainer

description         Additional functools in the spirit of stdlib's functools.
long_description    ${description}

homepage            https://pypi.python.org/pypi/${python.rootname}/
master_sites        pypi:[string index ${python.rootname} 0]/${python.rootname}
distname            ${python.rootname}-${version}

checksums           rmd160  ed294274e78a6e849e4526a5c31cf052a2fdaee2 \
                    sha256  97cf88b46ab544c266e2d81fa17bb183622268722a7dd1a3711ea426e9c26f94 \
                    size    16888

python.versions     27 35 36 37 38 39

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

    depends_lib-append \
                    port:py${python.version}-more-itertools

    if {${python.version} eq 27} {
        depends_lib-append \
                    port:py${python.version}-backports-functools_lru_cache

        test.run            no
    }
    if {${python.version} < 36} {
        version             2.0
        revision            1

        # Below distname is required for this to work
        distname            ${python.rootname}-${version}

        checksums           rmd160  a345fd401aafd4774c84acf5dfe79a90f3b42409 \
                            sha256  35ba944f52b1a7beee8843a5aa6752d1d5b79893eeb7770ea98be6b637bf9345 \
                            size    14340
    }
    if {${python.version} > 35} {

        # Missing jaraco.classes so there are a few failures
        depends_test-append \
                    port:py${python.version}-pytest \
                    port:py${python.version}-pytest-cov

        test.run        yes
        test.cmd        py.test-${python.branch}
        test.target
        test.env        PYTHONPATH=${worksrcpath}/build/lib
    }

    livecheck.type  none
}
