# -*- 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
# $Id: Portfile 115672 2014-01-08 18:27:14Z macsforever2000@macports.org $

PortSystem          1.0
PortGroup           python 1.0
PortGroup           active_variants 1.1
PortGroup           github 1.0

github.setup        enthought mayavi 4.3.0

name                py-mayavi
categories-append   devel graphics math
maintainers         gmail.com: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  1bec3ad6cc2eea915c80a91e2c97e5fbd4d2641e \
                    sha256  d5e0e8f8fad87f0de80d38407362202d299e98e7ea2381b4449479a99a8aa679

python.versions     26 27

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:vtk5

    require_active_variants vtk5 python${python.version}
    
    post-patch {
        reinplace "s|sphinx-build|sphinx-build-${python.branch}|g" \
            ${worksrcpath}/docs/Makefile \
            ${worksrcpath}/docs/MakefileMayavi \
            ${worksrcpath}/docs/MakefileTVTK
    }

    notes \
        "Note that vtk5 must be installed using the same framework (cocoa\
OR x11/gtk) as that used for the GUI (wxwidgets/wxpython OR\
qt4/pyqt4)."
}
