git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #133183 from hrhino/fix/paraview

paraview: 5.8.0 -> 5.9.1, install documentation, cleanup

commit8d8ad8aad1891bbb8714834c6b29f73dc057dbfc authorDavid Guibert <david.guibert@gmail.com> dateTue 10 Aug 2021, 09:30 (5 years ago) parent8c28f4f1e0f240
1 file changed+46−21
pkgs/applications/graphics/paraview/default.nix+46−21
pkgs/applications/graphics/paraview/default.nix+46−21
@@ -1,31 +1,47 @@
1−{ boost, cmake, fetchFromGitHub, ffmpeg, qtbase, qtx11extras,
2− qttools, qtxmlpatterns, qtsvg, gdal, gfortran, libXt, makeWrapper,
3− mkDerivation, ninja, mpi, python3, lib, tbb, libGLU, libGL }:
1+{ lib, stdenv, fetchFromGitLab, fetchurl
2+, boost, cmake, ffmpeg, qtbase, qtx11extras
3+, qttools, qtxmlpatterns, qtsvg, gdal, gfortran, libXt, makeWrapper
4+, mkDerivation, ninja, mpi, python3, tbb, libGLU, libGL
5+, withDocs ? true
6+}:
47
5−mkDerivation rec {
8+let
9+ version = "5.9.1";
10+ major = "5.9";
11+
12+ docFiles = [
13+ (fetchurl {
14+ url = "https://www.paraview.org/paraview-downloads/download.php?submit=Download&version=v${major}&type=data&os=Sources&downloadFile=ParaViewTutorial-${version}.pdf";
15+ name = "Tutorial.pdf";
16+ sha256 = "1knpirjbz3rv8p8n03p39vv8vi5imvxakjsssqgly09g0cnsikkw";
17+ })
18+ (fetchurl {
19+ url = "https://www.paraview.org/paraview-downloads/download.php?submit=Download&version=v${major}&type=data&os=Sources&downloadFile=ParaViewGettingStarted-${version}.pdf";
20+ name = "GettingStarted.pdf";
21+ sha256 = "14xhlvg7s7d5amqf4qfyamx2a6b66zf4cmlfm3s7iw3jq01x1lx6";
22+ })
23+ (fetchurl {
24+ url = "https://www.paraview.org/paraview-downloads/download.php?submit=Download&version=v${major}&type=data&os=Sources&downloadFile=ParaViewCatalystGuide-${version}.pdf";
25+ name = "CatalystGuide.pdf";
26+ sha256 = "133vcfrbg2nh15igl51ns6gnfn1is20vq6j0rg37wha697pmcr4a";
27+ })
28+ ];
29+
30+in mkDerivation rec {
631 pname = "paraview";
7− version = "5.8.0";
32+ inherit version;
833
9− src = fetchFromGitHub {
10− owner = "Kitware";
11− repo = "ParaView";
34+ src = fetchFromGitLab {
35+ domain = "gitlab.kitware.com";
36+ owner = "paraview";
37+ repo = "paraview";
1238 rev = "v${version}";
13− sha256 = "1mka6wwg9mbkqi3phs29mvxq6qbc44sspbm4awwamqhilh4grhrj";
39+ sha256 = "0pzic95br0vr785jnpxqmfxcljw3wk7bhm2xy0jfmwm1dh2b7xac";
1440 fetchSubmodules = true;
1541 };
1642
17− # Avoid error: format not a string literal and
18− # no format arguments [-Werror=format-security]
19− preConfigure = ''
20− substituteInPlace VTK/Common/Core/vtkLogger.h \
21− --replace 'vtkLogScopeF(verbosity_name, __func__)' 'vtkLogScopeF(verbosity_name, "%s", __func__)'
22−
23− substituteInPlace VTK/Common/Core/vtkLogger.h \
24− --replace 'vtkVLogScopeF(level, __func__)' 'vtkVLogScopeF(level, "%s", __func__)'
25− '';
26−
2743 # Find the Qt platform plugin "minimal"
28− patchPhase = ''
44+ preConfigure = ''
2945 export QT_PLUGIN_PATH=${qtbase.bin}/${qtbase.qtPluginPrefix}
3046 '';
3147
@@ -77,6 +93,14 @@ mkDerivation rec {
7793 qtsvg
7894 ];
7995
96+ postInstall = let docDir = "$out/share/paraview-${major}/doc"; in
97+ lib.optionalString withDocs ''
98+ mkdir -p ${docDir};
99+ for docFile in ${lib.concatStringsSep " " docFiles}; do
100+ cp $docFile ${docDir}/$(stripHash $docFile);
101+ done;
102+ '';
103+
80104 propagatedBuildInputs = [
81105 (python3.withPackages (ps: with ps; [ numpy matplotlib mpi4py ]))
82106 ];
@@ -84,8 +108,9 @@ mkDerivation rec {
84108 meta = with lib; {
85109 homepage = "https://www.paraview.org/";
86110 description = "3D Data analysis and visualization application";
87− license = licenses.free;
111+ license = licenses.bsd3;
88112 maintainers = with maintainers; [ guibert ];
89113 platforms = platforms.linux;
90114 };
115+
91116}