From ab5810a2e1afbbbb100358f2422f62025a901b66 Mon Sep 17 00:00:00 2001 From: Harrison Houghton Date: Thu, 5 Aug 2021 22:42:56 -0400 Subject: [PATCH 1/4] paraview: 5.8.0 -> 5.9.1 The new version supports python 3.9. The patch to avoid the string-format warning is no longer needed. --- pkgs/applications/graphics/paraview/default.nix | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/pkgs/applications/graphics/paraview/default.nix b/pkgs/applications/graphics/paraview/default.nix index 79feab3ab7ae..5e85d304e25f 100644 --- a/pkgs/applications/graphics/paraview/default.nix +++ b/pkgs/applications/graphics/paraview/default.nix @@ -4,28 +4,18 @@ mkDerivation rec { pname = "paraview"; - version = "5.8.0"; + version = "5.9.1"; src = fetchFromGitHub { owner = "Kitware"; 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} ''; From 89bcf569f610afc0f514bcd0c71ae61435a26de9 Mon Sep 17 00:00:00 2001 From: Harrison Houghton Date: Thu, 5 Aug 2021 22:43:47 -0400 Subject: [PATCH 2/4] paraview: use fetchFromGitLab The main repo is on GitLab; the GitHub repository is a mirror. --- pkgs/applications/graphics/paraview/default.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/graphics/paraview/default.nix b/pkgs/applications/graphics/paraview/default.nix index 5e85d304e25f..166e04149cc8 100644 --- a/pkgs/applications/graphics/paraview/default.nix +++ b/pkgs/applications/graphics/paraview/default.nix @@ -1,4 +1,4 @@ -{ boost, cmake, fetchFromGitHub, ffmpeg, qtbase, qtx11extras, +{ boost, cmake, fetchFromGitLab, ffmpeg, qtbase, qtx11extras, qttools, qtxmlpatterns, qtsvg, gdal, gfortran, libXt, makeWrapper, mkDerivation, ninja, mpi, python3, lib, tbb, libGLU, libGL }: @@ -6,9 +6,10 @@ mkDerivation rec { pname = "paraview"; version = "5.9.1"; - src = fetchFromGitHub { - owner = "Kitware"; - repo = "ParaView"; + src = fetchFromGitLab { + domain = "gitlab.kitware.com"; + owner = "paraview"; + repo = "paraview"; rev = "v${version}"; sha256 = "0pzic95br0vr785jnpxqmfxcljw3wk7bhm2xy0jfmwm1dh2b7xac"; fetchSubmodules = true; From b8611ee768c3d72f774e964b5f85a22018156bed Mon Sep 17 00:00:00 2001 From: Harrison Houghton Date: Sun, 8 Aug 2021 15:53:35 -0400 Subject: [PATCH 3/4] paraview: install doc files by default The "Getting Started"/"Tutorial"/"Guide" options on the splash screen and help menu don't work otherwise. --- .../graphics/paraview/default.nix | 44 ++++++++++++++++--- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/graphics/paraview/default.nix b/pkgs/applications/graphics/paraview/default.nix index 166e04149cc8..73cd39568f2b 100644 --- a/pkgs/applications/graphics/paraview/default.nix +++ b/pkgs/applications/graphics/paraview/default.nix @@ -1,10 +1,35 @@ -{ boost, cmake, fetchFromGitLab, 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 { - pname = "paraview"; +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"; + inherit version; src = fetchFromGitLab { domain = "gitlab.kitware.com"; @@ -68,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 ])) ]; @@ -79,4 +112,5 @@ mkDerivation rec { maintainers = with maintainers; [ guibert ]; platforms = platforms.linux; }; + } From 1e0f240b10b98b6587d668bf9fa8b6399ca27de5 Mon Sep 17 00:00:00 2001 From: Harrison Houghton Date: Sun, 8 Aug 2021 15:55:32 -0400 Subject: [PATCH 4/4] paraview: license is bsd3 See https://github.com/Kitware/ParaView/blob/master/Copyright.txt --- pkgs/applications/graphics/paraview/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/graphics/paraview/default.nix b/pkgs/applications/graphics/paraview/default.nix index 73cd39568f2b..64072b83654e 100644 --- a/pkgs/applications/graphics/paraview/default.nix +++ b/pkgs/applications/graphics/paraview/default.nix @@ -108,7 +108,7 @@ in 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; };