# -*- 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-lmfit
version             1.0.2
revision            0

categories-append   math
platforms           darwin
supported_archs     noarch
license             BSD
maintainers         {gmail.com:jjstickel @jjstickel} {reneeotten @reneeotten} openmaintainer

description         Least-Squares Minimization with Bounds and Constraints
long_description    Built on top of scipy.optimize, lmfit provides a\
                    Parameter object which can be set as fixed or free,\
                    can have upper and/or lower bounds, or can be written\
                    in terms of algebraic constraints of other Parameters.

homepage            https://lmfit.github.io/lmfit-py/

checksums           rmd160  334742450e6d41cd2602b104330e53d53fc1d76a \
                    sha256  67090ce56685cf7f92bd7358a1e7d4ad862b3758988109ec440e9825e5184b45 \
                    size    306039

python.versions     27 36 37 38 39

if {${subport} ne ${name}} {
    if {${python.version} eq 27} {
        version     0.9.15
        revision    0
        distname    lmfit-${version}
        checksums   rmd160  46947fd68ea4579c668b903f5dfd0b7c6bb9913e \
                    sha256  cd7bdf47c09a3d49f30dff9a1c7f778973d15d1e1b5dc642f14c22f6630eaf2f \
                    size    4248657
    }

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

    depends_lib-append \
                    port:py${python.version}-asteval \
                    port:py${python.version}-numpy \
                    port:py${python.version}-scipy \
                    port:py${python.version}-six \
                    port:py${python.version}-uncertainties

    depends_test-append \
                    port:py${python.version}-pytest

    test.run        yes
    test.cmd        py.test-${python.branch}
    test.target
    test.env        PYTHONPATH=${worksrcpath}/build/lib

    post-destroot {
       xinstall -d ${destroot}${prefix}/share/doc/${subport}
       xinstall -m 0644 -W ${worksrcpath} README.rst LICENSE THANKS.txt \
          ${destroot}${prefix}/share/doc/${subport}
       xinstall -m 0644 {*}[glob ${worksrcpath}/examples/*] \
          ${destroot}${prefix}/share/doc/${subport}/examples
       }

    livecheck.type  none
}
