summary refs log tree commit diff
path: root/pkgs/applications/graphics/paraview/default.nix
blob: 13a00991265f43c6648389d580f6fda2dc90e2a6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{
stdenv, fetchFromGitHub, cmake, makeWrapper
,qtbase, qttools, python, libGLU_combined
,libXt, qtx11extras, qtxmlpatterns
}:

stdenv.mkDerivation rec {
  pname = "paraview";
  version = "5.6.0";

  # fetching from GitHub instead of taking an "official" source
  # tarball because of missing submodules there
  src = fetchFromGitHub {
    owner = "Kitware";
    repo = "ParaView";
    rev = "v${version}";
    sha256 = "1j13yfdgcv4yzfr449i4c8r4rs1c9zr6qd3igr4vv3ani8zixkzi";
    fetchSubmodules = true;
  };

  cmakeFlags = [
    "-DPARAVIEW_ENABLE_PYTHON=ON"
    "-DPARAVIEW_INSTALL_DEVELOPMENT_FILES=ON"
    "-DPARAVIEW_ENABLE_EMBEDDED_DOCUMENTATION=OFF"
    "-DOpenGL_GL_PREFERENCE=GLVND"
  ];

  # During build, binaries are called that rely on freshly built
  # libraries.  These reside in build/lib, and are not found by
  # default.
  preBuild = ''
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib:$PWD/VTK/ThirdParty/vtkm/vtk-m/lib
  '';

  enableParallelBuilding = true;

  nativeBuildInputs = [
    cmake
    makeWrapper
  ];

  buildInputs = [
    python
    python.pkgs.numpy
    libGLU_combined
    libXt
    qtbase
    qtx11extras
    qttools
    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/;
    description = "3D Data analysis and visualization application";
    license = stdenv.lib.licenses.free;
    maintainers = with stdenv.lib.maintainers; [guibert];
    platforms = with stdenv.lib.platforms; linux;
  };
}