# -*- 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-socketio 5.14.3 v
github.tarball_from archive
name                py-socketio
revision            0

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

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

checksums           rmd160  59129210984e807bbd827ad444bfa97098be8c05 \
                    sha256  7ec6f0ccf7e065825b4e12d5f8f149c8d784499d3b5c4d7043e74aa70613ab02 \
                    size    199963

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}-bidict \
                    port:py${python.version}-engineio \
                    port:py${python.version}-requests \
                    port:py${python.version}-websocket-client \
                    port:py${python.version}-websockets

    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}
    }
}
