# -*- 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             4.10.0
revision            0
categories-append   devel
platforms           darwin
license             Apache-2
supported_archs     noarch

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

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  873c6a2cb40771bc8f38e6d46a08ca688c1dd3c2 \
                    sha256  92a8b58ce734b2a4494878e0ecf7d79ccd7a128b5fc6014c401e0b61f006f0f6 \
                    size    41896

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

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

    if {${python.version} in "27 35"} {
        version             2.1.0
        epoch               1
        revision            0
        checksums           rmd160  9495c1a8bb600b4aa7991788967b4b7339a947b9 \
                            sha256  caeee3603f5dcf567864d1be9b839b0bcfdf1383e3e7be33ce2dead8144ff19c \
                            size    30139
        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} in "35 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
        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
    }

    livecheck.type      none
}
