# -*- 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           compiler_wrapper 1.0

name                py-msgpack

# Note that borgbackup has an in-code check that starts failing when msgpack is
# updated to a version it does not allowlist yet. We have removed this check
# downstream, but to avoid breaking our users' backups, please run `sudo port
# test borgbackup` with an updated msgpack before committing. Thanks!
version             1.1.2
revision            0

categories-append   devel
license             Apache-2
maintainers         nomaintainer

description         MessagePack (de)serializer for Python.
long_description    {*}${description}

homepage            https://msgpack.org/

checksums           rmd160  b7666a5100336df6e9b714986d78826ffb12f9e9 \
                    sha256  3b60763c1373dd60f398488069bcdc703cd08a711477b5d480eecc9f9626f47e \
                    size    173581

python.versions     27 310 311 312 313 314

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

    # https://trac.macports.org/ticket/69537
    if {${configure.build_arch} in [list i386 ppc]} {
        patchfiles-append \
                        patch-32-bit.diff
    }

    if {${python.version} == 27} {
        version             1.0.5
        revision            1
        checksums           rmd160  44d092ee572b7cb3ac8555e2224a412a61f2e08e \
                            sha256  c075544284eadc5cddc70f4757331d99dcbc16b2bbd4849d15f8aae4cf36d31c \
                            size    127834

        platforms           {darwin any}
        supported_archs     noarch

        depends_build-delete \
                            port:py${python.version}-cython

        depends_build-append \
                            port:py${python.version}-setuptools
    } else {
        # make sure that the files are cythonized
        post-extract {
            file delete ${worksrcpath}/msgpack/_cmsgpack.cpp
        }
    }

    # https://trac.macports.org/ticket/71250
    if {${python.version} >= 312} {
        compiler.blacklist-append \
                        *gcc-4.0 *gcc-4.2
    }

    livecheck.type      none
}
