2022-01-13 20:06:32 +00:00
|
|
|
{ lib
|
|
|
|
, apptools
|
|
|
|
, buildPythonPackage
|
|
|
|
, envisage
|
|
|
|
, fetchPypi
|
2023-11-16 04:20:00 +00:00
|
|
|
, fetchpatch
|
2022-01-13 20:06:32 +00:00
|
|
|
, numpy
|
2023-01-11 07:51:40 +00:00
|
|
|
, packaging
|
2022-01-13 20:06:32 +00:00
|
|
|
, pyface
|
|
|
|
, pygments
|
|
|
|
, pyqt5
|
|
|
|
, pythonOlder
|
2023-11-16 04:20:00 +00:00
|
|
|
, pythonAtLeast
|
2022-01-13 20:06:32 +00:00
|
|
|
, traitsui
|
|
|
|
, vtk
|
|
|
|
, wrapQtAppsHook
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "mayavi";
|
2023-01-11 07:51:40 +00:00
|
|
|
version = "4.8.1";
|
2022-01-13 20:06:32 +00:00
|
|
|
format = "setuptools";
|
2023-11-16 04:20:00 +00:00
|
|
|
disabled = pythonOlder "3.8" || pythonAtLeast "3.11";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-n0J+8spska542S02ibpr7KJMhGDicG2KHJuEKJrT/Z4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
patches = [
|
|
|
|
# Adds compatibility with Python 3.11.
|
|
|
|
# https://github.com/enthought/mayavi/pull/1199
|
|
|
|
(fetchpatch {
|
|
|
|
name = "python311-compat.patch";
|
|
|
|
url = "https://github.com/enthought/mayavi/commit/50c0cbfcf97560be69c84b7c924635a558ebf92f.patch";
|
|
|
|
hash = "sha256-zZOT6on/f5cEjnDBrNGog/wPQh7rBkaFqrxkBYDUQu0=";
|
|
|
|
includes = [ "tvtk/src/*" ];
|
|
|
|
})
|
|
|
|
# Fixes an incompatible function pointer conversion error
|
|
|
|
# https://github.com/enthought/mayavi/pull/1266
|
|
|
|
(fetchpatch {
|
|
|
|
name = "incompatible-pointer-conversion.patch";
|
|
|
|
url = "https://github.com/enthought/mayavi/commit/887adc8fe2b076a368070f5b1d564745b03b1964.patch";
|
|
|
|
hash = "sha256-88H1NNotd4pO0Zw1oLrYk5WNuuVrmTU01HJgsTRfKlo=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postPatch = ''
|
|
|
|
# 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"
|
|
|
|
'';
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
wrapQtAppsHook
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2022-01-13 20:06:32 +00:00
|
|
|
apptools
|
|
|
|
envisage
|
|
|
|
numpy
|
2023-01-11 07:51:40 +00:00
|
|
|
packaging
|
2022-01-13 20:06:32 +00:00
|
|
|
pyface
|
|
|
|
pygments
|
|
|
|
pyqt5
|
|
|
|
traitsui
|
|
|
|
vtk
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-Wno-error";
|
2023-01-11 07:51:40 +00:00
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
# Needs X server
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"mayavi"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
makeWrapperArgs+=("''${qtWrapperArgs[@]}")
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "3D visualization of scientific data in Python";
|
|
|
|
homepage = "https://github.com/enthought/mayavi";
|
|
|
|
license = licenses.bsdOriginal;
|
2022-01-13 20:06:32 +00:00
|
|
|
maintainers = with maintainers; [ knedlsepp ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|