# Template file for 'vtk' pkgname=vtk version=9.0.1 revision=2 wrksrc=VTK-${version} build_style=cmake # vtk can be huge, especially with -DVTK_BUILD_ALL_MODULES=ON" # Build only the core modules plus python bindings for now configure_args="-DBUILD_SHARED_LIBS=ON -DVTK_FORBID_DOWNLOADS=ON -DVTK_WRAP_PYTHON=ON -DVTK_PYTHON_VERSION=3" makedepends="zlib-devel freetype-devel liblz4-devel expat-devel MesaLib-devel libXt-devel libjpeg-turbo-devel tiff-devel hdf5-devel netcdf-devel libxml2-devel jsoncpp-devel openmpi-devel libogg-devel libtheora-devel eigen double-conversion-devel glew-devel pugixml-devel sqlite-devel python3-devel" short_desc="System for 3D computer graphics, image processing, and visualization" maintainer="Piraty " license="BSD-3-Clause" homepage="https://www.vtk.org" distfiles="https://www.vtk.org/files/release/${version:0:3}/VTK-${version}.tar.gz" checksum=1b39a5e191c282861e7af4101eaa8585969a2de05f5646c9199a161213a622c7 nocross="hdf5 is nocross" if [ "$XBPS_TARGET_LIBC" = "musl" ]; then makedepends+=" libexecinfo-devel" LDFLAGS="-lexecinfo" fi if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then makedepends+=" libatomic-devel" fi post_extract() { [ "$XBPS_TARGET_NO_ATOMIC8" ] || return 0 echo "vtk_module_link(VTK::CommonDataModel PRIVATE atomic)" >> \ Common/DataModel/CMakeLists.txt } post_install() { vlicense Copyright.txt # Mangle CPython extension names in CMake like xbps-src will do vsed -e 's,\(vtkmodules/vtk.*\)\.cpython-.*\.so,\1.so,' \ -i "${DESTDIR}/usr/lib/cmake/vtk-9.0/VTKPython-targets-release.cmake" } vtk-devel_package() { short_desc+=" - development files" depends="vtk-python3>=${version}_${revision}" pkg_install() { vmove usr/include vmove usr/lib/*.so vmove usr/lib/cmake } } vtk-python3_package() { short_desc+=" - Python3 bindings" depends="${sourcepkg}>=${version}_${revision}" pkg_install() { vmove usr/bin/vtkpython vmove usr/lib/python3.8 vmove "usr/lib/lib*Python*.so.*" vmove "usr/lib/vtk/hierarchy/VTK/vtk*Python*.txt" } }