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

name                py-kiwisolver
version             1.4.5
revision            0

categories-append   math
license             BSD
maintainers         {reneeotten @reneeotten} openmaintainer

description         Kiwi is an efficient C++ implementation of the Cassowary constraint solving algorithm.
long_description    Kiwi is an implementation of the algorithm based on the\
                    seminal Cassowary paper. It is not a refactoring of the\
                    original C++ solver. Kiwi has been designed from the ground\
                    up to be lightweight and fast. Kiwi ranges from 10x to 500x\
                    faster than the original Cassowary solver with typical use\
                    cases gaining a 40x improvement. Memory savings are\
                    consistently > 5x.

checksums           rmd160  fb9979a0d3daa633390ff2b12d5e17c1b0a3a8b6 \
                    sha256  e57e563a57fb22a142da34f38acc2fc1a5c864bc29ca1517a88abc963e60d6ec \
                    size    97552

homepage            https://github.com/nucleic/kiwi

python.versions     27 35 36 37 38 39 310 311 312

if {${name} ne ${subport}} {
    if {${python.version} in "27 35"} {
        version     1.1.0
        revision    0
        checksums   rmd160  c048a5a4c5c843b4b6dd9a3a7aff361e6f5969be \
                    sha256  53eaed412477c836e1b9522c19858a8557d6e595077830146182225613b11a75 \
                    size    30847

        depends_build-append \
                    port:py${python.version}-setuptools
    } else {
        compiler.cxx_standard   2011

        depends_build-append \
                    port:py${python.version}-cppy \
                    port:py${python.version}-setuptools_scm
    }

    if {${python.version} == 36} {
        version     1.3.1
        epoch       1
        revision    0
        checksums   rmd160  d00de5025110ab800de3ca4ad45671c49cfcca0f \
                    sha256  950a199911a8d94683a6b10321f9345d5a3a8433ec58b217ace979e18f16e248 \
                    size    53103
    }

    post-destroot {
        set docdir ${prefix}/share/doc/${subport}
        xinstall -d ${destroot}${docdir}
        xinstall -m 0644 -W ${worksrcpath} README.rst ${destroot}${docdir}
        if {${python.version} > 36} {
            xinstall -m 0644 -W ${worksrcpath} LICENSE ${destroot}${docdir}
        }
    }

    test.run        yes

    livecheck.type  none
}
