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

# If you update this port, also update the port poetry to the latest
# compatible with this port. py-poetry-core is closely coupled to poetry,
# both in terms of APIs but also the version pinning.
name                py-poetry-core
version             1.6.1
revision            0

distname            poetry_core-${version}

checksums           rmd160  1d3c7bfed575e4fb9424dc78b2f1c4524141aeb5 \
                    sha256  0f9b0de39665f36d6594657e7d57b6f463cc10f30c28e6d1c3b9ff54c26c9ac3 \
                    size    443618

categories-append   devel
supported_archs     noarch
platforms           {darwin any}
license             MIT
maintainers         {gmail.com:davidgilman1 @dgilman} openmaintainer

homepage            https://github.com/python-poetry/poetry-core
description         A PEP 517 build backend implementation developed for Poetry.
long_description    ${description} This project is intended to be a light \
                    weight, fully compliant, self-contained package allowing PEP 517 \
                    compatible build frontends to build Poetry managed projects.

python.versions     37 38 39 310 311
python.pep517       yes
# Bootstraps itself, no backend dependencies needed
python.pep517_backend

if {${name} ne ${subport}} {
    if {${python.version} < 38} {
        depends_lib-append  port:py${python.version}-importlib-metadata
    }

    post-destroot {
        set docdir ${prefix}/share/doc/${subport}
        xinstall -m 0644 -W ${worksrcpath} README.md LICENSE \
            ${destroot}${docdir}

        # These files are installed both by this port and by the poetry port
        delete \
            ${destroot}${python.pkgd}/poetry/__init__.py \
            ${destroot}${python.pkgd}/poetry/__pycache__
    }
}
