PKGBUILDs/extra/vtk/PKGBUILD

234 lines
10 KiB
Bash
Raw Permalink Normal View History

2021-10-29 00:30:55 +00:00
# Maintainer: Evgeniy Alekseev <arcanis at archlinux dot org>
2024-06-22 23:12:20 +00:00
# Maintainer: Caleb Maclennan <caleb@alerque.com>
2021-10-29 00:30:55 +00:00
# Maintainer: Bruno Pagani <archange at archlinux dot org>
# Contributor: Michael Migliore <mcmigliore+aur@gmail.com>
# Contributor: Ray Rashif <schiv at archlinux dot org>
# Contributor: Andrzej Giniewicz <gginiu at gmail dot com>
# Contributor: Thomas Dziedzic <gostrc at gmail>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - remove make/optdepends on adios2, openimagedenoise, ospray
# - add makedepend on tbb, previously pulled in by ospray
2023-02-28 14:48:12 +00:00
# - add makedepend on nlohmann-json, previously pulled in by adios2
2021-11-07 21:28:53 +00:00
# - explicitly disable the fides, adios2 modules due to -DVTK_BUILD_ALL_MODULES=ON
2021-10-29 00:30:55 +00:00
# - generalize moving .so files in install
2022-04-23 20:02:02 +00:00
# - removed -ffat-lto-objects from CFLAGS
2024-12-27 16:56:54 +00:00
# - remove make/optdepend on anari-sdk, -DVTK_MODULE_ENABLE_VTK_RenderingAnari=NO
2021-10-29 00:30:55 +00:00
pkgname=vtk
2023-11-18 14:35:24 +00:00
# May need bootstrapping on upgrades due to circular vtk <-> opencascade dependency
2024-12-28 13:57:20 +00:00
pkgver=9.4.1
2025-02-24 12:59:30 +00:00
pkgrel=5
2021-10-29 00:30:55 +00:00
pkgdesc="Software system for 3D computer graphics, image processing, and visualization"
arch=(x86_64)
2024-03-09 15:16:05 +00:00
url="https://www.vtk.org"
license=(BSD-3-Clause)
2023-05-03 19:12:26 +00:00
depends=(
2025-01-05 21:30:08 +00:00
gcc-libs # used by >400 libs
glibc # used by >400 libs
onetbb # used by 57 direct libs, 388 total libs
double-conversion # libvtkCommonCore.so (1 direct lib, 372 total libs)
verdict # libvtkFiltersVerdict.so (1 direct lib, 192 total libs)
fmt # libvtkFiltersGeneral.so etc. (5 direct libs, 189 total libs)
libarchive # libvtkCommonArchive.so (1 direct lib, 2 total libs)
# dependencies of libvtkCommonDataModel.so and libvtkIOCore.so
lz4 # 1 direct lib, 172 total libs
pugixml # 4 direct libs, 351 total libs
xz # 1 direct lib, 172 total libs
zlib # 5 direct libs, 204 total libs
# dependencies of libvtkIOImage.so
libjpeg-turbo # 1 direct lib, 97 total libs
libpng # 1 direct lib, 97 total libs
libtiff # 1 direct lib, 97 total libs
# common data libraries
expat # 1 direct lib, 101 total libs
jsoncpp # 7 direct libs, 26 total libs
libxml2 # 3 direct libs, 13 total libs
2023-05-03 19:12:26 +00:00
)
makedepends=(
2025-01-05 21:30:08 +00:00
# build system
2023-05-03 19:12:26 +00:00
cmake
2025-01-05 21:30:08 +00:00
# bindings
2023-05-03 19:12:26 +00:00
java-environment=11
2025-01-05 21:30:08 +00:00
python
2023-05-03 19:12:26 +00:00
python-matplotlib
python-mpi4py
2025-01-05 21:30:08 +00:00
# graphical toolkits
qt5-base # libvtkGUISupportQt.so etc. (5 direct libs, 6 total libs)
qt5-declarative # libvtkGUISupportQtQuick.so (1 direct lib, 1 total lib)
2023-05-03 19:12:26 +00:00
qt5-tools
2025-01-05 21:30:08 +00:00
tk # libvtkRenderingTk.so (1 direct lib, 1 total lib)
# direct dependencies of "some" VTK libs/modules
openmpi # 13 direct libs, 67 total libs
libx11 # libvtkglad.so, libvtkRenderingUI.so, libvtkRenderingTk.so, libvtkRenderingOpenGL2.so (4 direct libs, 58 total libs)
freetype2 # libvtkRenderingFreeType.so, libvtkRenderingFreeTypeFontConfig.so (2 direct libs, 55 total libs)
libxcursor # libvtkRenderingOpenGL2.so (1 direct lib, 51 total lib)
hdf5 # 16 direct libs, 39 total libs
netcdf # libvtkIOParallelNetCDF.so, libvtkIONetCDF.so, libvtkexodusII.so, libvtkIOMINC.so, libvtkioss.so (5 direct libs, 14 total libs)
sqlite # libvtkIOSQL.so (1 direct lib, 10 total libs)
cgns # libvtkIOCGNSReader.so, libvtkioss.so (2 direct libs, 5 total libs)
gdal # libvtkGeovisGDAL.so, libvtkIOGDAL.so (2 direct libs, 4 total libs)
gl2ps # libvtkRenderingGL2PSOpenGL2.so, libvtkIOExportGL2PS.so (2 direct libs, 4 total libs)
proj # libvtkGeovisCore.so, libvtkIOCesium3DTiles.so (2 direct libs, 4 total libs)
alembic # libvtkIOAlembic.so (1 direct lib, 2 total libs)
ffmpeg # libvtkIOFFMPEG.so (1 direct lib, 2 total libs)
imath # libvtkIOOpenVDB.so (1 direct lib, 2 total libs)
libharu # libvtkIOExportPDF.so (1 direct lib, 2 total libs)
liblas # libvtkIOLAS.so (1 direct lib, 2 total libs)
libogg # libvtkIOOggTheora.so (1 direct lib, 2 total libs)
libtheora # libvtkIOOggTheora.so (1 direct lib, 2 total libs)
mariadb-libs # libvtkIOMySQL.so (1 direct lib, 2 total libs)
opencascade # libvtkIOOCCT.so (1 direct lib, 2 total libs)
openvdb # libvtkIOOpenVDB.so (1 direct lib, 2 total libs)
openvr # libvtkRenderingOpenVR.so (1 direct lib, 2 total libs)
openxr # libvtkRenderingOpenXR.so (1 direct lib, 2 total libs)
pdal # libvtkIOPDAL.so (1 direct lib, 2 total libs)
postgresql-libs # libvtkIOPostgreSQL.so (1 direct lib, 2 total libs)
unixodbc # libvtkIOODBC.so (1 direct lib, 2 total libs)
fontconfig # libvtkRenderingFreeTypeFontConfig.so (1 direct lib, 1 total lib)
nlohmann-json
tbb
# header-only libraries (all except two are only private or test dependencies
# in all modules that use them)
boost
cli11
eigen
fast_float # interface dependency of the VTK::CommonCore module
nlohmann-json # interface dependency of the VTK::CommonCore module
2023-05-03 19:12:26 +00:00
utf8cpp
)
2022-03-19 21:24:01 +00:00
# pegtl: https://gitlab.kitware.com/vtk/vtk/-/issues/18151
# exprtk, ioss: not packaged
2023-05-03 19:12:26 +00:00
optdepends=(
2025-01-05 21:30:08 +00:00
# additional tools not listed in makedepends
2023-05-03 19:12:26 +00:00
'graphviz: drawing tools'
2025-01-05 21:30:08 +00:00
'libglvnd: OpenGL rendering' # checked at runtime rather than compile-time
# bindings
2023-05-03 19:12:26 +00:00
'java-runtime=11: java bindings'
'python: python bindings'
'python-matplotlib: for Matplotlib rendering'
'python-mpi4py: OpenMPI python support'
2025-01-05 21:30:08 +00:00
# graphical toolkits
2023-05-03 19:12:26 +00:00
'qt5-declarative: QML plugin'
'tk: tcl bindings'
2025-01-05 21:30:08 +00:00
# direct dependencies of "some" VTK libs/modules
'libx11: rendering'
'libxcursor: rendering'
'fontconfig: rendering fonts with fontconfig support'
'freetype2: rendering fonts'
'gl2ps: rendering to PostScript, PDF, and SVG'
'openvr: rendering for virtual reality'
'openxr: rendering for virtual and augmented reality'
'openmpi: OpenMPI support'
'alembic: IO module'
'cgns: IO module'
'ffmpeg: IO module'
'gdal: IO module'
'hdf5: IO module'
'imath: IO module'
'libharu: IO module'
'liblas: IO module'
'libogg: IO module'
'libtheora: IO module'
'mariadb-libs: IO module'
'netcdf: IO module'
'opencascade: IO module'
'openvdb: IO module'
'pdal: IO module'
'postgresql-libs: IO module'
'proj: IO module'
'sqlite: IO module'
'unixodbc: IO module'
# building downstream projects
'fast_float: for building downstream projects'
'nlohmann-json: for building downstream projects'
'openmp: OpenMP support for downstream projects built with Clang'
2023-05-03 19:12:26 +00:00
)
2021-10-29 00:30:55 +00:00
options=(staticlibs)
2023-05-14 16:27:38 +00:00
source=(${url}/files/release/${pkgver%.*}/VTK-${pkgver}.tar.gz
2023-11-18 14:26:12 +00:00
vtk-occt.patch
2025-02-10 19:28:50 +00:00
fmt-11.patch
netcdf-4.9.3.patch)
2024-12-28 13:57:20 +00:00
sha256sums=('c253b0c8d002aaf98871c6d0cb76afc4936c301b72358a08d5f3f72ef8bc4529'
2023-11-18 14:26:12 +00:00
'df958eabc7dc4f5b33383ce0fb0f90a3ba202c1c2a24d3b5b9e7cfb1fb38b011'
2025-02-10 19:28:50 +00:00
'c6345d09c219b5ca2efa6e7419f404a22715adb4d2ca1fd6ba34affd77cea23e'
'87535578bbb0023ede506fd64afae95cdf4fb698c543f9735e6267730634afbc')
2021-10-29 00:30:55 +00:00
prepare() {
2023-05-03 19:12:26 +00:00
cd ${pkgname^^}-${pkgver}
2024-03-09 15:16:05 +00:00
_fast_float_version=$(pacman -Q fast_float | sed -e 's/.* //; s/-.*//g')
sed -i "s|3.9.0|${_fast_float_version}|" ThirdParty/fast_float/CMakeLists.txt
2023-05-14 16:27:38 +00:00
2023-11-18 14:26:12 +00:00
patch -Np1 -i "$srcdir"/vtk-occt.patch
2024-12-25 13:22:35 +00:00
patch -Np1 -i "$srcdir"/fmt-11.patch
2025-02-10 19:28:50 +00:00
patch -Np1 -i "$srcdir"/netcdf-4.9.3.patch
2021-10-29 00:30:55 +00:00
}
build() {
# To help cmake find java
export JAVA_HOME=/usr/lib/jvm/default
# To set tcl lib path
local _tkver=$(echo 'puts $tcl_version' | tclsh)
2023-05-03 19:12:26 +00:00
cmake -B build -S ${pkgname^^}-${pkgver} \
2021-10-29 00:30:55 +00:00
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LICENSEDIR=share/licenses/vtk \
-DCMAKE_SKIP_RPATH=OFF \
-DCMAKE_SKIP_INSTALL_RPATH=ON \
2023-02-28 13:30:57 +00:00
-DCMAKE_JAVA_COMPILE_FLAGS="-Xlint:-options" \
2021-10-29 00:30:55 +00:00
-DBUILD_SHARED_LIBS=ON \
-DVTK_BUILD_ALL_MODULES=ON \
2024-12-27 16:56:54 +00:00
-DVTK_MODULE_ENABLE_VTK_IOADIOS2=NO \
-DVTK_MODULE_ENABLE_VTK_fides=NO \
-DVTK_MODULE_ENABLE_VTK_RenderingAnari=NO \
2021-10-29 00:30:55 +00:00
-DVTK_INSTALL_TCL_DIR=/usr/lib/tcl${_tkver}/vtk/ \
-DVTK_LEGACY_REMOVE=ON \
2021-11-07 16:38:12 +00:00
-DVTK_SMP_ENABLE_OPENMP=ON \
2021-10-29 00:30:55 +00:00
-DVTK_SMP_IMPLEMENTATION_TYPE=TBB \
-DVTK_PYTHON_VERSION=3 \
2024-02-06 04:15:40 +00:00
-DVTK_QT_VERSION=5 \
2021-10-29 00:30:55 +00:00
-DVTK_USE_MPI=ON \
-DVTK_USE_TK=ON \
-DVTK_VERSIONED_INSTALL=OFF \
-DVTK_WRAP_JAVA=ON \
-DVTK_WRAP_PYTHON=ON \
2021-11-07 16:38:12 +00:00
-DVTKOSPRAY_ENABLE_DENOISER=OFF \
-DVTKm_ENABLE_HDF5_IO=ON \
-DVTKm_ENABLE_MPI=ON \
-DVTKm_ENABLE_OPENMP=ON \
2021-11-07 21:28:53 +00:00
-DVTK_ENABLE_OSPRAY=OFF \
2021-10-29 00:30:55 +00:00
-DVTK_USE_EXTERNAL=ON \
2021-11-07 16:38:12 +00:00
-DVTK_MODULE_USE_EXTERNAL_VTK_exprtk=OFF \
-DVTK_MODULE_USE_EXTERNAL_VTK_ioss=OFF \
2021-10-29 00:30:55 +00:00
-DVTK_MODULE_USE_EXTERNAL_VTK_pegtl=OFF \
2024-12-25 13:22:35 +00:00
-DVTK_MODULE_USE_EXTERNAL_VTK_token=OFF \
2021-10-29 00:30:55 +00:00
-DVTK_MODULE_ENABLE_VTK_DomainsMicroscopy=NO \
-DVTK_MODULE_ENABLE_VTK_FiltersOpenTURNS=NO \
2023-11-18 14:26:12 +00:00
-DVTK_MODULE_ENABLE_VTK_RenderingZSpace=NO \
2023-03-01 13:55:35 +00:00
-DOpenGL_GL_PREFERENCE=LEGACY \
2023-11-20 14:00:21 +00:00
-DVTK_IGNORE_CMAKE_CXX11_CHECKS=ON \
2021-10-29 00:30:55 +00:00
-Wno-dev
2021-11-07 16:38:12 +00:00
# -DFIDES_USE_EXTERNAL_RAPIDJSON=ON \
2023-11-20 14:00:21 +00:00
cmake --build build
2021-10-29 00:30:55 +00:00
}
package() {
2023-11-20 14:00:21 +00:00
DESTDIR="${pkgdir}" cmake --install build
2021-10-29 00:30:55 +00:00
# Move the vtk.jar to the arch-specific location…
install -dv "${pkgdir}"/usr/share/java/vtk
mv -v "${pkgdir}"/usr/lib/java/vtk.jar "${pkgdir}"/usr/share/java/vtk
# …and the libs to the proper place
mv "${pkgdir}"/usr/lib/java/vtk-Linux-*/*.so "${pkgdir}"/usr/lib/
rmdir "${pkgdir}"/usr/lib/java/{vtk-Linux-*/,}
2022-07-23 00:24:17 +00:00
# byte-compile python modules since the CMake build does not do it
local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
python -m compileall -o 0 -o 1 -o 2 --hardlink-dupes -s "${pkgdir}" "${pkgdir}"${site_packages}
2021-10-29 00:30:55 +00:00
# Remove third party CMake patching for older versions than ours
2023-02-28 13:30:57 +00:00
rm -rv "${pkgdir}"/usr/lib/cmake/vtk/patches/3.{1{3,6,9},20}
2021-10-29 00:30:55 +00:00
# … as well as duplicate copies
2021-12-10 03:06:26 +00:00
rm -rv "${pkgdir}"/usr/lib/cmake/vtk/vtkm/{Find*.cmake,cmake/{Find*.cmake,3.15}}
2021-10-29 00:30:55 +00:00
}