void-packages/srcpkgs/vtk/template

75 lines
2.4 KiB
Bash

# Template file for 'vtk'
pkgname=vtk
version=9.2.2
revision=3
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_USE_EXTERNAL=ON
-DVTK_MODULE_USE_EXTERNAL_VTK_utf8=OFF
-DVTK_MODULE_USE_EXTERNAL_VTK_pegtl=OFF
-DVTK_MODULE_USE_EXTERNAL_VTK_libharu=OFF
-DVTK_MODULE_USE_EXTERNAL_VTK_exprtk=OFF
-DVTK_MODULE_USE_EXTERNAL_VTK_ioss=OFF
-DVTK_MODULE_USE_EXTERNAL_VTK_cgns=OFF
-DVTK_MODULE_USE_EXTERNAL_VTK_verdict=OFF
-DVTK_WRAP_PYTHON=ON -DVTK_PYTHON_VERSION=3"
# vtk forks libharu, bumps to v2.4.0, and requires libharu>=2.4.0
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
gl2ps-devel proj-devel python3-devel json-c++ fmt-devel"
short_desc="System for 3D computer graphics, image processing, and visualization"
maintainer="Piraty <mail@piraty.dev>"
license="BSD-3-Clause"
homepage="https://www.vtk.org"
distfiles="https://www.vtk.org/files/release/${version:0:3}/VTK-${version}.tar.gz"
checksum=1c5b0a2be71fac96ff4831af69e350f7a0ea3168981f790c000709dcf9121075
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-${version:0:3}/VTKPython-targets-none.cmake"
}
vtk-devel_package() {
short_desc+=" - development files"
depends="vtk-python3>=${version}_${revision} ${makedepends}"
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 "${py3_sitelib}"
vmove "usr/lib/lib*Python*.so.*"
vmove "usr/lib/vtk-${version:0:3}/hierarchy/VTK/vtk*Python*.txt"
}
}