From 1b99470a0c85186f768a328fcc11a7cfcc85be51 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 14 Sep 2012 00:04:07 +0000 Subject: Fri Sep 14 00:04:06 UTC 2012 --- community/mayavi/PKGBUILD | 49 ++++++++++++++++++++---- community/mayavi/vtk-5.10.patch | 83 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 124 insertions(+), 8 deletions(-) create mode 100644 community/mayavi/vtk-5.10.patch (limited to 'community/mayavi') diff --git a/community/mayavi/PKGBUILD b/community/mayavi/PKGBUILD index 4e9fcafc9..888251cd7 100644 --- a/community/mayavi/PKGBUILD +++ b/community/mayavi/PKGBUILD @@ -1,31 +1,64 @@ -# $Id: PKGBUILD 75627 2012-08-27 16:59:37Z aginiewicz $ +# $Id: PKGBUILD 76178 2012-09-12 16:35:27Z aginiewicz $ # Maintainer: Andrzej Giniewicz pkgname=mayavi pkgver=4.2.0 _githubtag=a1e562a -pkgrel=2 +pkgrel=4 pkgdesc="A 3-dimensional visualizer of scientific data" arch=('i686' 'x86_64') url="http://code.enthought.com/projects/mayavi/" license=('BSD') depends=('ipython2' 'vtk' 'python2-envisage' 'wxpython') -makedepends=('python2-distribute' 'python2-sphinx') +makedepends=('python2-distribute' 'python2-sphinx' 'xorg-server-xvfb' 'twisted') replaces=('python2-mayavi') provides=('python2-mayavi') options=(!emptydirs) -source=("$pkgname-$pkgver.tar.gz::https://github.com/enthought/mayavi/tarball/${pkgver}") -md5sums=('b46fb048176002738de64eed8d2b447a') +source=("$pkgname-$pkgver.tar.gz::https://github.com/enthought/mayavi/tarball/${pkgver}" + vtk-5.10.patch) +md5sums=('b46fb048176002738de64eed8d2b447a' + '01b8375392b5d3f587e81ba388a8089f') build() { cd "$srcdir"/enthought-mayavi-${_githubtag} - python2 setup.py build + # Add compatibility for vtk 5.10 (FS#31498) + patch -p1 < ../vtk-5.10.patch + + # Use python2-sphinx provided sphinx-build2 + sed -i -e 's/sphinx-build/sphinx-build2/' docs/Makefile* + + # Fix distutils compatibility + sed -i -e 's/distutils.Version/distutils.version/' mayavi/modules/text.py + sed -i -e 's/distutils.Version/distutils.version/' tvtk/tools/mlab.py - cd docs + # set path so autodoc can find just built modules + echo "sys.path.append('$srcdir/enthought-mayavi-${_githubtag}/build/lib.linux-$CARCH-2.7/')" >> docs/source/mayavi/conf.py + mkdir -p build/lib.linux-$CARCH-2.7/{tvtk/plugins/scene,mayavi/preferences,mayavi/core} + ln -s "$srcdir"/enthought-mayavi-${_githubtag}/tvtk/tvtk_classes.zip \ + build/lib.linux-$CARCH-2.7/tvtk/tvtk_classes.zip + ln -s "$srcdir"/enthought-mayavi-${_githubtag}/mayavi/preferences/preferences.ini \ + build/lib.linux-$CARCH-2.7/mayavi/preferences/preferences.ini + ln -s "$srcdir"/enthought-mayavi-${_githubtag}/tvtk/plugins/scene/preferences.ini \ + build/lib.linux-$CARCH-2.7/tvtk/plugins/scene/preferences.ini + ln -s "$srcdir"/enthought-mayavi-${_githubtag}/mayavi/core/lut \ + build/lib.linux-$CARCH-2.7/mayavi/core/lut + + # now this is ugly, but docs do not build without X. We setup X according to: + # http://docs.enthought.com/mayavi/mayavi/tips.html#rendering-using-the-virtual-framebuffer + export DISPLAY=:69 + Xvfb $DISPLAY & + + # build! + python2 setup.py build - make SPHINXBUILD=sphinx-build2 html + # have to kill the server to proceed, and do other cleanup + kill `cat /tmp/.X${DISPLAY/:/}-lock` + rm build/lib.linux-$CARCH-2.7/tvtk/tvtk_classes.zip + rm build/lib.linux-$CARCH-2.7/mayavi/preferences/preferences.ini + rm build/lib.linux-$CARCH-2.7/tvtk/plugins/scene/preferences.ini + rm build/lib.linux-$CARCH-2.7/mayavi/core/lut } package() { diff --git a/community/mayavi/vtk-5.10.patch b/community/mayavi/vtk-5.10.patch new file mode 100644 index 000000000..34fbbcf34 --- /dev/null +++ b/community/mayavi/vtk-5.10.patch @@ -0,0 +1,83 @@ +From e61d4afa02072b48a332c7250b293704f57c6b2a Mon Sep 17 00:00:00 2001 +From: "mluessi@nmr.mgh.harvard.edu" +Date: Mon, 9 Jul 2012 17:48:20 -0400 +Subject: [PATCH 01/13] FIX: version comp. for VTK 5.10 + +--- + mayavi/modules/text.py | 8 +++++--- + tvtk/tools/mlab.py | 5 +++-- + 2 files changed, 8 insertions(+), 5 deletions(-) + +diff --git a/mayavi/modules/text.py b/mayavi/modules/text.py +index 1fcc0e0..d1c79c0 100644 +--- a/mayavi/modules/text.py ++++ b/mayavi/modules/text.py +@@ -5,6 +5,8 @@ + # Copyright (c) 2005, Enthought, Inc. + # License: BSD Style. + ++from distutils.Version import StrictVersion ++ + # Enthought library imports. + from traits.api import Instance, Range, Str, Bool, Property, \ + Float +@@ -16,7 +18,7 @@ from apptools.persistence import state_pickler + from mayavi.core.module import Module + from mayavi.core.pipeline_info import PipelineInfo + +-VTK_VER = float(tvtk.Version().vtk_version[:3]) ++VTK_VER = StrictVersion(tvtk.Version().vtk_version) + + + ###################################################################### +@@ -68,7 +70,7 @@ class Text(Module): + ######################################## + # The view of this object. + +- if VTK_VER > 5.1: ++ if VTK_VER > '5.1': + _text_actor_group = Group(Item(name='visibility'), + Item(name='text_scale_mode'), + Item(name='alignment_point'), +@@ -152,7 +154,7 @@ class Text(Module): + set the `actors` attribute up at this point. + """ + actor = self.actor = tvtk.TextActor(input=str(self.text)) +- if VTK_VER > 5.1: ++ if VTK_VER > '5.1': + actor.set(text_scale_mode='prop', width=0.4, height=1.0) + else: + actor.set(scaled_text=True, width=0.4, height=1.0) +diff --git a/tvtk/tools/mlab.py b/tvtk/tools/mlab.py +index 8262da0..dfe9230 100644 +--- a/tvtk/tools/mlab.py ++++ b/tvtk/tools/mlab.py +@@ -92,6 +92,7 @@ functions:: + # Copyright (c) 2005-2007, Enthought, Inc. + # License: BSD Style. + ++from distutils.Version import StrictVersion + + import numpy + +@@ -107,7 +108,7 @@ from tvtk.tools import ivtk + # Set this to False to not use LOD Actors. + USE_LOD_ACTOR = True + +-VTK_VER = float(tvtk.Version().vtk_version[:3]) ++VTK_VER = StrictVersion(tvtk.Version().vtk_version) + + ###################################################################### + # Utility functions. +@@ -639,7 +640,7 @@ class Title(MLabBase): + super(Title, self).__init__(**traits) + + ta = self.text_actor +- if VTK_VER > 5.1: ++ if VTK_VER > '5.1': + ta.set(text_scale_mode='prop', height=0.05, input=self.text) + else: + ta.set(scaled_text=True, height=0.05, input=self.text) +-- +1.7.12 + -- cgit v1.2.3-54-g00ecf