Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/vtk/, sci-libs/vtk/files/
Date: Mon, 31 May 2021 11:40:53
Message-Id: 1622461079.0e3674e78cc315bd0f9adf266dc2b9259b149ac6.sam@gentoo
1 commit: 0e3674e78cc315bd0f9adf266dc2b9259b149ac6
2 Author: Bernd Waibel <waebbl <AT> gmail <DOT> com>
3 AuthorDate: Tue Feb 2 07:12:25 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Mon May 31 11:37:59 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0e3674e7
7
8 sci-libs/vtk: bump to 9.0.1
9
10 Closes: https://bugs.gentoo.org/723744
11 Package-Manager: Portage-3.0.19, Repoman-3.0.3
12 Signed-off-by: Bernd Waibel <waebbl-gentoo <AT> posteo.net>
13 Signed-off-by: Sam James <sam <AT> gentoo.org>
14
15 sci-libs/vtk/Manifest | 4 +
16 ...r-compute_arch-if-CUDA-toolkit-11-is-used.patch | 32 ++
17 sci-libs/vtk/metadata.xml | 13 +-
18 sci-libs/vtk/vtk-9.0.1.ebuild | 531 +++++++++++++++++++++
19 4 files changed, 579 insertions(+), 1 deletion(-)
20
21 diff --git a/sci-libs/vtk/Manifest b/sci-libs/vtk/Manifest
22 index 2ea60d8ea77..38838374c4f 100644
23 --- a/sci-libs/vtk/Manifest
24 +++ b/sci-libs/vtk/Manifest
25 @@ -1,4 +1,8 @@
26 DIST VTK-8.2.0.tar.gz 35511819 BLAKE2B 908ed9377d75da6d0bd84de0078ba90a1e9396fcc906ca2981102e2c79d9d3ba4b1297f98682cd2802c7c04f9dbec32ee70740e645c44180befd765f7cda34a6 SHA512 521bd4dabedbc24b0e80a314a34ecd7554b04af28a7973245e3a9cf99a09b995d1b8ac42305c8e53369f226a0a6da3cdb29105ba2c90b46492736ef717760286
27 +DIST VTK-9.0.1.tar.gz 34687900 BLAKE2B 2c1cc2a35eb6f05d23ec49d8c3c8d787134ce840f940d948da1e03d6875c15e2660c52776218fc3dbccf77959d9affaef051cba14991e6dd150ef5d50b5ae2eb SHA512 eb2508e2409ad302cc5db65282a9c1ff4477ac8a93e0fee898ad8f0974d72decc7d5d444dc825a3c2f7952ebf59853616097ebe0d134649cab0d49a9619065bf
28 DIST VTKData-8.2.0.tar.gz 304287875 BLAKE2B 0292d84be40e11203326dcb1bf45f4a6ad2a785968130d4868a230f1cfbdcb600d0c03d4dae3519e2737dc7a964f29c51500c91b3da4291069608dd80a2bce45 SHA512 517d0f6dfdb0c61f59df933f06d3a28c8a48ea684aaff311456213fe493e2a20128886144325fc4edfa376b2d375a2dae6c60ad6e3d5d2f4a7b0ac1d8545c87b
29 +DIST VTKData-9.0.1.tar.gz 413680549 BLAKE2B 2804f8261763553408c1de8b0d47091875a262cf670604289879253922932f260d4ce8d1586e9b2a8ef3a1286c90e8a61c6472fafcddbd9b40090818eb310d49 SHA512 2fc418a6e15bd4e30ce181bb209c39666982645dbdbe2d6491683497662b72712689e58cf54b7af91865d0e3d0cb3f9ab66606b02964d57bf88d769d292dd938
30 DIST VTKLargeData-8.2.0.tar.gz 247522878 BLAKE2B 68dc90548604fbbb8419f2b400aea5d26599b48208b4104f41eaa90f99483689cd928cb00e3a7def396d65db2f03c9294d132854a27af74f66eb118c8319c4ce SHA512 8a7ea3d5870b1e4ccb31c77b4c270d00208349da1b2938e957210db3ec1449b678c66edc2faee1d4514aca6d725f642abc91e10ab0c151f6743cad1c53485588
31 +DIST VTKLargeData-9.0.1.tar.gz 247522733 BLAKE2B a1d603f7560cf2cd7d1f355fd30fa5b638f2559259f09a6cbbe80da8c2937b1c50cfa2c3b2c6adf99b5bbf537678f817e44bc72962f36364913ae6cc524ae8a8 SHA512 b3303d633f063a6f3bfcc61b441f445611ff7cff6f006c77d8452eb5a3af89a18b2a1201a2dbd230af085b9e45b9abb70319d2f41db0f1e19c632286e7b02ec2
32 DIST vtkDocHtml-8.2.0.tar.gz 132516675 BLAKE2B 8651a3793f3326dee36c5ae8a280b00943067f973115697f34770eefd42b5534a7d7e439e7745b32c5fa83daf5a5292b854792d18951af236d0aa77c3aa2b564 SHA512 45e198bde82948d1d8e47a8bdb64a2792c2bfdfc0d939ffe40ded79092d7ac5f497008c00c805baa09d27eabb419cdf0787eee1caf2ac44c5e8759ecf709a317
33 +DIST vtkDocHtml-9.0.1.tar.gz 138707547 BLAKE2B 1493d21a41b5f8fd43c3503cb4f98905c6d8d0c39e3245a97141bb1baa59ef0054b52595b48fe2b1c1579b02da0dd1f660e5ef7fefd3c7a9cfdbed42f923a234 SHA512 9997fb73ab46d28f107f5a7ef31a86f6948cd3ff88184fd4f1b0cc14dff1b8b6395e420ae2b2a42e772b90b84d8e077cc4543b8b8c9495481c3f8271949f11e4
34
35 diff --git a/sci-libs/vtk/files/vtk-9.0.1-0001-fix-kepler-compute_arch-if-CUDA-toolkit-11-is-used.patch b/sci-libs/vtk/files/vtk-9.0.1-0001-fix-kepler-compute_arch-if-CUDA-toolkit-11-is-used.patch
36 new file mode 100644
37 index 00000000000..2514dac6356
38 --- /dev/null
39 +++ b/sci-libs/vtk/files/vtk-9.0.1-0001-fix-kepler-compute_arch-if-CUDA-toolkit-11-is-used.patch
40 @@ -0,0 +1,32 @@
41 +From 33d9b7ded14ce36e3f63810f3403623ee5c2059c Mon Sep 17 00:00:00 2001
42 +From: Bernd Waibel <waebbl-gentoo@××××××.net>
43 +Date: Sun, 10 Jan 2021 20:29:56 +0100
44 +Subject: [PATCH] fix kepler compute_arch if CUDA toolkit >=11 is used.
45 +
46 +Signed-off-by: Bernd Waibel <waebbl-gentoo@××××××.net>
47 +---
48 + .../vtkm/vtkvtkm/vtk-m/CMake/VTKmDeviceAdapters.cmake | 8 ++++++--
49 + 1 file changed, 6 insertions(+), 2 deletions(-)
50 +
51 +diff --git a/ThirdParty/vtkm/vtkvtkm/vtk-m/CMake/VTKmDeviceAdapters.cmake b/ThirdParty/vtkm/vtkvtkm/vtk-m/CMake/VTKmDeviceAdapters.cmake
52 +index ff0b2581..e565e783 100644
53 +--- a/ThirdParty/vtkm/vtkvtkm/vtk-m/CMake/VTKmDeviceAdapters.cmake
54 ++++ b/ThirdParty/vtkm/vtkvtkm/vtk-m/CMake/VTKmDeviceAdapters.cmake
55 +@@ -229,8 +229,12 @@ if(VTKm_ENABLE_CUDA)
56 + if(VTKm_CUDA_Architecture STREQUAL "fermi")
57 + set(arch_flags --generate-code=arch=compute_20,code=sm_20)
58 + elseif(VTKm_CUDA_Architecture STREQUAL "kepler")
59 +- set(arch_flags --generate-code=arch=compute_30,code=sm_30
60 +- --generate-code=arch=compute_35,code=sm_35)
61 ++ if(CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 11.0)
62 ++ set(arch_flags --generate-code=arch=compute_30,code=sm_30
63 ++ --generate-code=arch=compute_35,code=sm_35)
64 ++ else()
65 ++ set(arch_flags --generate-code=arch=compute_35,code=sm_35)
66 ++ endif()
67 + elseif(VTKm_CUDA_Architecture STREQUAL "maxwell")
68 + set(arch_flags --generate-code=arch=compute_50,code=sm_50)
69 + elseif(VTKm_CUDA_Architecture STREQUAL "pascal")
70 +--
71 +2.30.0
72 +
73
74 diff --git a/sci-libs/vtk/metadata.xml b/sci-libs/vtk/metadata.xml
75 index 6c1a962488c..b7fedcbd916 100644
76 --- a/sci-libs/vtk/metadata.xml
77 +++ b/sci-libs/vtk/metadata.xml
78 @@ -1,17 +1,28 @@
79 <?xml version="1.0" encoding="UTF-8"?>
80 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
81 <pkgmetadata>
82 - <maintainer type="project">
83 + <maintainer type="project" proxied="proxy">
84 <email>sci@g.o</email>
85 <name>Gentoo Science Project</name>
86 </maintainer>
87 + <maintainer type="person" proxied="yes">
88 + <email>waebbl-gentoo@××××××.net</email>
89 + <name>Bernd Waibel</name>
90 + </maintainer>
91 + <maintainer type="project" proxied="proxy">
92 + <email>proxy-maint@g.o</email>
93 + <description>Gentoo Proxy Maintainers</description>
94 + </maintainer>
95 <use>
96 <flag name="all-modules">Build all modules</flag>
97 <flag name="boost">Add support for boost</flag>
98 + <flag name="cuda">Add support for CUDA</flag>
99 <flag name="gdal">Support for gdal formated data</flag>
100 <flag name="imaging">Building Imaging modules</flag>
101 <flag name="json">Support for json formatted data</flag>
102 + <flag name="kits">Build kits in addition to modules</flag>
103 <flag name="offscreen">Offscreen rendering through OSMesa</flag>
104 + <flag name="pegtl">Use pegtl to build parsers</flag>
105 <flag name="rendering">Building Redering modules</flag>
106 <flag name="tbb">Use <pkg>dev-cpp/tbb</pkg> to handle smp support</flag>
107 <flag name="views">Building Views modules</flag>
108
109 diff --git a/sci-libs/vtk/vtk-9.0.1.ebuild b/sci-libs/vtk/vtk-9.0.1.ebuild
110 new file mode 100644
111 index 00000000000..bf7a3ba0a1b
112 --- /dev/null
113 +++ b/sci-libs/vtk/vtk-9.0.1.ebuild
114 @@ -0,0 +1,531 @@
115 +# Copyright 1999-2021 Gentoo Authors
116 +# Distributed under the terms of the GNU General Public License v2
117 +
118 +EAPI=7
119 +
120 +# TODO:
121 +# - add USE flag for remote modules? Those modules can be downloaded
122 +# properly before building.
123 +
124 +PYTHON_COMPAT=( python3_{7,8,9} )
125 +WEBAPP_OPTIONAL=yes
126 +WEBAPP_MANUAL_SLOT=yes
127 +
128 +inherit check-reqs cmake cuda flag-o-matic java-pkg-opt-2 python-single-r1 toolchain-funcs virtualx webapp
129 +
130 +# Short package version
131 +MY_PV="$(ver_cut 1-2)"
132 +
133 +DESCRIPTION="The Visualization Toolkit"
134 +HOMEPAGE="https://www.vtk.org/"
135 +SRC_URI="
136 + https://www.vtk.org/files/release/${MY_PV}/VTK-${PV}.tar.gz
137 + https://www.vtk.org/files/release/${MY_PV}/VTKData-${PV}.tar.gz
138 + doc? ( https://www.vtk.org/files/release/${MY_PV}/vtkDocHtml-${PV}.tar.gz )
139 + examples? ( https://www.vtk.org/files/release/${MY_PV}/VTKLargeData-${PV}.tar.gz )
140 + test? (
141 + https://www.vtk.org/files/release/${MY_PV}/VTKLargeData-${PV}.tar.gz
142 + )
143 +"
144 +S="${WORKDIR}/VTK-${PV}"
145 +
146 +LICENSE="BSD LGPL-2"
147 +SLOT="0"
148 +KEYWORDS="~amd64 ~arm ~arm64 ~x86 ~amd64-linux ~x86-linux"
149 +# Note: external xdmf2 has no recognized target
150 +IUSE="+X all-modules boost cuda doc examples ffmpeg gdal imaging java
151 + +json kits mpi mysql odbc offscreen openmp pegtl postgres python
152 + qt5 +rendering tbb theora tk video_cards_nvidia views web"
153 +
154 +RESTRICT="!test? ( test )"
155 +
156 +REQUIRED_USE="
157 + all-modules? ( boost ffmpeg gdal imaging mysql odbc postgres qt5 rendering theora views )
158 + cuda? ( X )
159 + java? ( rendering )
160 + python? ( ${PYTHON_REQUIRED_USE} )
161 + qt5? ( X rendering )
162 + tk? ( X rendering python )
163 + web? ( python )
164 +"
165 +
166 +RDEPEND="
167 + app-arch/lz4
168 + app-arch/xz-utils
169 + dev-db/sqlite
170 + dev-cpp/eigen[cuda?,openmp?]
171 + dev-libs/double-conversion:=
172 + dev-libs/expat
173 + dev-libs/icu:=
174 + dev-libs/libxml2:2
175 + dev-libs/pugixml
176 + media-libs/freetype
177 + media-libs/libogg
178 + media-libs/libpng
179 + media-libs/libtheora
180 + media-libs/tiff
181 + sci-libs/hdf5:=[mpi=]
182 + sci-libs/kissfft[openmp?]
183 + sci-libs/netcdf:=[mpi=]
184 + sys-libs/zlib
185 + virtual/jpeg
186 + all-modules? ( sci-geosciences/liblas[gdal] )
187 + boost? ( dev-libs/boost:=[mpi?] )
188 + cuda? ( dev-util/nvidia-cuda-toolkit:= )
189 + ffmpeg? ( media-video/ffmpeg:= )
190 + gdal? ( sci-libs/gdal:= )
191 + java? ( >=virtual/jdk-1.8:* )
192 + json? ( dev-libs/jsoncpp:= )
193 + mpi? (
194 + sci-libs/h5part
195 + sys-cluster/openmpi[cxx,romio]
196 + )
197 + mysql? ( dev-db/mariadb-connector-c )
198 + odbc? ( dev-db/unixODBC )
199 + offscreen? ( media-libs/mesa[osmesa] )
200 + postgres? ( dev-db/postgresql:= )
201 + python? ( ${PYTHON_DEPS} )
202 + qt5? (
203 + dev-qt/qtcore:5
204 + dev-qt/qtsql:5
205 + dev-qt/qtwidgets:5
206 + )
207 + rendering? (
208 + media-libs/freeglut
209 + media-libs/glew:=
210 + sci-libs/proj:=
211 + virtual/opengl
212 + x11-libs/gl2ps
213 + )
214 + tbb? ( dev-cpp/tbb )
215 + tk? ( dev-lang/tk:= )
216 + video_cards_nvidia? ( x11-drivers/nvidia-drivers[tools,static-libs] )
217 + views? (
218 + x11-libs/libICE
219 + x11-libs/libXext
220 + )
221 + web? ( ${WEBAPP_DEPEND} )
222 + $(python_gen_cond_dep '
223 + python? (
224 + boost? ( dev-libs/boost:=[mpi?,python?,${PYTHON_MULTI_USEDEP}] )
225 + gdal? ( sci-libs/gdal:=[python?,${PYTHON_MULTI_USEDEP}] )
226 + mpi? ( dev-python/mpi4py[${PYTHON_MULTI_USEDEP}] )
227 + )
228 + ')
229 +"
230 +DEPEND="
231 + ${RDEPEND}
232 + dev-libs/jsoncpp
233 + dev-libs/utfcpp
234 + pegtl? ( <dev-libs/pegtl-3 )
235 +"
236 +BDEPEND="
237 + mpi? ( app-admin/chrpath )
238 + openmp? (
239 + || (
240 + sys-devel/gcc[openmp(+)]
241 + sys-devel/clang-runtime[openmp(+)]
242 + )
243 + )
244 +"
245 +
246 +PATCHES=(
247 + "${FILESDIR}"/${P}-0001-fix-kepler-compute_arch-if-CUDA-toolkit-11-is-used.patch
248 + "${FILESDIR}"/${PN}-8.2.0-freetype-2.10.3-provide-FT_CALLBACK_DEF.patch
249 +)
250 +
251 +DOCS=( CONTRIBUTING.md README.md )
252 +
253 +CHECKREQS_DISK_BUILD="3G"
254 +
255 +pkg_pretend() {
256 + if use examples; then
257 + CHECKREQS_DISK_BUILD="4G"
258 + fi
259 + if use cuda; then
260 + # NOTE: This should actually equal to (number of build jobs)*7G,
261 + # as any of the cuda compile tasks can take up 7G!
262 + # 10.2 GiB install directory, 6.4 GiB build directory with max. USE flags
263 + CHECKREQS_MEMORY="7G"
264 + CHECKREQS_DISK_BUILD="14G"
265 + fi
266 + check-reqs_pkg_setup
267 +}
268 +
269 +pkg_setup() {
270 + if use examples; then
271 + CHECKREQS_DISK_BUILD="4G"
272 + fi
273 + if use cuda; then
274 + CHECKREQS_MEMORY="7G"
275 + CHECKREQS_DISK_BUILD="14G"
276 + fi
277 + check-reqs_pkg_setup
278 +
279 + use java && java-pkg-opt-2_pkg_setup
280 + use python && python-single-r1_pkg_setup
281 + use web && webapp_pkg_setup
282 +}
283 +
284 +src_prepare() {
285 + # If we have system libraries available use these and delete
286 + # the respecting files in ${S}/ThirdParty to save some space.
287 + # Note: libharu is omitted: vtk needs an updated version (2.4.0)
288 + # Note: no valid xdmf2 targets are found for system xdmf2
289 + # Note: no valid target found for h5part and mpi4py
290 + # TODO: diy2 exodusII h5part libharu verdict vpic vtkm xdmf2 xdmf3 zfp
291 + local -a DROPS=( doubleconversion eigen expat freetype gl2ps glew
292 + hdf5 jpeg jsoncpp libproj libxml2 lz4 lzma netcdf ogg png pugixml
293 + sqlite theora tiff utf8 zlib )
294 + use pegtl && DROPS+=( pegtl )
295 +
296 + local x
297 + for x in ${DROPS[@]}; do
298 + ebegin "Dropping bundled ${x}"
299 + rm -r ThirdParty/${x}/vtk${x} || die
300 + eend $?
301 + done
302 + unset x
303 +
304 + if use doc; then
305 + einfo "Removing .md5 files from documents."
306 + rm -f "${WORKDIR}"/html/*.md5 || die "Failed to remove superfluous hashes"
307 + sed -e "s|\${VTK_BINARY_DIR}/Utilities/Doxygen/doc|${WORKDIR}|" \
308 + -i Utilities/Doxygen/CMakeLists.txt || die
309 + fi
310 +
311 + if use test; then
312 + if use java; then
313 + eapply "${FILESDIR}/${P}-0004-disable-failing-java-test.patch"
314 + fi
315 + if use examples; then
316 + eapply "${FILESDIR}/${P}-0005-disable-failing-tests.patch"
317 + fi
318 + fi
319 +
320 + cmake_src_prepare
321 +
322 + if use cuda; then
323 + cuda_add_sandbox -w
324 + cuda_src_prepare
325 + fi
326 +
327 + if use test; then
328 + ebegin "Copying data files to ${BUILD_DIR}"
329 + mkdir -p "${BUILD_DIR}/ExternalData" || die
330 + pushd "${BUILD_DIR}/ExternalData" >/dev/null || die
331 + ln -sf ../../VTK-${PV}/.ExternalData/README.rst . || die
332 + ln -sf ../../VTK-${PV}/.ExternalData/SHA512 . || die
333 + popd >/dev/null || die
334 + eend "$?"
335 + fi
336 +}
337 +
338 +src_configure() {
339 + local mycmakeargs=(
340 +# TODO: defaults for some variables to consider as USE flags
341 +# -DVTK_ANDROID_BUILD=OFF
342 +# -DVTK_BUILD_COMPILE_TOOLS_ONLY=OFF
343 +# -DVTK_ENABLE_LOGGING=ON
344 +# -DVTK_ENABLE_REMOTE_MODULES=ON
345 +# -DVTK_INSTALL_SDK=ON
346 +# -DVTK_IOS_BUILD=OFF
347 +# -DVTK_LEGACY_REMOVE=OFF
348 +# -DVTK_LEGACY_SILENT=OFF
349 +# -DVTK_WHEEL_BUILD=OFF
350 +
351 + -DVTK_BUILD_ALL_MODULES=$(usex all-modules ON OFF)
352 + # we use the pre-built documentation and install these with USE=doc
353 + -DVTK_BUILD_DOCUMENTATION=OFF
354 + -DVTK_BUILD_EXAMPLES=$(usex examples ON OFF)
355 +
356 + -DVTK_ENABLE_KITS=$(usex kits ON OFF)
357 + # default to ON: USE flag for this?
358 + -DVTK_ENABLE_REMOTE_MODULES=OFF
359 +
360 + -DVTK_DATA_STORE="${S}/.ExternalData"
361 +
362 + # Use upstream default, where USE flags are not given.
363 + # Passing "DONT_WANT" will restrict building of modules from
364 + # those groups and will severly limit the built libraries.
365 + # Exceptions are MPI, where the default is "DONT_WANT" and
366 + # StandAlone using "WANT".
367 + -DVTK_GROUP_ENABLE_Imaging=$(usex imaging "WANT" "DEFAULT")
368 + -DVTK_GROUP_ENABLE_Qt=$(usex qt5 "WANT" "DEFAULT")
369 + -DVTK_GROUP_ENABLE_Rendering=$(usex rendering "WANT" "DEFAULT")
370 + -DVTK_GROUP_ENABLE_StandAlone="WANT"
371 + -DVTK_GROUP_ENABLE_Views=$(usex views "WANT" "DEFAULT")
372 + -DVTK_GROUP_ENABLE_Web=$(usex web "WANT" "DEFAULT")
373 +
374 + -DVTK_MODULE_ENABLE_VTK_vtkm="WANT"
375 + -DVTK_MODULE_ENABLE_VTK_AcceleratorsVTKm="WANT"
376 +
377 + -DVTK_PYTHON_VERSION="3"
378 + -DVTK_RELOCATABLE_INSTALL=ON
379 +
380 + -DVTK_USE_CUDA=$(usex cuda ON OFF)
381 + # use system libraries where possible
382 + -DVTK_USE_EXTERNAL=ON
383 + -DVTK_USE_MPI=$(usex mpi ON OFF)
384 + -DVTK_USE_TK=$(usex tk ON OFF)
385 + -DVTK_USE_X=$(usex X ON OFF)
386 +
387 + -DVTK_VERSIONED_INSTALL=ON
388 +
389 + -DVTK_WRAP_JAVA=$(usex java ON OFF)
390 + -DVTK_WRAP_PYTHON=$(usex python ON OFF)
391 + )
392 +
393 + if use examples || use test; then
394 + mycmakeargs+=( -DVTK_USE_LARGE_DATA=ON )
395 + fi
396 +
397 + if ! use java && ! use python; then
398 + # defaults to ON
399 + mycmakeargs+=( -DVTK_ENABLE_WRAPPING=OFF )
400 + fi
401 +
402 + if use boost; then
403 + mycmakeargs+=(
404 + -DVTK_MODULE_ENABLE_VTK_InfovisBoost="WANT"
405 + -DVTK_MODULE_ENABLE_VTK_InfovisBoostGraphAlgorithms="WANT"
406 + )
407 + fi
408 +
409 + if use cuda; then
410 + mycmakeargs+=( -DVTKm_CUDA_Architecture="native" )
411 + fi
412 +
413 + if use ffmpeg; then
414 + mycmakeargs+=( -DVTK_MODULE_ENABLE_VTK_IOFFMPEG="WANT" )
415 + fi
416 +
417 + if use gdal; then
418 + mycmakeargs+=( -DVTK_MODULE_ENABLE_VTK_GeovisGDAL="WANT" )
419 + fi
420 +
421 + if use java; then
422 + mycmakeargs+=(
423 + -DCMAKE_INSTALL_JARDIR="share/${PN}"
424 + -DVTK_ENABLE_WRAPPING=ON
425 + )
426 + fi
427 +
428 + if use json; then
429 + mycmakeargs+=( -DVTK_MODULE_ENABLE_VTK_IOGeoJSON="WANT" )
430 + fi
431 +
432 + if use mpi; then
433 + mycmakeargs+=(
434 + -DVTK_GROUP_ENABLE_MPI="WANT"
435 + -DVTK_MODULE_ENABLE_VTK_IOH5part="WANT"
436 + -DVTK_MODULE_ENABLE_VTK_IOParallel="WANT"
437 + -DVTK_MODULE_ENABLE_VTK_IOParallelNetCDF="WANT"
438 + -DVTK_MODULE_ENABLE_VTK_IOParallelXML="WANT"
439 + -DVTK_MODULE_ENABLE_VTK_ParallelMPI="WANT"
440 + -DVTK_MODULE_ENABLE_VTK_RenderingParallel="WANT"
441 + -DVTK_MODULE_ENABLE_VTK_h5part="WANT"
442 + -DVTKm_ENABLE_MPI=ON
443 + )
444 + if use python; then
445 + mycmakeargs+=( -DVTK_MODULE_ENABLE_VTK_ParallelMPI4Py="WANT" )
446 + fi
447 + fi
448 +
449 + if use mysql; then
450 + mycmakeargs+=(
451 + -DVTK_MODULE_ENABLE_VTK_IOMySQL="WANT"
452 + -DVTK_MODULE_ENABLE_VTK_IOSQL="WANT"
453 + )
454 + fi
455 +
456 + if use odbc; then
457 + mycmakeargs+=( -DVTK_MODULE_ENABLE_VTK_IOODBC="WANT" )
458 + fi
459 +
460 + if use offscreen; then
461 + mycmakeargs+=(
462 + -DVTK_OPENGL_HAS_OSMESA=ON
463 + -DVTK_DEFAULT_RENDER_WINDOW_OFFSCREEN=ON
464 + -DVTK_DEFAULT_RENDER_WINDOW_HEADLESS=ON
465 + )
466 + fi
467 +
468 + if use openmp; then
469 + if use tbb; then
470 + einfo "NOTE: You have specified both openmp and tbb USE flags."
471 + einfo "NOTE: Tbb will take precedence. Disabling OpenMP"
472 + # Sequential is default SMP implementation, nothing special to do
473 + else
474 + mycmakeargs+=(
475 + -DVTK_SMP_IMPLEMENTATION_TYPE="OpenMP"
476 + -DVTKm_ENABLE_OPENMP=ON
477 + )
478 + fi
479 + fi
480 +
481 + if use pegtl; then
482 + mycmakeargs+=( -DVTK_MODULE_USE_EXTERNAL_VTK_pegtl=ON )
483 + else
484 + mycmakeargs+=( -DVTK_MODULE_USE_EXTERNAL_VTK_pegtl=OFF )
485 + fi
486 +
487 + if use postgres; then
488 + mycmakeargs+=(
489 + -DVTK_MODULE_ENABLE_VTK_IOPostgreSQL="WANT"
490 + -DVTK_MODULE_ENABLE_VTK_IOSQL="WANT"
491 + )
492 + fi
493 +
494 + if use python; then
495 + mycmakeargs+=(
496 + -DVTK_ENABLE_WRAPPING=ON
497 + -DPython3_EXECUTABLE="${PYTHON}"
498 + -DVTK_PYTHON_SITE_PACKAGES_SUFFIX="lib/${EPYTHON}/site-packages"
499 + )
500 + fi
501 +
502 + if use qt5; then
503 + mycmakeargs+=( -DVTK_MODULE_ENABLE_VTK_GUISupportQt="WANT" )
504 + if use mysql || use postgres; then
505 + mycmakeargs+=( -DVTK_MODULE_ENABLE_VTK_GUISupportQtSQL="WANT" )
506 + fi
507 + if use rendering; then
508 + mycmakeargs+=( -DVTK_MODULE_ENABLE_VTK_RenderingQt="WANT" )
509 + fi
510 + if use views; then
511 + mycmakeargs+=( -DVTK_MODULE_ENABLE_VTK_ViewsQt="WANT" )
512 + fi
513 + fi
514 +
515 + if use rendering || use web || use all-modules; then
516 + # needs patched version
517 + mycmakeargs+=( -DVTK_MODULE_USE_EXTERNAL_VTK_libharu=OFF )
518 + fi
519 +
520 + if use rendering; then
521 + mycmakeargs+=(
522 + -DVTK_MODULE_ENABLE_VTK_IOExportGL2PS="WANT"
523 + -DVTK_MODULE_USE_EXTERNAL_VTK_gl2ps=ON
524 + -DVTK_MODULE_USE_EXTERNAL_VTK_glew=ON
525 + -DVTK_MODULE_USE_EXTERNAL_VTK_libproj=ON
526 + )
527 + fi
528 +
529 + if use tbb; then
530 + mycmakeargs+=(
531 + -DVTK_SMP_IMPLEMENTATION_TYPE="TBB"
532 + -DVTKm_ENABLE_TBB=ON
533 + )
534 + fi
535 +
536 + if use test; then
537 + ewarn "Testing requires VTK_FORBID_DOWNLOADS=OFF by upstream."
538 + ewarn "Care has been taken to pre-download all required files."
539 + ewarn "In case you find missing files, please inform me."
540 + mycmakeargs+=(
541 + -DVTK_BUILD_TESTING=ON
542 + -DVTK_DATA_EXCLUDE_FROM_ALL=ON
543 + -DVTK_FORBID_DOWNLOADS=OFF
544 + )
545 + else
546 + mycmakeargs+=(
547 + -DVTK_BUILD_TESTING=OFF
548 + -DVTK_FORBID_DOWNLOADS=ON
549 + )
550 + fi
551 +
552 + if use theora; then
553 + mycmakeargs+=( -DVTK_MODULE_ENABLE_VTK_IOOggTheora="WANT" )
554 + fi
555 +
556 + if use all-modules; then
557 + mycmakeargs+=(
558 + -DVTK_ENABLE_OSPRAY=OFF
559 + -DVTK_MODULE_ENABLE_VTK_DomainsMicroscopy="DONT_WANT"
560 + -DVTK_MODULE_ENABLE_VTK_FiltersOpenTURNS="DONT_WANT"
561 + -DVTK_MODULE_ENABLE_VTK_IOADIOS2="DONT_WANT"
562 + -DVTK_MODULE_ENABLE_VTK_IOPDAL="DONT_WANT"
563 + -DVTK_MODULE_ENABLE_VTK_MomentInvariants="DONT_WANT"
564 + -DVTK_MODULE_ENABLE_VTK_PoissonReconstruction="DONT_WANT"
565 + -DVTK_MODULE_ENABLE_VTK_Powercrust="DONT_WANT"
566 + -DVTK_MODULE_ENABLE_VTK_RenderingOpenVR="DONT_WANT"
567 + -DVTK_MODULE_ENABLE_VTK_SignedTensor="DONT_WANT"
568 + -DVTK_MODULE_ENABLE_VTK_SplineDrivenImageSlicer="DONT_WANT"
569 + -DVTK_MODULE_ENABLE_VTK_vtkDICOM="DONT_WANT"
570 + -DVTK_MODULE_USE_EXTERNAL_vtkkissfft=ON
571 + )
572 + fi
573 +
574 + use java && export JAVA_HOME="${EPREFIX}/etc/java-config-2/current-system-vm"
575 +
576 + if use mpi; then
577 + export CC=mpicc
578 + export CXX=mpicxx
579 + export FC=mpif90
580 + export F90=mpif90
581 + export F77=mpif77
582 + fi
583 +
584 + cmake_src_configure
585 +}
586 +
587 +src_test() {
588 + nonfatal virtx cmake_src_test
589 +}
590 +
591 +src_install() {
592 + use web && webapp_src_preinst
593 +
594 + # Stop web page images from being compressed
595 + if use doc; then
596 + HTML_DOCS=( "${WORKDIR}/html/." )
597 + fi
598 +
599 + cmake_src_install
600 +
601 + use java && java-pkg_regjar "${ED}"/usr/share/${PN}/${PN}.jar
602 +
603 + # install examples
604 + if use examples; then
605 + einfo "Installing examples"
606 + mv -v {E,e}xamples || die
607 + dodoc -r examples
608 + docompress -x /usr/share/doc/${PF}/examples
609 +
610 + einfo "Installing datafiles"
611 + insinto /usr/share/${PN}/data
612 + doins -r "${S}/.ExternalData"
613 + fi
614 +
615 + # with MPI runpath's are not deleted properly
616 + if use mpi; then
617 + chrpath -d "${ED}"/usr/$(get_libdir)/*.so.${PV} || die
618 + fi
619 +
620 + use python && python_optimize
621 +
622 + # environment
623 + cat >> "${T}"/40${PN} <<- EOF || die
624 + VTK_DATA_ROOT=${EPREFIX}/usr/share/${PN}/data
625 + VTK_DIR=${EPREFIX}/usr/$(get_libdir)/${PN}
626 + VTKHOME=${EPREFIX}/usr
627 + EOF
628 + doenvd "${T}"/40${PN}
629 +
630 + use web && webapp_src_install
631 +}
632 +
633 +# webapp.eclass exports these but we want it optional #534036
634 +pkg_postinst() {
635 + use web && webapp_pkg_postinst
636 +
637 + if use examples; then
638 + einfo "You can get more and updated examples at"
639 + einfo "https://kitware.github.io/vtk-examples/site/"
640 + fi
641 +}
642 +
643 +pkg_prerm() {
644 + use web && webapp_pkg_prerm
645 +}