biome: 1.9.2 -> 1.9.3 (#349335)
[NixPkgs.git] / pkgs / applications / graphics / paraview / default.nix
blob4ff64094af804c15941198d8c0e1644596f561df
2   lib,
3   stdenv,
4   fetchFromGitLab,
5   fetchurl,
6   boost,
7   cmake,
8   ffmpeg,
9   wrapQtAppsHook,
10   qtbase,
11   qtx11extras,
12   qttools,
13   qtxmlpatterns,
14   qtsvg,
15   gdal,
16   gfortran,
17   libXt,
18   makeWrapper,
19   ninja,
20   mpi,
21   python3,
22   tbb,
23   libGLU,
24   libGL,
25   withDocs ? true,
28 let
29   version = "5.13.0";
31   docFiles = [
32     (fetchurl {
33       url = "https://www.paraview.org/paraview-downloads/download.php?submit=Download&version=v${lib.versions.majorMinor version}&type=data&os=Sources&downloadFile=ParaViewTutorial-${version}.pdf";
34       name = "Tutorial.pdf";
35       hash = "sha256-hoCa/aTy2mmsPHP3Zm0hLZlZKbtUMpjUlc2rFKKChco=";
36     })
37     (fetchurl {
38       url = "https://www.paraview.org/paraview-downloads/download.php?submit=Download&version=v${lib.versions.majorMinor version}&type=data&os=Sources&downloadFile=ParaViewGettingStarted-${version}.pdf";
39       name = "GettingStarted.pdf";
40       hash = "sha256-ptPQA8By8Hj0qI5WRtw3ZhklelXeYeJwVaUdfd6msJM=";
41     })
42     (fetchurl {
43       url = "https://www.paraview.org/paraview-downloads/download.php?submit=Download&version=v${lib.versions.majorMinor version}&type=data&os=Sources&downloadFile=ParaViewCatalystGuide-${version}.pdf";
44       name = "CatalystGuide.pdf";
45       hash = "sha256-t1lJ1Wiswhdxovt2O4sXTXfFxshDiZZVdnkXt/+BQn8=";
46     })
47   ];
50 stdenv.mkDerivation rec {
51   pname = "paraview";
52   inherit version;
54   src = fetchFromGitLab {
55     domain = "gitlab.kitware.com";
56     owner = "paraview";
57     repo = "paraview";
58     rev = "v${version}";
59     hash = "sha256-JRSuvBON2n0UnbrFia4Qmf6eYb1Mc+Z7dIcXSeUhpIc=";
60     fetchSubmodules = true;
61   };
63   # Find the Qt platform plugin "minimal"
64   preConfigure = ''
65     export QT_PLUGIN_PATH=${qtbase.bin}/${qtbase.qtPluginPrefix}
66   '';
68   cmakeFlags = [
69     "-DPARAVIEW_ENABLE_FFMPEG=ON"
70     "-DPARAVIEW_ENABLE_GDAL=ON"
71     "-DPARAVIEW_ENABLE_MOTIONFX=ON"
72     "-DPARAVIEW_ENABLE_VISITBRIDGE=ON"
73     "-DPARAVIEW_ENABLE_XDMF3=ON"
74     "-DPARAVIEW_INSTALL_DEVELOPMENT_FILES=ON"
75     "-DPARAVIEW_USE_MPI=ON"
76     "-DPARAVIEW_USE_PYTHON=ON"
77     "-DVTK_SMP_IMPLEMENTATION_TYPE=TBB"
78     "-DVTKm_ENABLE_MPI=ON"
79     "-DCMAKE_INSTALL_LIBDIR=lib"
80     "-DCMAKE_INSTALL_INCLUDEDIR=include"
81     "-DCMAKE_INSTALL_BINDIR=bin"
82     "-DOpenGL_GL_PREFERENCE=GLVND"
83     "-GNinja"
84   ];
86   nativeBuildInputs = [
87     cmake
88     makeWrapper
89     ninja
90     gfortran
91     wrapQtAppsHook
92   ];
94   buildInputs = [
95     libGLU
96     libGL
97     libXt
98     mpi
99     tbb
100     boost
101     ffmpeg
102     gdal
103     qtbase
104     qtx11extras
105     qttools
106     qtxmlpatterns
107     qtsvg
108   ];
110   postInstall =
111     let
112       docDir = "$out/share/paraview-${lib.versions.majorMinor version}/doc";
113     in
114     lib.optionalString withDocs ''
115       mkdir -p ${docDir};
116       for docFile in ${lib.concatStringsSep " " docFiles}; do
117         cp $docFile ${docDir}/$(stripHash $docFile);
118       done;
119     '';
121   propagatedBuildInputs = [
122     (python3.withPackages (
123       ps: with ps; [
124         numpy
125         matplotlib
126         mpi4py
127       ]
128     ))
129   ];
131   meta = {
132     homepage = "https://www.paraview.org";
133     description = "3D Data analysis and visualization application";
134     license = lib.licenses.bsd3;
135     maintainers = with lib.maintainers; [ guibert ];
136     changelog = "https://www.kitware.com/paraview-${lib.concatStringsSep "-" (lib.versions.splitVersion version)}-release-notes";
137     platforms = lib.platforms.linux;
138   };