# -*- 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           bitbucket 1.0
PortGroup           active_variants 1.1
PortGroup           boost 1.0

bitbucket.setup     fenics-project ffc 2019.1.0
revision            0
name                py-ffc

categories-append   math science
license             LGPL-3+
platforms           {darwin any}
supported_archs     noarch
maintainers         nomaintainer

description         FEniCS Form Compiler
long_description    FFC works as a compiler for multilinear forms by generating \
                    code (C or C++) for the evaluation of a multilinear form given \
                    in mathematical notation. This new approach to form evaluation \
                    makes it possible to combine generality with efficiency, the \
                    form can be given in mathematical notation and the generated \
                    code is as efficient as hand-optimized code.

checksums           rmd160  3900a200ec944141f8da450018395dfd0e4b209b \
                    sha256  3a8e32ae6b3efde5083d9b701aee777e67973966ca79b504797f0f80a5561dab \
                    size    1378468

python.versions     39 310 311 312
python.link_binaries_suffix

configure.cxxflags-append -std=c++11

if {${subport} ne ${name}} {
   depends_lib      port:py${python.version}-fiat \
                    port:py${python.version}-ufl \
                    port:py${python.version}-dijitso \
                    port:swig-python

    pre-build {
        build.env-append CXXFLAGS=${configure.cxxflags}
    }

    pre-destroot {
        destroot.env-append CXXFLAGS=${configure.cxxflags}
    }

    post-fetch {
        if {![active_variants [boost::depends_portname] openmpi ""] && \
            ![active_variants [boost::depends_portname] mpich   ""]} {
            return -code error "${subport} needs [boost::depends_portname] installed with an mpi variant"
        }
    }
}
