# -*- 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-metadata
python.rootname     importlib_metadata
version             5.0.0
revision            0
categories-append   devel
license             Apache-2
supported_archs     noarch
platforms           {darwin any}

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

maintainers         {stromnov @stromnov} openmaintainer

description         Library to access the metadata for a Python package.
long_description    {*}${description}

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

checksums           rmd160  ccab7a9534ec3cf5dd33df380e487015cca1f998 \
                    sha256  da31db32b304314d044d3c12c79bd59e307889b287ad12ff387b3500835fc2ab \
                    size    48756

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

    depends_lib-append  port:py${python.version}-zipp

    if {${python.version} in "27 35"} {
        version             2.1.3
        epoch               1
        revision            0
        checksums           md5 10bf15d611e8d61d6f7b3aa112196fca \
                            rmd160 d06849e3ef8a1ddf6359bd266a30562ba92e29f6 \
                            sha256 02a9f62b02e9b1cc43871809ef99947e8f5d94771392d666ada2cafc4cd09d4f \
                            size   30408
        if {${python.version} eq 27} {
            depends_lib-append  port:py${python.version}-contextlib2 \
                                port:py${python.version}-configparser \
                                port:py${python.version}-pathlib2
        }
    } elseif {${python.version} eq 34} {
        version             1.0.0
        epoch               1
        revision            0
        checksums           rmd160  d85c4afae2456a17c35bfc008641499918c2cd84 \
                            sha256  a82ca8c109e194d7d6aee3f7531b0470dd4dd6b36ec14fd55087142a96bd55a7 \
                            size    28194
        depends_lib-append  port:py${python.version}-pathlib2
    } elseif {${python.version} eq "36"} {
        version             4.8.3
        epoch               1
        revision            0
        checksums           rmd160  f5952a964e77c80896fa03f66de0ace77b5a5935 \
                            sha256  766abffff765960fcc18003801f7044eb6755ffae4521c8e8ce8e83b9c9b0668 \
                            size    41979
    }

    if {${python.version} in "36 37"} {
        depends_lib-append \
                        port:py${python.version}-typing_extensions
    }

    if {${python.version} >= 36} {
        python.pep517   yes
        # break circular dependency with python-install and setuptools_scm
        python.add_dependencies no
        depends_build-append   port:py-bootstrap-modules
        depends_lib-append     port:python${python.version}
        build.env-append    PYTHONPATH=${prefix}/share/py-bootstrap-modules
        build.args      --skip-dependency-check
        destroot.env-append PYTHONPATH=${prefix}/share/py-bootstrap-modules
    } else {
        depends_build-append \
                        port:py${python.version}-setuptools_scm
    }

    livecheck.type      none
}
