# -*- 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           github 1.0
PortGroup           python 1.0

github.setup        miguelgrinberg python-engineio 4.12.3 v
github.tarball_from archive
name                py-engineio
revision            0

supported_archs     noarch
platforms           {darwin any}
license             MIT
maintainers         {judaew @judaew} openmaintainer

description         Python Engine.IO server and client
long_description    \
    Python implementation of the Engine.IO realtime client and server.

checksums           rmd160  52429e7f1b74c2867df7a938d6d04631cdd7acc0 \
                    sha256  eba05d9be79cbc03456c7223c208b1e2baeed0d5a7e19a79868ed692fb3bdffd \
                    size    320371

python.versions     39 310 311 312 313

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

    depends_run-append \
                    port:py${python.version}-aiohttp \
                    port:py${python.version}-requests \
                    port:py${python.version}-websocket-client

    post-build {
        system -W ${worksrcpath}/docs "make PYTHONPATH=${worksrcpath}/build/lib SPHINXBUILD=${prefix}/bin/sphinx-build-${python.branch} html man"
    }

    post-destroot {
        set doc_build_dir ${worksrcpath}/docs/_build
        file delete -force ${doc_build_dir}/html/.buildinfo \
            ${doc_build_dir}/html/_sources
        copy ${doc_build_dir}/html ${destroot}${prefix}/share/doc/${subport}
        copy ${doc_build_dir}/man ${destroot}${python.prefix}
    }
}
