summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c959e11250a303f5be3749133f815d32587d0e12 (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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# Maintainer: Michele Mocciola <mickele>
# Contributor: Mathias Anselmann <mathias____DOT____anselmann____AT____gmail____DOT____com>
# Contributor: St├ęphane Gaudreault <stephane____AT____archlinux____DOT____org>
# Contributor: Thomas Dziedzic < gostrc____AT____gmail____DOT____com >
# Contributor: Simon Zilliken <simon____AT____zilliken____DOT____name>

pkgname=paraview-salome
pkgver=5.1.2plus
_salomever=8.3.0
_salomepkg=DB08
pkgrel=1
pkgdesc='Parallel Visualization Application using VTK - This version is built to be linked against salome modules'
arch=('i686' 'x86_64')
url='http://www.paraview.org'
license=('custom')
depends=('python2' 'ffmpeg' 'boost' 'expat' 'freetype2' 'hdf5-salome' 'libjpeg' 'libxml2' 'libtheora' 'libpng' 'libtiff' 'zlib' 'protobuf' 'openmpi' 'gl2ps' 'qt5-x11extras' 'qt5-tools')
makedepends=('cmake' 'mesa' 'eigen3' 'doxygen')
optdepends=('python2-matplotlib: Needed to support equation rendering using MathText markup language' 'python2-numpy: Needed for using some filters such as "Python Calculator"')
source=("http://files.salome-platform.org/Salome/Salome${_salomever}/SALOME-${_salomever}-${_salomepkg}.tgz"
	"${pkgname}.png" "${pkgname}.desktop" )
provides=("icet")
conflicts=("icet")

options=(staticlibs)
provides=("paraview=${pkgver:0:5}")

# _installdir=/opt/${pkgname}
_installdir=/usr

prepare(){
  cd "${srcdir}"

  if [ -d build ]; then
    rm -rf build
  fi

  bsdtar -xf "${srcdir}/SALOME-${_salomever}-${_salomepkg}/ARCHIVES/ParaView-${pkgver}.tar.gz"
}

build() {
  mkdir -p "${srcdir}/build"
  cd "${srcdir}/build"

  local cmake_options=""

  if test "$CARCH" == x86_64; then
    cmake_options+=" -DCMAKE_CXX_FLAGS:STRING=-m64"
    cmake_options+=" -DCMAKE_C_FLAGS:STRING=-m64"
  fi

  # cmake general settings
  cmake_options+=" -DCMAKE_INSTALL_PREFIX:STRING=${_installdir}"
  cmake_options+=" -DCMAKE_BUILD_TYPE:STRING=Release"
  cmake_options+=" -DBUILD_SHARED_LIBS:BOOL=ON"
  cmake_options+=" -DBUILD_TESTING:BOOL=OFF"
  cmake_options+=" -DBUILD_EXAMPLES:BOOL=OFF"
  cmake_options+=" -DBUILD_DOCUMENTATION:BOOL=OFF"
  # cmake_options+=" -DDOCUMENTATION_HTML_HELP:BOOL=ON"

  # verbose mode
  cmake_options+=" -DCMAKE_VERBOSE_MAKEFILE:BOOL=OFF"

  # mpi
  cmake_options+=" -DPARAVIEW_USE_MPI:BOOL=ON"
  cmake_options+=" -DCMAKE_C_COMPILER:STRING=/usr/bin/mpicc"
  cmake_options+=" -DCMAKE_CXX_COMPILER:STRING=/usr/bin/mpic++"

  # Paraview general settings
  cmake_options+=" -DPARAVIEW_INSTALL_DEVELOPMENT_FILES:BOOL=ON"
  cmake_options+=" -DPARAVIEW_USE_VISITBRIDGE:BOOL=ON"

  # VTK general settings
  cmake_options+=" -DVTK_USE_64BIT_IDS:BOOL=OFF"
  cmake_options+=" -DVTK_NO_PYTHON_THREADS:BOOL=OFF"
  cmake_options+=" -DVTK_REPORT_OPENGL_ERRORS:BOOL=OFF"
  cmake_options+=" -DVTK_PYTHON_FULL_THREADSAFE=ON"

  ## OpenGL2 backend for performance improvment
  # https://blog.kitware.com/new-opengl-rendering-in-vtk/ 
  # it isn't already supported in salome-gui
  # cmake_options+=" -DVTK_RENDERING_BACKEND=OpenGL2"

  # gl2ps settings
  # activating VTK_RENDERING_BACKEND=OpenGL2, gl2ps on archlinux repository is
  # too old; you must use gl2ps on the package (change to OFF following option)
  cmake_options+=" -DVTK_USE_SYSTEM_GL2PS:BOOL=ON"

#  cmake_options+=" -DVTK_USE_SYSTEM_ICET:BOOL=ON"
#  cmake_options+=" -Dicet_DIR:STRING=/usr/lib"

  ### OpenMP to speed computation of some filters
  # https://blog.kitware.com/simple-parallel-computing-with-vtksmptools-2/
  # https://blog.kitware.com/accelerated-filters-in-paraview-5/
  # cmake_options+=" -DVTK_SMP_IMPLEMENTATION_TYPE=OpenMP"
  
  # Qt settings
  cmake_options+=" -DPARAVIEW_BUILD_QT_GUI:BOOL=ON"
  cmake_options+=" -DPARAVIEW_QT_VERSION=5"
  cmake_options+=" -DVTK_QT_VERSION=5"
  cmake_options+=" -DQT_HELP_GENERATOR:STRING=/usr/bin/qhelpgenerator-qt5"
  cmake_options+=" -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt5"

  # Python settings
  cmake_options+=" -DPARAVIEW_ENABLE_PYTHON:BOOL=ON"
  cmake_options+=" -DPYTHON_EXECUTABLE:STRING=/usr/bin/python2"
  cmake_options+=" -DPYTHON_INCLUDE_DIR:STRING=/usr/include/python2.7"
  cmake_options+=" -DPYTHON_LIBRARY:STRING=/usr/lib/python2.7/config/libpython2.7.so"

  # Tcl/Tk settings
  # TEMPORARILY DISABLE TCL WRAPPINGS DUE TO BUG IN PARAVIEW WRAPPER UTILITY!
  # local tcl_version="8.6"
  # cmake_options+=" -DVTK_WRAP_TCL:BOOL=ON"
  # cmake_options+=" -DTCL_INCLUDE_PATH:STRING=/usr/include"
  # cmake_options+=" -DTCL_LIBRARY:STRING=/usr/lib/libtcl${tcl_version}.so"
  # cmake_options+=" -DTCL_TCLSH:STRING=/usr/bin/tclsh${tcl_version}"
  # cmake_options+=" -DTK_INCLUDE_PATH:STRING=/usr/include"
  # cmake_options+=" -DTK_LIBRARY:STRING=/usr/lib/libtk${tcl_version}.so"
  # cmake_options+=" -DTK_WISH:STRING=/usr/bin/wish${tcl_version}"
  cmake_options+=" -DVTK_WRAP_TCL:BOOL=OFF"

  # Java settings
  cmake_options+=" -DVTK_WRAP_JAVA:BOOL=OFF"

  # eigen settings
  cmake_options+=" -DEigen_DIR:PATH=/usr/include/eigen3"

  # HDF5 settings
  cmake_options+=" -DVTK_USE_SYSTEM_HDF5:BOOL=ON"
  cmake_options+=" -DHDF5_DIR:PATH=/usr/lib/hdf5_18/"
  cmake_options+=" -DHDF5_INCLUDE_DIRS:PATH=/usr/include/hdf5_18/"
  cmake_options+=" -DHDF5_C_COMPILER_EXECUTABLE:FILEPATH=/usr/bin/h5cc_18"
  cmake_options+=" -DHDF5_C_LIBRARY_hdf5:FILEPATH=/usr/lib/hdf5_18/libhdf5.so"
  # cmake_options+=" -DHDF5_CXX_LIBRARY_hdf5:FILEPATH=/usr/lib/hdf5_18/libhdf5.so"
  cmake_options+=" -DHDF5_C_LIBRARY_hdf5_hl:FILEPATH=/usr/lib/hdf5_18/libhdf5_hl.so"
  cmake_options+=" -DHDF5_DIFF_EXECUTABLE:FILEPATH=/usr/bin/h5diff_18"

  # Boost settings
  cmake_options+=" -DBOOST_ROOT=/usr"

  # libxml2 settings
  cmake_options+=" -DVTK_USE_SYSTEM_LIBXML2:BOOL=ON"
  cmake_options+=" -DLIBXML2_INCLUDE_DIR:STRING=/usr/include/libxml2"
  cmake_options+=" -DLIBXML2_LIBRARIES:STRING=/usr/lib/libxml2.so"
  cmake_options+=" -DLIBXML2_XMLLINT_EXECUTABLE:FILEPATH=/usr/bin/xmllint"

  # expat settings
  cmake_options+=" -DVTK_USE_SYSTEM_EXPAT:BOOL=ON"
  # jpeg settings
  cmake_options+=" -DVTK_USE_SYSTEM_JPEG:BOOL=ON"
  # tiff settings
  cmake_options+=" -DVTK_USE_SYSTEM_TIFF:BOOL=ON"
  # png settings
  cmake_options+=" -DVTK_USE_SYSTEM_PNG:BOOL=ON"
  # zlib settings
  cmake_options+=" -DVTK_USE_SYSTEM_ZLIB:BOOL=ON"
  # freetype settings
  cmake_options+=" -DVTK_USE_SYSTEM_FREETYPE:BOOL=ON"
  cmake_options+=" -DFREETYPE_INCLUDE_DIRS:STRING=/usr/include/freetype2"
  cmake_options+=" -DFREETYPE_LIBRARY:STRING=/usr/lib/libfreetype.so"

  # Extra options since OCC presta to improve Paraview for Salome
  # cmake_options+=" -DPARAVIEW_USE_3DGLYPH:BOOL=OFF"
  # cmake_options+=" -DPARAVIEW_USE_EXTENDED_OPENFILEDIALOG:BOOL=ON"
  # cmake_options+=" -DPARAVIEW_USE_TIMECONTROL_SLIDER:BOOL=ON"

  # Extra options (switch off non-used Paraview plug-ins)
  cmake_options+=" -DPARAVIEW_BUILD_PLUGIN_Moments:BOOL=OFF"
  cmake_options+=" -DPARAVIEW_BUILD_PLUGIN_SLACTools:BOOL=OFF"
  cmake_options+=" -DPARAVIEW_BUILD_PLUGIN_SierraPlotTools:BOOL=OFF"
  cmake_options+=" -DPARAVIEW_BUILD_PLUGIN_PacMan:BOOL=OFF"
  cmake_options+=" -DPARAVIEW_BUILD_PLUGIN_MobileRemoteControl:BOOL=OFF"
  cmake_options+=" -DPARAVIEW_ENABLE_CATALYST:BOOL=OFF"

  # Extra options (switch on required Paraview plug-ins)
  cmake_options+=" -DPARAVIEW_BUILD_PLUGIN_EyeDomeLighting:BOOL=ON"
  cmake_options+=" -DPARAVIEW_BUILD_PLUGIN_H5PartReader:BOOL=ON"
  cmake_options+=" -DPARAVIEW_BUILD_PLUGIN_PointSprite:BOOL=ON"
  cmake_options+=" -DPARAVIEW_BUILD_PLUGIN_SurfaceLIC:BOOL=ON"
  cmake_options+=" -DPARAVIEW_ENABLE_MATPLOTLIB:BOOL=ON"

  # use ffmpeg
  cmake_options+=" -DVTK_USE_MPEG2_ENCODER=OFF"
  cmake_options+=" -DVTK_USE_FFMPEG_ENCODER=ON"
  cmake_options+=" -DPARAVIEW_ENABLE_FFMPEG=ON"

  # let's start
  cmake -Wno-dev \
        ${cmake_options} \
	../ParaView-${pkgver}

  make
}

package() {
  cd "${srcdir}/build"

  make DESTDIR="${pkgdir}" install

  #Install missing cmake file
  cp -f "${srcdir}/build/VTK/VTKTargets.cmake" "${pkgdir}${_installdir}/lib/cmake/paraview-${pkgver:0:3}"

  # refers cmake files to _installdir
  cd "${pkgdir}${_installdir}/lib/cmake/paraview-${pkgver:0:3}"
  for _FILE in `grep -Rl "${srcdir}/build/lib" * `
  do
    sed -e "s|${srcdir}/build/lib|${_installdir}/lib/paraview-${pkgver:0:3}|" -i "${_FILE}"
  done
  for _FILE in `grep -Rl "${srcdir}/build/bin" * `
  do
    sed -e "s|${srcdir}/build/bin|${_installdir}/bin|" -i "${_FILE}"
  done
  sed -e "s|${srcdir}/ParaView-${pkgver}/CMake|${_installdir}/lib/CMake|" -i ParaViewConfig.cmake

  #Install license
  install -Dm644 "${srcdir}/ParaView-${pkgver}/License_v1.2.txt" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"

  #Install desktop shortcuts
  install -Dm644 "${srcdir}/${pkgname}.png" "${pkgdir}/usr/share/pixmaps/${pkgname}.png"
  desktop-file-install --dir="${pkgdir}/usr/share/applications" "${srcdir}/${pkgname}.desktop"
}
md5sums=('0d355acf763aa054e064b2495579ae8c'
         'db623002bc71a257ddfdd0c9c7b14c3f'
         'e3ba22be644f91da7018f429c3b7dd39')