blob: 888251cd71b46cf5aa64572050990d40757e4abe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
# $Id: PKGBUILD 76178 2012-09-12 16:35:27Z aginiewicz $
# Maintainer: Andrzej Giniewicz <gginiu@gmail.com>
pkgname=mayavi
pkgver=4.2.0
_githubtag=a1e562a
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' 'xorg-server-xvfb' 'twisted')
replaces=('python2-mayavi')
provides=('python2-mayavi')
options=(!emptydirs)
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}
# 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
# 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
# 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() {
cd "$srcdir"/enthought-mayavi-${_githubtag}
python2 setup.py install --root="$pkgdir"/ --optimize=1
cp -r docs/build/* "${pkgdir}"/usr/lib/python2.7/site-packages
sed -i -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \
$(find "${pkgdir}" -name '*.py')
sed -i -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \
"$pkgdir/usr/lib/python2.7/site-packages/mayavi/tests/csv_files/csv_2_py"
install -D LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
|