1{ lib
2, apptools
3, buildPythonPackage
4, envisage
5, fetchPypi
6, numpy
7, pyface
8, pygments
9, pyqt5
10, pythonOlder
11, traitsui
12, vtk
13, wrapQtAppsHook
14}:
15
16buildPythonPackage rec {
17 pname = "mayavi";
18 version = "4.8.0";
19 format = "setuptools";
20
21 disabled = pythonOlder "3.8";
22
23 src = fetchPypi {
24 inherit pname version;
25 sha256 = "sha256-TGBDYdn1+juBvhjVvxTzBlCw7jju1buhbMikQ5QXj2M=";
26 };
27
28 postPatch = ''
29 # Discovery of 'vtk' in setuptools is not working properly, due to a missing
30 # .egg-info in the vtk package. It does however import and run just fine.
31 substituteInPlace mayavi/__init__.py --replace "'vtk'" ""
32
33 # building the docs fails with the usual Qt xcb error, so skip:
34 substituteInPlace setup.py \
35 --replace "build.build.run(self)" "build.build.run(self); return"
36 '';
37
38 nativeBuildInputs = [
39 wrapQtAppsHook
40 ];
41
42 propagatedBuildInputs = [
43 apptools
44 envisage
45 numpy
46 pyface
47 pygments
48 pyqt5
49 traitsui
50 vtk
51 ];
52
53 # Needs X server
54 doCheck = false;
55
56 pythonImportsCheck = [
57 "mayavi"
58 ];
59
60 preFixup = ''
61 makeWrapperArgs+=("''${qtWrapperArgs[@]}")
62 '';
63
64 meta = with lib; {
65 description = "3D visualization of scientific data in Python";
66 homepage = "https://github.com/enthought/mayavi";
67 license = licenses.bsdOriginal;
68 maintainers = with maintainers; [ knedlsepp ];
69 };
70}