# -*- 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.0.2
checksums           rmd160  6a8b0d52a68589a6acf9d45dc4ac5b35aed30595 \
                    sha256  b398dd713b18de89730447347e96a0240225e154db56e35b6bb8447ffdb07798 \
                    size    281440
revision            0

python.versions     27 39 310 311 312 313

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
}
