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

# Due to: https://github.com/fortran-lang/fpm/issues/850
# Re IEEE_arithmetic for Darwin PPC see: https://github.com/iains/darwin-toolchains-start-here/discussions/40
if {${os.platform} eq "darwin" && ${os.major} < 10 && (${configure.build_arch} in [list ppc ppc64])} {
    github.setup    jacobwilliams slsqp 1.3.1
    revision        0
    checksums       rmd160  acc9c9221b02c51ff6fb8095a30d3621e85303e8 \
                    sha256  546ef0caeb7bbdd66df3a8ace552843a5cc2d0afc28b1e424f97345cf5db3426 \
                    size    1108238
} else {
    github.setup    jacobwilliams slsqp 1.5.0
    revision        0
    checksums       rmd160  54d684745f90d374dc3bcfc29044c359eee9de7d \
                    sha256  59d1316f8a40236aa63c868ea23b54ee23ba95493b4ef10224f9cd557ed92578 \
                    size    1109778
    github.tarball_from archive
}
categories-append   math
license             BSD
maintainers         {@barracuda156 gmail.com:vital.had} openmaintainer
description         Modern Fortran Edition of the SLSQP optimizer
long_description    This is an updated version of the SLSQP nonlinear constrained optimization code. \
                    It can be used to solve nonlinear programming problems that seek to minimize \
                    a scalar performance index subject to nonlinear equality and inequality constraints \
                    as well as bounds on the variables.

post-destroot {
    set docdir ${prefix}/share/doc/${name}
    xinstall -d ${destroot}${docdir}
    xinstall -m 0644 -W ${worksrcpath} LICENSE README.md ${destroot}${docdir}
}

test.run            yes
