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

github.setup        enthought mayavi 4.7.1

name                py-mayavi
categories-append   devel graphics math
maintainers         {gmail.com:jjstickel @jjstickel} openmaintainer
description         The Enthought mayavi package
long_description    3D Scientific Data Visualization and Plotting using VTK as the \
    rendering backend and wxpython or pyqt4 for the (G)UI.

license             BSD
platforms           darwin

checksums           rmd160  a78fee221fa1243096101cf088dc26dd14567d5f \
                    sha256  5dff720e2d3342697d2f6b22621a9a7cf4a34134aceb9bf22446eea2257e4789 \
                    size    9066423

python.versions     35 36 37 38

if {${name} ne ${subport}} {
    depends_build-append    port:py${python.version}-setuptools \
                            port:py${python.version}-sphinx
    depends_lib-append      port:py${python.version}-apptools \
                            port:py${python.version}-envisage \
                            port:py${python.version}-numpy \
                            port:py${python.version}-traitsui \
                            port:vtk

    require_active_variants vtk python${python.version}
    
    post-patch {
        # https://github.com/enthought/mayavi/issues/652
        reinplace "/vtk/d" ${worksrcpath}/mayavi/__init__.py
        
        reinplace "s|sphinx-build|sphinx-build-${python.branch}|g" \
            ${worksrcpath}/docs/Makefile \
            ${worksrcpath}/docs/MakefileMayavi \
            ${worksrcpath}/docs/MakefileTVTK
    }
}
