about summary refs log tree commit diff
path: root/pkgs/applications/graphics
diff options
context:
space:
mode:
authorDavid Guibert <david.guibert@gmail.com>2021-08-10 09:30:37 +0200
committerGitHub <noreply@github.com>2021-08-10 09:30:37 +0200
commit8d8ad8aad1891bbb8714834c6b29f73dc057dbfc (patch)
tree5d75bf9f325e1d1476c3614fca964f5a897f3567 /pkgs/applications/graphics
parent8c28f4fed10183e68f2e0445ef4e1f60a2ead196 (diff)
parent1e0f240b10b98b6587d668bf9fa8b6399ca27de5 (diff)
Merge pull request #133183 from hrhino/fix/paraview
paraview: 5.8.0 -> 5.9.1, install documentation, cleanup
Diffstat (limited to 'pkgs/applications/graphics')
-rw-r--r--pkgs/applications/graphics/paraview/default.nix67
1 files changed, 46 insertions, 21 deletions
diff --git a/pkgs/applications/graphics/paraview/default.nix b/pkgs/applications/graphics/paraview/default.nix
index 79feab3ab7aed..64072b83654e9 100644
--- a/pkgs/applications/graphics/paraview/default.nix
+++ b/pkgs/applications/graphics/paraview/default.nix
@@ -1,31 +1,47 @@
-{ boost, cmake, fetchFromGitHub, ffmpeg, qtbase, qtx11extras,
-  qttools, qtxmlpatterns, qtsvg, gdal, gfortran, libXt, makeWrapper,
-  mkDerivation, ninja, mpi, python3, lib, tbb, libGLU, libGL }:
+{ lib, stdenv, fetchFromGitLab, fetchurl
+, boost, cmake, ffmpeg, qtbase, qtx11extras
+, qttools, qtxmlpatterns, qtsvg, gdal, gfortran, libXt, makeWrapper
+, mkDerivation, ninja, mpi, python3, tbb, libGLU, libGL
+, withDocs ? true
+}:
 
-mkDerivation rec {
+let
+  version = "5.9.1";
+  major = "5.9";
+
+  docFiles = [
+    (fetchurl {
+      url = "https://www.paraview.org/paraview-downloads/download.php?submit=Download&version=v${major}&type=data&os=Sources&downloadFile=ParaViewTutorial-${version}.pdf";
+      name = "Tutorial.pdf";
+      sha256 = "1knpirjbz3rv8p8n03p39vv8vi5imvxakjsssqgly09g0cnsikkw";
+    })
+    (fetchurl {
+      url = "https://www.paraview.org/paraview-downloads/download.php?submit=Download&version=v${major}&type=data&os=Sources&downloadFile=ParaViewGettingStarted-${version}.pdf";
+      name = "GettingStarted.pdf";
+      sha256 = "14xhlvg7s7d5amqf4qfyamx2a6b66zf4cmlfm3s7iw3jq01x1lx6";
+    })
+    (fetchurl {
+      url = "https://www.paraview.org/paraview-downloads/download.php?submit=Download&version=v${major}&type=data&os=Sources&downloadFile=ParaViewCatalystGuide-${version}.pdf";
+      name = "CatalystGuide.pdf";
+      sha256 = "133vcfrbg2nh15igl51ns6gnfn1is20vq6j0rg37wha697pmcr4a";
+    })
+  ];
+
+in mkDerivation rec {
   pname = "paraview";
-  version = "5.8.0";
+  inherit version;
 
-  src = fetchFromGitHub {
-    owner = "Kitware";
-    repo = "ParaView";
+  src = fetchFromGitLab {
+    domain = "gitlab.kitware.com";
+    owner = "paraview";
+    repo = "paraview";
     rev = "v${version}";
-    sha256 = "1mka6wwg9mbkqi3phs29mvxq6qbc44sspbm4awwamqhilh4grhrj";
+    sha256 = "0pzic95br0vr785jnpxqmfxcljw3wk7bhm2xy0jfmwm1dh2b7xac";
     fetchSubmodules = true;
   };
 
-  # Avoid error: format not a string literal and
-  # no format arguments [-Werror=format-security]
-  preConfigure = ''
-    substituteInPlace VTK/Common/Core/vtkLogger.h \
-      --replace 'vtkLogScopeF(verbosity_name, __func__)' 'vtkLogScopeF(verbosity_name, "%s", __func__)'
-
-    substituteInPlace VTK/Common/Core/vtkLogger.h \
-      --replace 'vtkVLogScopeF(level, __func__)' 'vtkVLogScopeF(level, "%s", __func__)'
-  '';
-
   # Find the Qt platform plugin "minimal"
-  patchPhase = ''
+  preConfigure = ''
     export QT_PLUGIN_PATH=${qtbase.bin}/${qtbase.qtPluginPrefix}
   '';
 
@@ -77,6 +93,14 @@ mkDerivation rec {
     qtsvg
   ];
 
+  postInstall = let docDir = "$out/share/paraview-${major}/doc"; in
+    lib.optionalString withDocs ''
+      mkdir -p ${docDir};
+      for docFile in ${lib.concatStringsSep " " docFiles}; do
+        cp $docFile ${docDir}/$(stripHash $docFile);
+      done;
+    '';
+
   propagatedBuildInputs = [
     (python3.withPackages (ps: with ps; [ numpy matplotlib mpi4py ]))
   ];
@@ -84,8 +108,9 @@ mkDerivation rec {
   meta = with lib; {
     homepage = "https://www.paraview.org/";
     description = "3D Data analysis and visualization application";
-    license = licenses.free;
+    license = licenses.bsd3;
     maintainers = with maintainers; [ guibert ];
     platforms = platforms.linux;
   };
+
 }