# -*- 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-prompt_toolkit
version             3.0.51
revision            1

license             BSD
platforms           {darwin any}
supported_archs     noarch
maintainers         nomaintainer
description         Library for building powerful interactive command lines in Python
long_description    {*}${description}

python.versions     39 310 311 312 313

homepage            https://github.com/prompt-toolkit/python-prompt-toolkit

checksums           rmd160  11647715062e9aedbdaa985e8366052b181b5242 \
                    sha256  931a162e3b27fc90c86f1b48bb1fb2c528c2761475e57c9c06de13311c7b54ed \
                    size    428940

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

    patchfiles      patch-importlib-metadata.diff

    post-patch {
        reinplace -W ${worksrcpath} "s|@@MP_VERSION@@|${version}|g" \
            src/prompt_toolkit/__init__.py
    }

    test.run        yes

    post-destroot {
        set docdir ${prefix}/share/doc/${subport}
        xinstall -d ${destroot}${docdir}
        xinstall -m 0644 -W ${worksrcpath} LICENSE AUTHORS.rst \
            README.rst CHANGELOG ${destroot}${docdir}
        copy ${worksrcpath}/examples ${destroot}${docdir}/examples
    }
}
