python3Packages.mayavi: build for Python 3 instead of Python 2

- switch from wxPython to Qt5
This commit is contained in:
Ben Darwin 2020-04-13 13:50:19 -04:00
parent 2d8f346c7c
commit 9b83c440f6
2 changed files with 24 additions and 13 deletions

View File

@ -1,37 +1,45 @@
{ stdenv, fetchPypi, buildPythonPackage
, wxPython, pygments, numpy, vtk, traitsui, envisage, apptools
, nose, mock
, isPy3k
{ lib, buildPythonPackage, isPy27, fetchPypi, wrapQtAppsHook
, pyface, pygments, numpy, vtk, traitsui, envisage, apptools, pyqt5
}:
buildPythonPackage rec {
pname = "mayavi";
version = "4.7.1";
disabled = isPy27;
src = fetchPypi {
inherit pname version;
extension = "tar.bz2";
sha256 = "095p7mds6kqqrp7xqv24iygr3mw85rm7x41wb5y4yc3gi1pznldy";
};
# Discovery of 'vtk' in setuptools is not working properly, due to a missing
# .egg-info in the vtk package. It does however import and run just fine.
postPatch = ''
# Discovery of 'vtk' in setuptools is not working properly, due to a missing
# .egg-info in the vtk package. It does however import and run just fine.
substituteInPlace mayavi/__init__.py --replace "'vtk'" ""
# building the docs fails with the usual Qt xcb error, so skip:
substituteInPlace setup.py \
--replace "build.build.run(self)" "build.build.run(self); return"
'';
propagatedBuildInputs = [ wxPython pygments numpy vtk traitsui envisage apptools ];
nativeBuildInputs = [ wrapQtAppsHook ];
checkInputs = [ nose mock ];
disabled = isPy3k; # TODO: This would need pyqt5 instead of wxPython
propagatedBuildInputs = [
pyface pygments numpy vtk traitsui envisage apptools pyqt5
];
doCheck = false; # Needs X server
meta = with stdenv.lib; {
preFixup = ''
makeWrapperArgs+=("''${qtWrapperArgs[@]}")
'';
meta = with lib; {
description = "3D visualization of scientific data in Python";
homepage = "https://github.com/enthought/mayavi";
maintainers = with stdenv.lib.maintainers; [ knedlsepp ];
maintainers = with maintainers; [ knedlsepp ];
license = licenses.bsdOriginal;
};
}

View File

@ -4370,7 +4370,10 @@ in {
maya = callPackage ../development/python-modules/maya { };
mayavi = callPackage ../development/python-modules/mayavi { };
mayavi = pkgs.libsForQt5.callPackage ../development/python-modules/mayavi {
inherit buildPythonPackage isPy27 fetchPypi;
inherit (self) pyface pygments numpy vtk traitsui envisage apptools pyqt5;
};
mccabe = callPackage ../development/python-modules/mccabe { };