summaryrefslogtreecommitdiff
path: root/community/vtk/PKGBUILD
blob: c1984cfb62e25cd59009e7298c50df10d9c0fe3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# $Id: PKGBUILD 63769 2012-02-05 12:13:32Z ibiru $
# Maintainer: Thomas Dziedzic < gostrc at gmail >
# Contributor: Christofer Bertonha <christoferbertonha at gmail dot com>
# Contributor: leepesjee <lpeschier at xs4all dot nl>
# Contributor: Olivier Medoc
# Contributor: ignotus
# Contributor: Fabian Moser
# Contributor: djscholl

pkgname=vtk
pkgver=5.8.0
pkgrel=8
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' 'libjpeg-turbo' 'freetype2' 'boost' 'ffmpeg' 'qt' 'lesstif' 'mysql' 'hdf5' 'expat' 'libtheora')
makedepends=('cmake' 'java-environment' 'doxygen' 'gnuplot' 'mesa' 'python2' 'tk')
optdepends=('python2: python bindings'
            'java-runtime: java bindings'
            'tk: tcl bindings'
            'gnuplot: plotting tools'
            'graphviz: drawing tools')
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'
        'ffmpeg-0.8.diff'
        'fix-boost-graph-api-changes.diff')
md5sums=('37b7297d02d647cc6ca95b38174cb41f'
         'a05295b81930e894fc0e31866f399151'
         '9e137af23701f76fc727222ebac23389'
         'e992321c9d1def6034d0fa6607b40c5a'
         'e715aef2aea26fc05f904efb5d0d5627')

build() {
  cd VTK

  # fix compilation error: http://vtk.org/Bug/view.php?id=12568
  # remove next pkgver bump
  patch -Np1 -i ${srcdir}/fixkernelversioncheck.diff

  # fix compilation error:
  # remove next pkgver bump
  patch -Np1 -i ${srcdir}/ffmpeg-0.8.diff

  # fix compilation error: http://vtk.org/Bug/view.php?id=12772
  # remove next pkgver bump
  patch -Np1 -i ${srcdir}/fix-boost-graph-api-changes.diff

  cd ${srcdir}

  rm -rf build
  mkdir build
  cd build

  # flags to enable using system libs
  local cmake_system_flags=""
  for lib in HDF5 EXPAT FREETYPE JPEG PNG TIFF ZLIB LIBXML2 OGGTHEORA; do # LIBPROJ4
    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/python2 -DPYTHON_INCLUDE_DIR:PATH=/usr/include/python2.7 -DPYTHON_LIBRARY:PATH=/usr/lib/libpython2.7.so"

  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_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}" \
    -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" \
    ${cmake_system_flags} \
    ${cmake_system_python_flags} \
    ${srcdir}/VTK

  make
}

package() {
  cd 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-${pkgver:0:3}/java/vtk.jar \
    ${pkgdir}/usr/share/java/vtk

  # 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
}