# -*- 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.8
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  3f949ccdc69095a1f7edea55a2f2c2bb108fe98f \
                    sha256  23d5f023bdc8c7e54eb65f03ca5d5bb25b601eac4d7f1a042888a1f45237987e \
                    size    97538

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

python.versions     27 39 310 311 312 313

if {${name} ne ${subport}} {
    if {${python.version} == 27} {
        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
    }

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

    test.run        yes
}
