# -*- coding: utf-8; mode: tcl; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; truncate-lines: t -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           python 1.0
PortGroup           bitbucket 1.0

bitbucket.setup     fenics-project dolfin 2019.1.0
revision            1
name                py-dolfin

categories-append   math science
license             LGPL-3+
platforms           darwin
maintainers         nomaintainer

description         Python interface to DOLFIN, a part of FEniCS
long_description    Python interface to DOLFIN, a library that functions as the main user interface of FEniCS

checksums           rmd160  ce75ed93b3f111364444e2e337add3408b81fa4c \
                    sha256  42b30031ea77089304b2d986212b4fab54b3dc216041bda4b7a946a9bd6e10a1 \
                    size    6542964

dist_subdir         dolfin

python.versions     310 311 312

if {${name} ne ${subport}} {
    depends_build-append \
        port:pkgconfig \
        port:pybind11 \
        port:py${python.version}-setuptools \
        path:bin/cmake:cmake

    depends_lib-append \
        port:dolfin \
        port:py${python.version}-numpy \
        port:py${python.version}-ffc \
        port:py${python.version}-ufl \
        port:py${python.version}-dijitso

    patchfiles    patch-python-setup.py.diff

    # extraction fails if worksrcdir is modified
    #worksrcdir     ${worksrcdir}/python
    configure.dir ${configure.dir}/python
    build.dir     ${build.dir}/python

    post-patch {
        reinplace "s|%PREFIX%|${prefix}|g" python/setup.py
    }
}
