# -*- 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-importlib-resources
python.rootname     importlib_resources
version             4.1.1
revision            0

platforms           darwin
supported_archs     noarch
license             PSF
maintainers         {@rubendibattista gmail.com:rubendibattista} openmaintainer

description         A backport of Python standard library importlib.resources module for \
                    Python 2.7, and 3.4 through 3.8.
long_description    ${description}

homepage            https://importlib-resources.readthedocs.io

checksums           rmd160  5e04ac2b52358bb6c3706b67c65b5fef31aead9f \
                    sha256  6b45007a479c4ec21165ae3ffbe37faf35404e2041fac6ae1da684f38530ca73 \
                    size    30821

# keep version for PY27/PY34/PY35, these are (indirect) dependencies of py-virtualenv
python.versions     27 34 35 36 37 38

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

    if {${python.version} == 27} {
        version     3.3.1
        revision    0
        checksums   rmd160  6b0e6b482a5cb45430243e78317731efcf7eb84b \
                    sha256  0ed250dbd291947d1a298e89f39afcc477d5a6624770503034b72588601bcc05 \
                    size    29012

        depends_lib-append \
                    port:py${python.version}-contextlib2 \
                    port:py${python.version}-pathlib2 \
                    port:py${python.version}-singledispatch \
                    port:py${python.version}-typing
    } elseif {${python.version} == 34} {
        version     1.0.2
        epoch       1
        revision    0
        checksums   rmd160  ccbed771125ab62eda228842bc87339dd9aa21a8 \
                    sha256  d3279fd0f6f847cced9f7acc19bd3e5df54d34f93a2e7bb5f238f81545787078 \
                    size    23602
        depends_build-append \
                    port:py${python.version}-wheel
        depends_lib-append \
                    port:py${python.version}-pathlib2 \
                    port:py${python.version}-typing
    } elseif {${python.version} == 35} {
        version     3.2.1
        revision    0
        checksums   rmd160  5abb9e9bbae805089609dca64868d2ea7a8629fd \
                    sha256  a9fe213ab6452708ec1b3f4ec6f2881b8ab3645cb4e5efb7fea2bbf05a91db3b \
                    size    28884
    }

    if {${python.version} < 38} {
        depends_lib-append \
                    port:py${python.version}-zipp
    }

    test.run        yes
    test.cmd        ${python.bin} -m unittest discover
    test.target

    livecheck.type  none
}
