# -*- 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           legacysupport 1.1

name                py-zmq
python.rootname     pyzmq

version             27.1.0
checksums           rmd160  233bd5e165be9fd8c451cc3c78ee48cc1ecc7360 \
                    sha256  ac0765e3d44455adb6ddbf4417dcce460fc40a05978c08efdf2948072f6db540 \
                    size    281750
revision            0

python.versions     27 310 311 312 313 314

maintainers         {gmail.com:jrjsmrtn @jrjsmrtn} {michaelld @michaelld} openmaintainer

categories-append   devel net
license             LGPL

description         Python bindings for 0MQ
long_description    PyZMQ is a lightweight and super-fast messaging library \
                    built on top of the ZeroMQ library.

homepage            https://github.com/zeromq/pyzmq

if {${name} ne ${subport}} {

    depends_lib-append path:lib/libzmq.dylib:zmq

    if {${python.version} == 27} {
        # PyZMQ 20.0.0 dropped support for Python < 3.5 (all versions
        # of Python < 3.6 are EOL at time of release). Since this port
        # was already upgraded to 20.0.0, bump the epoch and cap the
        # Py27 version at 19.X. https://trac.macports.org/ticket/61708
        epoch               1
        version             19.0.2
        checksums           rmd160 008be479b08313768a8cba8b20a2d813101be4a0 \
                            sha256 296540a065c8c21b26d63e3cea2d1d57902373b16e4256afe46422691903a438 \
                            size   1156195
        revision            0

        post-patch {
            set setup_cfg ${worksrcpath}/setup.cfg
            file delete ${setup_cfg}
            file copy ${worksrcpath}/setup.cfg.template ${setup_cfg}
            reinplace "s|/usr/local|${prefix}|g" ${setup_cfg}
        }
    } else {
        depends_build-append \
                            port:py${python.version}-scikit-build-core \
                            port:py${python.version}-cython

        depends_lib-append  port:py${python.version}-packaging \
                            port:py${python.version}-cffi
    }

    livecheck.type  none
}
