summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorRobert Schütz <rschuetz17@gmail.com>2018-04-14 19:58:13 +0200
committerGitHub <noreply@github.com>2018-04-14 19:58:13 +0200
commit054f4f9c554b10812513ab502d559114ac6f51d2 (patch)
tree87256fa0990ad4f215cae50c75ea954957e3846c /pkgs
parent997ead8ad0f3bded53c71ada0ab2d0a8c86a4b4c (diff)
parentdff672ec7c3044928c838e973e4e82fe212f7e2c (diff)
downloadnixlib-054f4f9c554b10812513ab502d559114ac6f51d2.tar
nixlib-054f4f9c554b10812513ab502d559114ac6f51d2.tar.gz
nixlib-054f4f9c554b10812513ab502d559114ac6f51d2.tar.bz2
nixlib-054f4f9c554b10812513ab502d559114ac6f51d2.tar.lz
nixlib-054f4f9c554b10812513ab502d559114ac6f51d2.tar.xz
nixlib-054f4f9c554b10812513ab502d559114ac6f51d2.tar.zst
nixlib-054f4f9c554b10812513ab502d559114ac6f51d2.zip
Merge pull request #37595 from SFrijters/paraview-numpy
paraview: include numpy in python environment
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/graphics/paraview/default.nix24
1 files changed, 18 insertions, 6 deletions
diff --git a/pkgs/applications/graphics/paraview/default.nix b/pkgs/applications/graphics/paraview/default.nix
index 42b69e249267..e5385c752804 100644
--- a/pkgs/applications/graphics/paraview/default.nix
+++ b/pkgs/applications/graphics/paraview/default.nix
@@ -1,5 +1,5 @@
 {
-stdenv, fetchFromGitHub, cmake
+stdenv, fetchFromGitHub, cmake, makeWrapper
 ,qtbase, qttools, python, libGLU_combined
 ,libXt, qtx11extras, qtxmlpatterns
 }:
@@ -18,11 +18,11 @@ stdenv.mkDerivation rec {
     fetchSubmodules = true;
   };
 
-   cmakeFlags = [
-     "-DPARAVIEW_ENABLE_PYTHON=ON"
-     "-DPARAVIEW_INSTALL_DEVELOPMENT_FILES=ON"
-     "-DPARAVIEW_ENABLE_EMBEDDED_DOCUMENTATION=OFF"
-   ];
+  cmakeFlags = [
+    "-DPARAVIEW_ENABLE_PYTHON=ON"
+    "-DPARAVIEW_INSTALL_DEVELOPMENT_FILES=ON"
+    "-DPARAVIEW_ENABLE_EMBEDDED_DOCUMENTATION=OFF"
+  ];
 
   # During build, binaries are called that rely on freshly built
   # libraries.  These reside in build/lib, and are not found by
@@ -35,10 +35,12 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     cmake
+    makeWrapper
   ];
 
   buildInputs = [
     python
+    python.pkgs.numpy
     libGLU_combined
     libXt
     qtbase
@@ -47,6 +49,16 @@ stdenv.mkDerivation rec {
     qtxmlpatterns
   ];
 
+  # Paraview links into the Python library, resolving symbolic links on the way,
+  # so we need to put the correct sitePackages (with numpy) back on the path
+  postInstall = ''
+    wrapProgram $out/bin/paraview \
+      --set PYTHONPATH "${python.pkgs.numpy}/${python.sitePackages}"
+    wrapProgram $out/bin/pvbatch \
+      --set PYTHONPATH "${python.pkgs.numpy}/${python.sitePackages}"
+    wrapProgram $out/bin/pvpython \
+      --set PYTHONPATH "${python.pkgs.numpy}/${python.sitePackages}"
+  '';
 
   meta = {
     homepage = http://www.paraview.org/;