Page MenuHomeFreeBSD

graphics/py-mayavi: Application and library for 3D visualization and plotting in Python

Authored by on Nov 16 2015, 1:34 PM.


Group Reviewers

A port of a new Mayavi application and libraries for scientific 3D visualization
with 4 depend ports.

All 5 ports are in Bugzilla: bug 204430 devel/py-envisage, bug 204431 devel/py-apptools,
bug 204432 devel/py-pyface, bug 204433 graphics/py-traitsui,
and bug 204435 graphics/py-mayavi.

The port devel/py-envisage in bug 204430 has been commited while this review was
under preparation. There is at least one minor change to it in this review.

Test Plan

Unswers to comments made in Bugzilla by Kubilay Kocak:

  • Using PyPI (CHEESESHOP) for distribution files is preferred unless desirable files are missing from the sdist (LICENSE, test suite, etc)

I did not manage to fetch the distro using CHEESESHOP, perhaps due to recent switch
to GitHub made by Enthought. I'm bit reluctant to go away from currently working
method. Are there big advantages of CHEESESHOP?

  • If a LICENSE file exists in WRKSRC, add LICENSE_FILE=${WRKSRC}/path/to/LICENSE

Done for graphics/py-mayavi, yet to be done for other ports.
A question. It turns out that within mayavi sources there are few more license file
for some internally used files (like colormap and icons). What to do in this case?
What to read on the subject?

  • I'm not confident that the declared dependencies are all BUILD_DEPENDENCIES. See:

You are right, only one port is nesessary for build.

  • GH_PROJECT defaults to PORTNAME, this entry is not needed

Removed from all 5 ports. I swear I tried to do this earlier and it did not work :)

  • Instead of a pre-configure check for the/a python vtk module, there should be a (slave) port for either vtk with the option enabled (vtkX-python) OR, a port for py-pyvtk ( if this is the module that is used. A pre-configure check assists port users who can rebuild vtk w/ PYTHON, but not package users.

Well, I do not want to maintain any of vtk ports, they are too complex to my taste...

  • Group USE{S_*} lines with USES at the top, and USE_* sorted

Done for all 5 ports.

Before submitting the ports to Bugzilla, I asked for help with 4 issues. I added
a link to that request in bug 204435 graphics/py-mayavi. I recieved no comment
till now, probably, google groups is not a good place to ask this kind of questions.
So, I repeat the request here.
For Issue 2, I have found that some ports use pkg info for this purposes.
The solution still needs some adaptaion to my case, so it's not included in this

Issue 1. Plist.

I cannot get plist working correctly.
If I use a static file, pkg-plist, then it fails either during my normal
installing or in poudrier. Seemingly, the installation distutils script
of the package detects difference of options of depend packages and installs or
skips some parts of html documentation.

So, it looks like I need an autoplist. I have in my port a line
USE_PYTHON= autoplist distutils
But with this the port also fails, and I think this indicates a bug in autoplist

How to fix it? Or how to debug this mechanics?

Issue 2. Depends on an option.

The port depends on math/vtk6 and needs it installed with option PYTHON
selected. I found in discussions that the only way is to inform the user about
the option and ask to re-install the dependence. I adapted the solution. But
later I learned that this method of checking a file for existence does not work
with changed WORKDIR and PREFIX (BUILDROOT in porttools).

Currently I have in Makefile:

        if [ ! -e ${PREFIX}/lib/python2.7/site-packages/vtk/ ]; then \
                ${ECHO_MSG} "math/vtk6 was installed without PYTHON option; "; \
                ${ECHO_MSG} "please reinstall with PYTHON selected"; \
                ${FALSE}; \

What can be a better way to check for an option?

Issue 3. portlint and BUILD_DEPENDS= ${MY_DEPENDS}.

Porter's Handbook recommends to use a variable if the same list of depends
is to be assigned to two *_DEPENDS. But portlint complains:
WARN: Makefile: wrong dependency value for RUN_DEPENDS. RUN_DEPENDS requires 2 or 3 colon-separated tuples.

Is it a bug in portlint or am I missing something?


If the port is installed and I start the script mayavi2, it fails:

$ mayavi2 
Warning: Unable to import the wx backend for pyface due to traceback: Traceback (most recent call last): 
          File "/usr/local/lib/python2.7/site-packages/pyface/", line 49, in _init_toolkit 
            be = import_toolkit(tk) 
          File "/usr/local/lib/python2.7/site-packages/pyface/", line 31, in import_toolkit 
            __import__(be + 'init') 
          File "/usr/local/lib/python2.7/site-packages/pyface/ui/wx/", line 14, in <module> 
            import wx 
          File "/usr/local/lib/python2.7/site-packages/wx-3.0-gtk2/wx/", line 45, in <module> 
            from wx._core import * 
          File "/usr/local/lib/python2.7/site-packages/wx-3.0-gtk2/wx/", line 4, in <module> 
            import _core_ 
        ImportError: /usr/lib/ version GLIBCXX_3.4.11 required by /usr/local/lib/ not found 

Traceback (most recent call last): 
  File "/usr/local/bin/mayavi2", line 9, in <module> 
    load_entry_point('mayavi==4.4.3', 'gui_scripts', 'mayavi2')() 
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/", line 552, in load_entry_point 
    return get_distribution(dist).load_entry_point(group, name) 
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/", line 2672, in load_entry_point 
    return ep.load() 
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/", line 2345, in load 
    return self.resolve() 
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/", line 2351, in resolve 
    module = __import__(self.module_name, fromlist=['__name__'], level=0) 
  File "/usr/local/lib/python2.7/site-packages/mayavi/scripts/", line 493, in <module> 
    raise ImportError(msg) 
ImportError: cannot import name scimath 
Could not load envisage. You might have a missing dependency. 
Do you have the EnvisageCore and EnvisagePlugins installed? 

If you installed Mayavi with easy_install, try 'easy_install <pkg_name>'. 
'easy_install Mayavi[app]' will also work. 

If you performed a source checkout and installed via 'python develop', 
be sure to run the same command in the EnvisageCore and EnvisagePlugins folders. 

If these packages appear to be installed, check that your numpy and 
configobj are installed and working. If you need numpy, 'easy_install numpy' 
will install numpy. Similarly, 'easy_install configobj' will install 

I have read a number of PRs with similar problems e.g. bug 196703, bug 192928,
bug 192821. Unfortunately, I cannot identify a port which is the source of the
problem. Any help will be greatly appreciated.

A work-around from one of the PRs helps. Start as follows:
$ LD_LIBRARY_PATH=/usr/local/lib/gcc48 mayavi2
The program emits warnings about some deprecated things but works alright.

Diff Detail

rP FreeBSD ports repository
Lint Skipped
Unit Tests Skipped

Event Timeline retitled this revision from to graphics/py-mayavi: Application and library for 3D visualization and plotting in Python. updated this object. edited the test plan for this revision. (Show Details)

I do not understand why all the files are empty. Is it related to the fact, that I use svn while 'arc diff --create' uses git in its commands:
diff --git a/graphics/py-traitsui/pkg-descr b/graphics/py-traitsui/pkg-descr

How to fix this?


For this block I have found a better way, suitable for build with non-default places for everything.

        @opt=`${PKG_QUERY} "%Ok %Ov" ${DEP1} | ${AWK} "/^PYTHON on/{print $$2}"`
        @if [ -z "@${opt}" ] ; then \
                ${ECHO_MSG} "Port math/vtk6 is installed without PYTHON option."; \
                ${ECHO_MSG} "Please reinstall with PYTHON selected."; \
                ${FALSE}; \
        else \
                ${ECHO_MSG} "Good, math/vtk6 is installed with PYTHON option!"; \

For all ports:

  • Update COMMENT to match (modified if necessary)
  • Add correct/appropriate LICENSE_FILE, LICENSE_COMB if necessary and license files exist
  • pkg-descr WWW: URL should match field

Rule of thumb:

  • Use the field for COMMENT, making changes to satisfy portlint/other conventions if or as necessary.

Currently, upstream has this as the description

description='application tools',

I would temporarily use:

COMMENT= Enthough application tools

And submit an upstream issue for them to modify the description= to something better/more descriptive (< 72 chars)


LICENSE.txt exists in WRKSRC, so add LICENSE_FILE

I can also see an image_LICENSE.txt file.

If multiple LICENSES are declared, use LICENSE_COMB (See Mk/ for details)


Not necessary, this is the default.




Put virtual categories (python) last


Depend on a 'version' not a 'port/package' version. If upstream doesn't declare any particular versions, depend on >0 (and get upstream to be clear about what it wants in the docs)


I'm not sure whether this is allowed/correct. We should ask someone from portmgr

koobs requested changes to this revision.EditedNov 22 2015, 4:26 AM
koobs edited edge metadata.


  • Globally distributed CDN
  • Confirms upstream is using good/correct packaging practices
  • No reason not to


  • LICENSE_COMB=multi, see Mk/


  • Still exists in current review changeset


  • Not suggesting you maintain it, I am suggesting a 'root cause' fix, rather than 'workarounds'.

Checking for presense (or not) of an OPTION is a known 'issue' and usually an indication that a package/port could benefit from refactoring/splitting

PLIST Issues

I think this is because you're using NO_BUILD, but i dont know why. Jump on IRC so we can isolate why autoplist/distutils is breaking


This is a false positive because portlint is reading the variable as a string, not parsing its contents/values (which are 2-tuples). Open an issue under ports-mgmt/portlint, hopefully Marcus (maintainer) can find a good way to solve it


We've seen this happen a lot of numpy/scipy dependent ports. It needs to be isolated and resolved after root cause is identified.

This revision now requires changes to proceed.Nov 22 2015, 4:26 AM edited edge metadata. removed rP FreeBSD ports repository as the repository for this revision.

Most of he issues are resolved in the new revision, with two exceptions.

  1. LICENSE work is made only in commented out lines. I think, without ready documentation it's too complex job for these ports. Or, a least, I need more guidance in this area.
  2. The dependence from a port with certain OPTION is reverted to what I had in the first revision. I'm still not ready to work on a new (sub)port of math/vtk6. On the other hand, the method I tried in my comment to graphycs/py-mayavi/Makefile (using pkg query) gives answer about packages installed on the system, but not in a jail of poudriere.

Please make your comments. Frankly speaking, I expect you will find find much more in addition to the above. if you could tick the inline items that have been done, leaving the undone items unticked, that would help me more quickly figure out whats changed between diffs. Thanks! added inline comments.

I'm not sure what you mean.


Reverted to previous review, since in poudriere this method gives OPTIONs from system packages, not from the jail. Perhaps, pkg query can be instructed where to look via environment variables, I don't know.


This particular port uses one license, 'Done' is about this port only.
Others do use more than one, despite docs say (quite vaguely) it's BSD licensed. Internally, other ports include icons, color maps and other similar files with different licenses. I collected the information in comments.

I'm not sure in correctness of the declarations made. Awaiting for additions by A.J. "Fonz" van Werven to Porter's Handbook, see topic 'License info Q' in ports maillist:

Review 10830 contains graphics/py-mayavi/files/patch-* files, forgotten in the previous review. These patches fix the problem with plist.

Change USES=python:2 to USES=python:-2.7

See bug 205239 for discussions. added inline comments.

About a week ago the default for PYTHON option of math/vtk6 has been changed to ON.

Update to the current state.
All license information is filled.
Corresponding PRs in bugzilla are updated, too.

Probably, better to say it explicitly:
I do not know about any issues with any of the five ports in this review. All five are ready to commit IMO.

Sorry, forgot to "svn add" the new ports after getting a new svn working copy (due to OS upgrade). marked 2 inline comments as done.

Everything has been committed.