# Maintainer: Thomas Dziedzic < gostrc at gmail > # Contributor: Christofer Bertonha # Contributor: leepesjee # Contributor: Olivier Medoc # Contributor: ignotus # Contributor: Fabian Moser # Contributor: djscholl pkgbase=vtk pkgname=('vtk' 'vtk-python' 'vtk-java' 'vtk-tcl') pkgver=5.8.0 pkgrel=2 pkgdesc='A software system for 3D computer graphics, image processing, and visualization which supports a wide variety of visualization algorithms and advanced modeling techniques.' arch=('i686' 'x86_64') url='http://www.vtk.org' license=('BSD') depends=('libpng' 'libtiff' 'freetype2' 'tk' 'boost' 'ffmpeg' 'qt' 'lesstif' 'mysql') makedepends=('cmake' 'java-environment' 'doxygen' 'gnuplot' 'mesa') source=("http://www.vtk.org/files/release/${pkgver:0:3}/vtk-${pkgver}.tar.gz" "http://www.vtk.org/files/release/${pkgver:0:3}/vtkdata-${pkgver}.tar.gz" 'fixkernelversioncheck.diff') md5sums=('37b7297d02d647cc6ca95b38174cb41f' 'a05295b81930e894fc0e31866f399151' '9e137af23701f76fc727222ebac23389') build() { cd VTK # fix compilation error: http://vtk.org/Bug/view.php?id=12568 # remove next bunp patch -Np1 -i ${srcdir}/fixkernelversioncheck.diff cd ${srcdir} rm -rf build mkdir build cd build cmake \ -Wno-dev \ -DBUILD_SHARED_LIBS:BOOL=ON \ -DCMAKE_INSTALL_PREFIX:FILEPATH=/usr \ -DVTK_DATA_ROOT:FILEPATH=${srcdir}/VTKData \ -DBUILD_DOCUMENTATION:BOOL=ON \ -DDOCUMENTATION_HTML_HELP:BOOL=ON \ -DDOCUMENTATION_HTML_TARZ:BOOL=ON \ -DBUILD_EXAMPLES:BOOL=ON \ -DVTK_USE_HYBRID:BOOL=ON \ -DVTK_USE_PARALLEL:BOOL=ON \ -DVTK_USE_PATENTED:BOOL=ON \ -DVTK_USE_SYSTEM_EXPAT:BOOL=ON \ -DVTK_USE_SYSTEM_FREETYPE:BOOL=ON \ -DVTK_USE_SYSTEM_JPEG:BOOL=ON \ -DVTK_USE_SYSTEM_PNG:BOOL=ON \ -DVTK_USE_SYSTEM_TIFF:BOOL=ON \ -DVTK_USE_SYSTEM_ZLIB:BOOL=ON \ -DVTK_USE_SYSTEM_LIBXML2:BOOL=ON \ -DVTK_USE_BOOST:BOOL=ON \ -DVTK_USE_INFOVIS:BOOL=ON \ -DVTK_USE_GL2PS:BOOL=ON \ -DVTK_USE_MYSQL:BOOL=ON \ -DVTK_USE_FFMPEG_ENCODER:BOOL=ON \ -DVTK_USE_TEXT_ANALYSIS:BOOL=ON \ -DVTK_WRAP_JAVA:BOOL=ON \ -DVTK_WRAP_PYTHON:BOOL=ON \ -DVTK_WRAP_TCL:BOOL=ON \ -DVTK_PYTHON_SETUP_ARGS:STRING="--root=${pkgdir}/vtk-python" \ -DVTK_USE_QT:BOOL=ON \ -DVTK_INSTALL_QT_PLUGIN_DIR:STRING="/usr/lib/qt/plugins" \ -DVTK_USE_GUISUPPORT:BOOL=ON \ -DCMAKE_CXX_FLAGS="-D__STDC_CONSTANT_MACROS" \ ${srcdir}/VTK # j1 is used because of a bug in building with multiple threads #make -j1 make } package_vtk() { optdepends=('gnuplot: plotting tools' 'graphviz: drawing tools' 'vtk-python: for python wrap' 'vtk-java: for java wrap' 'vtk-tcl: for tcl wrap') cd ${srcdir}/build make DESTDIR=${pkgdir} install # Install license install -dv ${pkgdir}/usr/share/licenses/vtk install -m644 ${srcdir}/VTK/Copyright.txt \ ${pkgdir}/usr/share/licenses/vtk # Put an entry in /etc/ld.so.conf.d install -dv ${pkgdir}/etc/ld.so.conf.d echo "/usr/lib/vtk-${pkgver:0:3}" > ${pkgdir}/etc/ld.so.conf.d/vtk.conf # Move the vtk.jar to the arch-specific location install -dv ${pkgdir}/../vtk-java/usr/share mv -v ${pkgdir}/usr/lib/vtk-${pkgver:0:3}/java \ ${pkgdir}/../vtk-java/usr/share/ for wrap in java python tcl do wrapdir=${pkgdir}/../vtk-${wrap} for i in `find ${pkgdir} -iname "*${wrap}*" -type f` do dir_=`dirname $i` dir_=${wrapdir}/${dir_:${#pkgdir}} install -dv ${dir_} mv $i ${dir_} done done #workaround to wrong match patern 'tcl' mv ${pkgdir}/../vtk-tcl/usr/include/vtk-5.8/vtkContextClip.h \ ${pkgdir}/usr/include/vtk-5.8/ } package_vtk-java() { depends=('java-runtime') pkgdesc=('JAVA wrap for VTK') } package_vtk-python() { depends=('python2') pkgdesc=('Python wrap for VTK') } package_vtk-tcl() { depends=('tcl') pkgdesc=('TCL wrap for VTK') }