# $Id$ # Maintainer: Andrzej Giniewicz # Contributor: Thomas Dziedzic < gostrc at gmail > # Contributor: Christofer Bertonha # Contributor: leepesjee # Contributor: Olivier Medoc # Contributor: ignotus # Contributor: Fabian Moser # Contributor: djscholl # Contributor: Matthias Blaicher pkgname=vtk pkgver=6.3.0.rc2 _majorver=$(echo ${pkgver} | cut -d '.' -f 1-2) pkgrel=1 pkgdesc='A software system for 3D computer graphics, image processing, and visualization.' arch=('i686' 'x86_64') url='http://www.vtk.org/' license=('BSD') depends=('boost' 'ffmpeg' 'qt5-webkit' 'lesstif' 'gdal' 'unixodbc' 'jsoncpp' 'openmpi') makedepends=('cmake' 'java-environment' 'doxygen' 'gnuplot' 'tk' 'wget' 'python2-matplotlib' 'python2-twisted' 'python-six') optdepends=('python2: python bindings' 'python-six: python bindings' 'java-runtime: java bindings' 'tk: tcl bindings' 'gnuplot: plotting tools' 'graphviz: drawing tools' 'python2-matplotlib: for Matplotlib rendering' 'python2-twisted: for vtkWeb') provides=('python2-autobahn') source=("http://www.vtk.org/files/release/${_majorver}/VTK-${pkgver}.tar.gz" "http://www.vtk.org/files/release/${_majorver}/VTKData-${pkgver}.tar.gz" "http://www.vtk.org/files/release/${_majorver}/VTKLargeData-${pkgver}.tar.gz" fix_system_hdf5.diff) options=(staticlibs) md5sums=('1075b8cede4311943e33494f411b60a1' '191e4ae3175a2edbcfc58ab780ce6c19' '718616867216163012b2049fdd5d56ca' '81bfc22a0458a2078bad5c96731b3517') # NOTE: This package dropped dependencies on mariadb. # NOTE: This build enables Qt5, see FS#43340 # NOTE: This build disables custom library suffixes, see FS#43378 # NOTE: This build removes the version prefix from the include directory, see FS#43378 # NOTE: VTK now depends on python-six, we will depend on the system version of this. # TODO It looks like vtk builds statically against boost, simply using boost-libs is not enough FS#44775, # As VTK starts providing python 3 support in the next versions this going to become important. _python_version=2.7 prepare() { cd "${srcdir}"/VTK-$pkgver # Fix building against system hdf5 # see https://gitlab.kitware.com/vtk/vtk/commit/d2013691999c8978b84db1623b905e8eff2d3035 patch -Np1 -i "${srcdir}/fix_system_hdf5.diff" sed -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" \ -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \ -e "s|#![ ]*/bin/env python$|#!/usr/bin/env python2|" \ -i $(find . -name '*.py') } build() { cd "${srcdir}" rm -rf build mkdir build cd build # to help cmake find java export JAVA_HOME=/usr/lib/jvm/default # flags to enable using system libs local cmake_system_flags="" # TODO: try to use system provided AUTOBAHN, GL2PS, XDMF2, LIBPROJ4 and NETCDF for lib in HDF5 EXPAT FREETYPE JPEG PNG TIFF ZLIB LIBXML2 OGGTHEORA TWISTED ZOPE JSONCPP SIX; do cmake_system_flags+="-DVTK_USE_SYSTEM_${lib}:BOOL=ON " done # flags to use python2 instead of python which is 3.x.x on archlinux local cmake_system_python_flags="-DPYTHON_EXECUTABLE:PATH=/usr/bin/python${_python_version} -DPYTHON_INCLUDE_DIR:PATH=/usr/include/python${_python_version} -DPYTHON_LIBRARY:PATH=/usr/lib/libpython${_python_version}.so" cmake \ -Wno-dev \ -DVTK_CUSTOM_LIBRARY_SUFFIX="" \ -DBUILD_SHARED_LIBS:BOOL=ON \ -DVTK_INSTALL_INCLUDE_DIR:PATH=include/vtk \ -DCMAKE_INSTALL_PREFIX:FILEPATH=/usr \ -DBUILD_DOCUMENTATION:BOOL=ON \ -DDOCUMENTATION_HTML_HELP:BOOL=ON \ -DDOCUMENTATION_HTML_TARZ:BOOL=ON \ -DBUILD_EXAMPLES:BOOL=ON \ -DVTK_USE_FFMPEG_ENCODER:BOOL=ON \ -DVTK_BUILD_ALL_MODULES:BOOL=ON \ -DVTK_USE_LARGE_DATA:BOOL=ON \ -DVTK_QT_VERSION:STRING="5" \ -DVTK_WRAP_JAVA:BOOL=ON \ -DVTK_WRAP_PYTHON:BOOL=ON \ -DVTK_WRAP_TCL:BOOL=ON \ -DCMAKE_CXX_FLAGS="-D__STDC_CONSTANT_MACROS" \ ${cmake_system_flags} \ ${cmake_system_python_flags} \ "${srcdir}/VTK-$pkgver" make } package() { cd "${srcdir}/build" make DESTDIR="${pkgdir}" install # Move the vtk.jar to the arch-specific location install -dv "${pkgdir}/usr/share/java/vtk" mv -v "${pkgdir}/usr/lib/vtk.jar" "${pkgdir}/usr/share/java/vtk" rm -rf "${pkgdir}/usr/lib/vtk-${_majorver}/java" # Install license install -dv "${pkgdir}/usr/share/licenses/vtk" install -m644 "${srcdir}/VTK-$pkgver/Copyright.txt" "${pkgdir}/usr/share/licenses/vtk" # Fix path of QtDesigner plugin install -dv "${pkgdir}/usr/lib/qt5" mv "$pkgdir"/usr/plugins "$pkgdir"/usr/lib/qt5/plugins # When building in a chroot provided by (extra-x86_64-build) there is sometimes a stray cmake file. # The reason for this is unkown. rm -f "${pkgdir}/usr/XdmfConfig.cmake" }