1 # Maintainer: Bruno Pagani <archange@archlinux.org>
2 # Maintainer: Mathieu Westphal <mathieu.westphal@kitware.com>
3 # Contributor: Stéphane Gaudreault <stephane@archlinux.org>
4 # Contributor: <xantares09@hotmail.com>
12 pkgdesc="Parallel Visualization application using VTK (${_mpi} version)"
14 url="https://www.paraview.org"
16 depends=(boost-libs qt5-tools qt5-svg intel-tbb openmpi ffmpeg
17 adios2 liblas ospray pdal python-numpy protobuf
18 cgns double-conversion expat freetype2 gdal gl2ps glew hdf5 libjpeg
19 jsoncpp libjsoncpp.so libharu libxml2 lz4 xz python-mpi4py netcdf
20 libogg libpng pugixml libtheora libtiff zlib verdict)
21 optdepends=(python-matplotlib python-pandas)
22 makedepends=(cmake boost mesa gcc-fortran ninja qt5-xmlpatterns cli11 eigen utf8cpp)
23 # pegtl: https://gitlab.kitware.com/vtk/vtk/-/issues/18151
24 # rapidjson: https://gitlab.kitware.com/vtk/vtk/-/issues/18366
25 # fmt: https://gitlab.kitware.com/paraview/paraview/-/issues/21315
26 # catalyst, exprtk, ioss: not packaged
27 conflicts=(paraview-opt)
28 replaces=(paraview-opt)
29 source=(${url}/files/v${pkgver%.*}/ParaView-v${pkgver/R/-R}.tar.xz
33 sha256sums=('5cc2209f7fa37cd3155d199ff6c3590620c12ca4da732ef7698dec37fa8dbb34'
34 'd1cdb4a81db280d6b21bee3d9e5f8fc3a87f00a909d33850a1964c72091ec138'
35 '844d44a14817c656ba8d6998298785125a98f03f7b5ece58d966c226db1e0d83')
38 # Specify python version in wrapper
39 local python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
40 sed -i "s|@PYTHON@|${python_version}|" paraview-wrapper.sh
41 # Arch required changes
42 cd ParaView-v${pkgver/R/-R}
43 # We have a patched libharu
44 sed -i "s|2.4.0|2.3.0|" VTK/ThirdParty/libharu/CMakeLists.txt
48 export CFLAGS+=" -ffat-lto-objects"
49 export CXXFLAGS+=" -ffat-lto-objects"
50 cmake -B build -S ParaView-v${pkgver/R/-R} -G Ninja \
51 -DCMAKE_BUILD_TYPE=Release \
52 -DCMAKE_INSTALL_PREFIX=/opt/paraview \
53 -DCMAKE_INSTALL_LICENSEDIR=share/licenses/paraview \
54 -DCMAKE_SKIP_INSTALL_RPATH=OFF \
55 -DPARAVIEW_ENABLE_ADIOS2=ON \
56 -DPARAVIEW_ENABLE_FFMPEG=ON \
57 -DPARAVIEW_ENABLE_FIDES=ON \
58 -DPARAVIEW_ENABLE_GDAL=ON \
59 -DPARAVIEW_ENABLE_LAS=ON \
60 -DPARAVIEW_ENABLE_MOTIONFX=ON \
61 -DPARAVIEW_ENABLE_PDAL=ON \
62 -DPARAVIEW_ENABLE_RAYTRACING=ON \
63 -DPARAVIEW_ENABLE_VISITBRIDGE=ON \
64 -DPARAVIEW_ENABLE_XDMF3=ON \
65 -DPARAVIEW_USE_MPI=ON \
66 -DPARAVIEW_USE_PYTHON=ON \
67 -DPARAVIEW_VERSIONED_INSTALL=OFF \
68 -DPARAVIEW_BUILD_WITH_EXTERNAL=ON \
69 -DVTK_SMP_IMPLEMENTATION_TYPE=TBB \
70 -DVTKm_ENABLE_MPI=ON \
71 -DCATALYST_USE_MPI=ON \
72 -DFIDES_USE_EXTERNAL_RAPIDJSON=OFF \
73 -DVTK_MODULE_USE_EXTERNAL_ParaView_vtkcatalyst=OFF \
74 -DVTK_MODULE_USE_EXTERNAL_VTK_exprtk=OFF \
75 -DVTK_MODULE_USE_EXTERNAL_VTK_fmt=OFF \
76 -DVTK_MODULE_USE_EXTERNAL_VTK_ioss=OFF \
77 -DVTK_MODULE_USE_EXTERNAL_VTK_pegtl=OFF \
79 ninja -C build ${MAKEFLAGS}
83 DESTDIR="${pkgdir}" ninja -C build install
86 install -Dm755 paraview-wrapper.sh "${pkgdir}"/usr/bin/paraview-wrapper
87 for binary in paraview "${pkgdir}"/opt/paraview/bin/pv*
89 install -Dm755 template.sh "${pkgdir}"/usr/bin/${binary##*/}
90 sed -i "s|@BINARY@|${binary##*/}|" "${pkgdir}"/usr/bin/${binary##*/}
93 # Install licenses, shortcuts, icons
94 install -dm755 "${pkgdir}"/usr/share
95 mv "${pkgdir}"/{opt/paraview,usr}/share/applications
96 mv "${pkgdir}"/{opt/paraview,usr}/share/icons
97 mv "${pkgdir}"/{opt/paraview,usr}/share/licenses
98 mv "${pkgdir}"/{opt/paraview,usr}/share/metainfo
100 # byte-compile python modules since the CMake build does not do it.
101 local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
102 python -m compileall -o 0 -o 1 -o 2 --hardlink-dupes -s "${pkgdir}" "${pkgdir}"${site_packages/usr/opt/paraview}