Merge pull request #208522 from bgamari/wip/vtk-egg-info
vtk: Generate egg-info
This commit is contained in:
commit
4cf45a9fea
|
@ -2,7 +2,7 @@
|
|||
{ stdenv, lib, fetchurl, cmake, libGLU, libGL, libX11, xorgproto, libXt, libpng, libtiff
|
||||
, fetchpatch
|
||||
, enableQt ? false, qtbase, qtx11extras, qttools, qtdeclarative, qtEnv
|
||||
, enablePython ? false, pythonInterpreter ? throw "vtk: Python support requested, but no python interpreter was given."
|
||||
, enablePython ? false, python ? throw "vtk: Python support requested, but no python interpreter was given."
|
||||
# Darwin support
|
||||
, Cocoa, CoreServices, DiskArbitration, IOKit, CFNetwork, Security, GLUT, OpenGL
|
||||
, ApplicationServices, CoreText, IOSurface, ImageIO, xpc, libobjc
|
||||
|
@ -11,7 +11,7 @@
|
|||
let
|
||||
inherit (lib) optionalString optionals optional;
|
||||
|
||||
pythonMajor = lib.substring 0 1 pythonInterpreter.pythonVersion;
|
||||
pythonMajor = lib.substring 0 1 python.pythonVersion;
|
||||
|
||||
in stdenv.mkDerivation rec {
|
||||
pname = "vtk${optionalString enableQt "-qvtk"}";
|
||||
|
@ -47,7 +47,7 @@ in stdenv.mkDerivation rec {
|
|||
OpenGL
|
||||
GLUT
|
||||
] ++ optionals enablePython [
|
||||
pythonInterpreter
|
||||
python
|
||||
];
|
||||
propagatedBuildInputs = optionals stdenv.isDarwin [ libobjc ]
|
||||
++ optionals stdenv.isLinux [ libX11 libGL ];
|
||||
|
@ -89,6 +89,13 @@ in stdenv.mkDerivation rec {
|
|||
sed -i 's/fprintf(output, shift)/fprintf(output, "%s", shift)/g' ./ThirdParty/libxml2/vtklibxml2/xpath.c
|
||||
'';
|
||||
|
||||
postInstall = optionalString enablePython ''
|
||||
substitute \
|
||||
${./vtk.egg-info} \
|
||||
$out/lib/python${python.pythonVersion}/site-packages/vtk-${version}.egg-info \
|
||||
--subst-var-by VTK_VER "${version}"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Open source libraries for 3D computer graphics, image processing and visualization";
|
||||
homepage = "https://www.vtk.org/";
|
||||
|
|
4
pkgs/development/libraries/vtk/vtk.egg-info
Normal file
4
pkgs/development/libraries/vtk/vtk.egg-info
Normal file
|
@ -0,0 +1,4 @@
|
|||
Metadata-Version: 2.1
|
||||
Version: @VTK_VER@
|
||||
Summary: VTK is an open-source toolkit for 3D computer graphics, image processing, and visualization
|
||||
Platform: UNKNOWN
|
|
@ -27,10 +27,6 @@ buildPythonPackage rec {
|
|||
};
|
||||
|
||||
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"
|
||||
|
|
|
@ -11909,7 +11909,7 @@ self: super: with self; {
|
|||
vt-py = callPackage ../development/python-modules/vt-py { };
|
||||
|
||||
vtk = toPythonModule (pkgs.vtk_9.override {
|
||||
pythonInterpreter = python;
|
||||
inherit python;
|
||||
enablePython = true;
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue