nixpkgs/pkgs/applications/graphics/paraview/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

110 lines
3.1 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitLab, fetchurl
, boost, cmake, ffmpeg, wrapQtAppsHook, qtbase, qtx11extras
, qttools, qtxmlpatterns, qtsvg, gdal, gfortran, libXt, makeWrapper
, ninja, mpi, python3, tbb, libGLU, libGL
, withDocs ? true
}:
let
2023-06-27 11:11:24 +00:00
version = "5.11.1";
docFiles = [
(fetchurl {
2021-08-10 08:20:32 +00:00
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";
name = "Tutorial.pdf";
sha256 = "1knpirjbz3rv8p8n03p39vv8vi5imvxakjsssqgly09g0cnsikkw";
})
(fetchurl {
2021-08-10 08:20:32 +00:00
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";
name = "GettingStarted.pdf";
sha256 = "14xhlvg7s7d5amqf4qfyamx2a6b66zf4cmlfm3s7iw3jq01x1lx6";
})
(fetchurl {
2021-08-10 08:20:32 +00:00
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";
name = "CatalystGuide.pdf";
sha256 = "133vcfrbg2nh15igl51ns6gnfn1is20vq6j0rg37wha697pmcr4a";
})
];
in stdenv.mkDerivation rec {
pname = "paraview";
inherit version;
2017-09-10 16:00:38 +00:00
src = fetchFromGitLab {
domain = "gitlab.kitware.com";
owner = "paraview";
repo = "paraview";
2017-09-10 16:00:38 +00:00
rev = "v${version}";
2023-06-27 11:11:24 +00:00
hash = "sha256-LatNHfiAqB2kqzERRnYae0WIXBb4nXQ79Be4kuh8NFQ=";
2017-09-10 16:00:38 +00:00
fetchSubmodules = true;
};
2020-06-07 17:42:19 +00:00
# Find the Qt platform plugin "minimal"
preConfigure = ''
2020-06-07 17:42:19 +00:00
export QT_PLUGIN_PATH=${qtbase.bin}/${qtbase.qtPluginPrefix}
'';
2017-09-10 16:00:38 +00:00
2020-06-07 17:42:19 +00:00
cmakeFlags = [
"-DCMAKE_BUILD_TYPE=Release"
"-DPARAVIEW_ENABLE_FFMPEG=ON"
"-DPARAVIEW_ENABLE_GDAL=ON"
"-DPARAVIEW_ENABLE_MOTIONFX=ON"
"-DPARAVIEW_ENABLE_VISITBRIDGE=ON"
"-DPARAVIEW_ENABLE_XDMF3=ON"
"-DPARAVIEW_INSTALL_DEVELOPMENT_FILES=ON"
"-DPARAVIEW_USE_MPI=ON"
"-DPARAVIEW_USE_PYTHON=ON"
"-DVTK_SMP_IMPLEMENTATION_TYPE=TBB"
"-DVTKm_ENABLE_MPI=ON"
"-DCMAKE_INSTALL_LIBDIR=lib"
"-DCMAKE_INSTALL_INCLUDEDIR=include"
"-DCMAKE_INSTALL_BINDIR=bin"
"-DOpenGL_GL_PREFERENCE=GLVND"
"-GNinja"
];
nativeBuildInputs = [
2017-12-01 12:20:15 +00:00
cmake
makeWrapper
2020-06-07 17:42:19 +00:00
ninja
gfortran
wrapQtAppsHook
];
buildInputs = [
2021-08-10 08:20:32 +00:00
libGLU
libGL
2017-12-01 12:20:15 +00:00
libXt
mpi
2020-06-07 17:42:19 +00:00
tbb
boost
ffmpeg
gdal
2017-12-01 12:20:15 +00:00
qtbase
qtx11extras
qttools
qtxmlpatterns
2020-06-07 17:42:19 +00:00
qtsvg
2017-12-01 12:20:15 +00:00
];
2017-09-10 16:00:38 +00:00
2021-08-10 08:20:32 +00:00
postInstall = let docDir = "$out/share/paraview-${lib.versions.majorMinor version}/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 ]))
];
meta = with lib; {
2020-06-07 17:42:19 +00:00
homepage = "https://www.paraview.org/";
description = "3D Data analysis and visualization application";
license = licenses.bsd3;
maintainers = with maintainers; [ guibert ];
platforms = platforms.linux;
};
}