Gentoo Archives: gentoo-commits

From: Pacho Ramos <pacho@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/vtk/
Date: Sat, 27 Oct 2018 14:09:59
Message-Id: 1540649301.16addbe1dac65999c0e93a7e74e05cf12c101855.pacho@gentoo
1 commit: 16addbe1dac65999c0e93a7e74e05cf12c101855
2 Author: Pacho Ramos <pacho <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 27 14:08:21 2018 +0000
4 Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 27 14:08:21 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=16addbe1
7
8 sci-libs/vtk: Relies also in netcdf:0=
9
10 Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>
11 Package-Manager: Portage-2.3.51, Repoman-2.3.11
12
13 sci-libs/vtk/vtk-8.1.0-r3.ebuild | 333 +++++++++++++++++++++++++++++++++++++++
14 1 file changed, 333 insertions(+)
15
16 diff --git a/sci-libs/vtk/vtk-8.1.0-r3.ebuild b/sci-libs/vtk/vtk-8.1.0-r3.ebuild
17 new file mode 100644
18 index 00000000000..bfe60457d8c
19 --- /dev/null
20 +++ b/sci-libs/vtk/vtk-8.1.0-r3.ebuild
21 @@ -0,0 +1,333 @@
22 +# Copyright 1999-2018 Gentoo Authors
23 +# Distributed under the terms of the GNU General Public License v2
24 +
25 +EAPI=6
26 +
27 +PYTHON_COMPAT=( python{2_7,3_5,3_6} )
28 +WEBAPP_OPTIONAL=yes
29 +WEBAPP_MANUAL_SLOT=yes
30 +
31 +inherit flag-o-matic java-pkg-opt-2 python-single-r1 qmake-utils versionator toolchain-funcs cmake-utils virtualx webapp
32 +
33 +# Short package version
34 +SPV="$(get_version_component_range 1-2)"
35 +
36 +DESCRIPTION="The Visualization Toolkit"
37 +HOMEPAGE="https://www.vtk.org/"
38 +SRC_URI="
39 + https://www.vtk.org/files/release/${SPV}/VTK-${PV}.tar.gz
40 + doc? ( https://www.vtk.org/files/release/${SPV}/vtkDocHtml-${PV}.tar.gz )
41 + examples? (
42 + https://www.vtk.org/files/release/${SPV}/VTKData-${PV}.tar.gz
43 + https://www.vtk.org/files/release/${SPV}/VTKLargeData-${PV}.tar.gz
44 + )"
45 +
46 +LICENSE="BSD LGPL-2"
47 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
48 +SLOT="0"
49 +IUSE="
50 + all-modules aqua boost doc examples imaging ffmpeg gdal java json kaapi mpi
51 + mysql odbc offscreen postgres python qt5 rendering tbb theora tk tcl
52 + video_cards_nvidia views web R +X xdmf2"
53 +
54 +REQUIRED_USE="
55 + all-modules? ( python xdmf2 boost )
56 + java? ( qt5 )
57 + python? ( ${PYTHON_REQUIRED_USE} )
58 + tcl? ( rendering )
59 + examples? ( python )
60 + tk? ( tcl )
61 + web? ( python )
62 + ^^ ( X aqua offscreen )"
63 +
64 +RDEPEND="
65 + app-arch/lz4
66 + dev-libs/expat
67 + dev-libs/jsoncpp:=
68 + dev-libs/libxml2:2
69 + >=media-libs/freetype-2.5.4
70 + >=media-libs/libharu-2.3.0-r2
71 + media-libs/libpng:0=
72 + media-libs/libtheora
73 + media-libs/mesa
74 + media-libs/tiff:0
75 + sci-libs/exodusii
76 + sci-libs/hdf5:=
77 + sci-libs/netcdf:0=
78 + sci-libs/netcdf-cxx:3
79 + sys-libs/zlib
80 + virtual/jpeg:0
81 + virtual/opengl
82 + x11-libs/libX11
83 + x11-libs/libXmu
84 + x11-libs/libXt
85 + boost? ( dev-libs/boost:=[mpi?] )
86 + examples? (
87 + dev-qt/qtcore:5
88 + dev-qt/qtgui:5
89 + )
90 + ffmpeg? ( virtual/ffmpeg )
91 + gdal? ( sci-libs/gdal )
92 + java? ( >=virtual/jdk-1.7:* )
93 + kaapi? ( <sci-libs/xkaapi-3 )
94 + mpi? (
95 + virtual/mpi[cxx,romio]
96 + python? ( dev-python/mpi4py[${PYTHON_USEDEP}] )
97 + )
98 + mysql? ( virtual/mysql )
99 + odbc? ( dev-db/unixODBC )
100 + offscreen? ( media-libs/mesa[osmesa] )
101 + postgres? ( dev-db/postgresql:= )
102 + python? (
103 + ${PYTHON_DEPS}
104 + dev-python/sip[${PYTHON_USEDEP}]
105 + )
106 + qt5? (
107 + dev-qt/designer:5
108 + dev-qt/qtcore:5
109 + dev-qt/qtgui:5
110 + dev-qt/qtopengl:5
111 + dev-qt/qtsql:5
112 + dev-qt/qtwebkit:5
113 + dev-qt/qtx11extras:5
114 + python? ( dev-python/PyQt5[${PYTHON_USEDEP}] )
115 + )
116 + R? ( dev-lang/R )
117 + tbb? ( dev-cpp/tbb )
118 + tcl? ( dev-lang/tcl:0= )
119 + tk? ( dev-lang/tk:0= )
120 + video_cards_nvidia? ( x11-drivers/nvidia-drivers[tools,static-libs] )
121 + web? (
122 + ${WEBAPP_DEPEND}
123 + dev-python/autobahn[${PYTHON_USEDEP}]
124 + dev-python/constantly[${PYTHON_USEDEP}]
125 + dev-python/hyperlink[${PYTHON_USEDEP}]
126 + dev-python/incremental[${PYTHON_USEDEP}]
127 + dev-python/six[${PYTHON_USEDEP}]
128 + dev-python/twisted[${PYTHON_USEDEP}]
129 + dev-python/txaio[${PYTHON_USEDEP}]
130 + dev-python/zope-interface[${PYTHON_USEDEP}]
131 + )
132 + xdmf2? ( sci-libs/xdmf2 )"
133 +DEPEND="${RDEPEND}
134 + doc? ( app-doc/doxygen )"
135 +
136 +S="${WORKDIR}"/VTK-${PV}
137 +
138 +RESTRICT="test"
139 +
140 +pkg_setup() {
141 + use java && java-pkg-opt-2_pkg_setup
142 + use python && python-single-r1_pkg_setup
143 + use web && webapp_pkg_setup
144 +}
145 +
146 +src_prepare() {
147 + local x
148 + # missing: VPIC freerange libproj4 mrmpi sqlite utf8 verdict xmdf2 xmdf3
149 + for x in constantly expat freetype hdf5 hyperlink incremental jpeg jsoncpp libharu libxml2 lz4 netcdf oggtheora png tiff Twisted txaio zlib ZopeInterface; do
150 + ebegin "Dropping bundled ${x}"
151 + rm -r ThirdParty/${x}/vtk${x} || die
152 + eend $?
153 + done
154 + rm -r \
155 + ThirdParty/AutobahnPython/vtkAutobahn \
156 + || die
157 +
158 + if use doc; then
159 + einfo "Removing .md5 files from documents."
160 + rm -f "${WORKDIR}"/html/*.md5 || die "Failed to remove superfluous hashes"
161 + sed -e "s|\${VTK_BINARY_DIR}/Utilities/Doxygen/doc|${WORKDIR}|" \
162 + -i Utilities/Doxygen/CMakeLists.txt || die
163 + fi
164 +
165 + cmake-utils_src_prepare
166 +}
167 +
168 +src_configure() {
169 + # general configuration
170 + local mycmakeargs=(
171 + -Wno-dev
172 + -DVTK_DIR="${S}"
173 + -DVTK_INSTALL_LIBRARY_DIR=$(get_libdir)
174 + -DVTK_INSTALL_DOC_DIR="${EPREFIX}/usr/share/doc/${PF}"
175 + -DVTK_DATA_ROOT="${EPREFIX}/usr/share/${PN}/data"
176 + -DVTK_CUSTOM_LIBRARY_SUFFIX=""
177 + -DBUILD_SHARED_LIBS=ON
178 + -DVTK_USE_SYSTEM_AUTOBAHN=ON
179 + -DVTK_USE_SYSTEM_EXPAT=ON
180 + -DVTK_USE_SYSTEM_FREETYPE=ON
181 + -DVTK_USE_SYSTEM_FreeType=ON
182 + # Use bundled gl2ps (bundled version is a patched version of 1.3.9. Post 1.3.9 versions should be compatible)
183 + -DVTK_USE_SYSTEM_GL2PS=OFF
184 + -DVTK_USE_SYSTEM_HDF5=ON
185 + -DVTK_USE_SYSTEM_JPEG=ON
186 + -DVTK_USE_SYSTEM_LIBPROJ4=OFF
187 + -DVTK_USE_SYSTEM_LIBXML2=ON
188 + -DVTK_USE_SYSTEM_LibXml2=ON
189 + -DVTK_USE_SYSTEM_NETCDF=ON
190 + -DVTK_USE_SYSTEM_OGGTHEORA=ON
191 + -DVTK_USE_SYSTEM_PNG=ON
192 + -DVTK_USE_SYSTEM_TIFF=ON
193 + -DVTK_USE_SYSTEM_TWISTED=ON
194 + -DVTK_USE_SYSTEM_XDMF2=OFF
195 + -DVTK_USE_SYSTEM_XDMF3=OFF
196 + -DVTK_USE_SYSTEM_ZLIB=ON
197 + -DVTK_USE_SYSTEM_ZOPE=ON
198 + -DVTK_USE_SYSTEM_LIBRARIES=ON
199 + # Use bundled diy2 (no gentoo package / upstream does not provide a Finddiy2.cmake or diy2Config.cmake / diy2-config.cmake)
200 + -DVTK_USE_SYSTEM_DIY2=OFF
201 + -DVTK_USE_GL2PS=ON
202 + -DVTK_USE_LARGE_DATA=ON
203 + -DVTK_USE_PARALLEL=ON
204 + -DVTK_EXTRA_COMPILER_WARNINGS=ON
205 + -DVTK_Group_StandAlone=ON
206 + -DBUILD_DOCUMENTATION=$(usex doc)
207 + -DBUILD_EXAMPLES=$(usex examples)
208 + -DBUILD_VTK_BUILD_ALL_MODULES_FOR_TESTS=off
209 + -DVTK_BUILD_ALL_MODULES=$(usex all-modules)
210 + -DUSE_DOCUMENTATION_HTML_HELP=$(usex doc)
211 + -DVTK_Group_Imaging=$(usex imaging)
212 + -DVTK_Group_MPI=$(usex mpi)
213 + -DVTK_Group_Rendering=$(usex rendering)
214 + -DVTK_Group_Tk=$(usex tk)
215 + -DVTK_Group_Views=$(usex views)
216 + -DVTK_Group_Web=$(usex web)
217 + -DVTK_WWW_DIR="${ED%/}/${MY_HTDOCSDIR}"
218 + -DVTK_WRAP_JAVA=$(usex java)
219 + -DVTK_WRAP_PYTHON=$(usex python)
220 + -DVTK_WRAP_PYTHON_SIP=$(usex python)
221 + -DVTK_WRAP_TCL=$(usex tcl)
222 + -DVTK_USE_BOOST=$(usex boost)
223 + -DUSE_VTK_USE_BOOST=$(usex boost)
224 + -DModule_vtkInfovisBoost=$(usex boost)
225 + -DModule_vtkInfovisBoostGraphAlgorithms=$(usex boost)
226 + -DVTK_USE_ODBC=$(usex odbc)
227 + -DModule_vtkIOODBC=$(usex odbc)
228 + -DVTK_USE_OFFSCREEN=$(usex offscreen)
229 + -DVTK_OPENGL_HAS_OSMESA=$(usex offscreen)
230 + -DVTK_USE_OGGTHEORA_ENCODER=$(usex theora)
231 + -DVTK_USE_NVCONTROL=$(usex video_cards_nvidia)
232 + -DModule_vtkFiltersStatisticsGnuR=$(usex R)
233 + -DVTK_USE_X=$(usex X)
234 + # IO
235 + -DVTK_USE_FFMPEG_ENCODER=$(usex ffmpeg)
236 + -DModule_vtkIOGDAL=$(usex gdal)
237 + -DModule_vtkIOGeoJSON=$(usex json)
238 + -DModule_vtkIOXdmf2=$(usex xdmf2)
239 + -DBUILD_TESTING=$(usex examples)
240 + # Apple stuff, does it really work?
241 + -DVTK_USE_COCOA=$(usex aqua)
242 + )
243 +
244 + if use java; then
245 + local javacargs=$(java-pkg_javac-args)
246 + mycmakeargs+=( -DJAVAC_OPTIONS=${javacargs// /;} )
247 + fi
248 +
249 + if use kaapi; then
250 + mycmakeargs+=( -DVTK_SMP_IMPLEMENTATION_TYPE="Kaapi" )
251 + elif use tbb; then
252 + mycmakeargs+=( -DVTK_SMP_IMPLEMENTATION_TYPE="TBB" )
253 + else
254 + mycmakeargs+=( -DVTK_SMP_IMPLEMENTATION_TYPE="Sequential" )
255 + fi
256 +
257 + if use python; then
258 + mycmakeargs+=(
259 + -DVTK_INSTALL_PYTHON_MODULE_DIR="$(python_get_sitedir)"
260 + -DPYTHON_INCLUDE_DIR="$(python_get_includedir)"
261 + -DPYTHON_LIBRARY="$(python_get_library_path)"
262 + -DSIP_PYQT_DIR="${EPREFIX}/usr/share/sip"
263 + -DSIP_INCLUDE_DIR="$(python_get_includedir)"
264 + -DVTK_PYTHON_INCLUDE_DIR="$(python_get_includedir)"
265 + -DVTK_PYTHON_LIBRARY="$(python_get_library_path)"
266 + -DVTK_PYTHON_SETUP_ARGS:STRING="--prefix=${EPREFIX} --root=${D}"
267 + -DVTK_USE_SYSTEM_SIX=ON
268 + )
269 + fi
270 +
271 + if use qt5; then
272 + mycmakeargs+=(
273 + -DVTK_USE_QVTK=ON
274 + -DVTK_USE_QVTK_OPENGL=ON
275 + -DVTK_USE_QVTK_QTOPENGL=ON
276 + -DQT_WRAP_CPP=ON
277 + -DQT_WRAP_UI=ON
278 + -DVTK_INSTALL_QT_DIR="$(qt5_get_libdir)/qt5/plugins/designer"
279 + -DDESIRED_QT_VERSION=5
280 + -DVTK_QT_VERSION=5
281 + -DQT_MOC_EXECUTABLE="$(qt5_get_bindir)/moc"
282 + -DQT_UIC_EXECUTABLE="$(qt5_get_bindir)/uic"
283 + -DQT_INCLUDE_DIR="${EPREFIX}/usr/include/qt5"
284 + -DQT_QMAKE_EXECUTABLE="$(qt5_get_bindir)/qmake"
285 + -DVTK_Group_Qt:BOOL=ON
286 + )
287 + fi
288 +
289 + if use R; then
290 + mycmakeargs+=(
291 + -DR_LIBRARY_BLAS=/usr/$(get_libdir)/R/lib/libR.so
292 + -DR_LIBRARY_LAPACK=/usr/$(get_libdir)/R/lib/libR.so
293 + )
294 + fi
295 +
296 + append-cppflags -D__STDC_CONSTANT_MACROS -D_UNICODE
297 +
298 + use java && export JAVA_HOME="${EPREFIX}/etc/java-config-2/current-system-vm"
299 +
300 + if use mpi; then
301 + export CC=mpicc
302 + export CXX=mpicxx
303 + export FC=mpif90
304 + export F90=mpif90
305 + export F77=mpif77
306 + fi
307 +
308 + cmake-utils_src_configure
309 +}
310 +
311 +src_install() {
312 + use web && webapp_src_preinst
313 +
314 + cmake-utils_src_install
315 +
316 + use java && java-pkg_regjar "${ED%/}"/usr/$(get_libdir)/${PN}.jar
317 +
318 + # Stop web page images from being compressed
319 + use doc && docompress -x /usr/share/doc/${PF}/doxygen
320 +
321 + if use tcl; then
322 + # install Tcl docs
323 + docinto vtk_tcl
324 + dodoc Wrapping/Tcl/README
325 + docinto .
326 + fi
327 +
328 + # install examples
329 + if use examples; then
330 + einfo "Installing examples"
331 + mv -v {E,e}xamples || die
332 + dodoc -r examples
333 + docompress -x /usr/share/doc/${PF}/examples
334 + fi
335 +
336 + # environment
337 + cat >> "${T}"/40${PN} <<- EOF || die
338 + VTK_DATA_ROOT=${EPREFIX}/usr/share/${PN}/data
339 + VTK_DIR=${EPREFIX}/usr/$(get_libdir)/${PN}-${SPV}
340 + VTKHOME=${EPREFIX}/usr
341 + EOF
342 + doenvd "${T}"/40${PN}
343 +
344 + use web && webapp_src_install
345 +}
346 +
347 +# webapp.eclass exports these but we want it optional #534036
348 +pkg_postinst() {
349 + use web && webapp_pkg_postinst
350 +}
351 +
352 +pkg_prerm() {
353 + use web && webapp_pkg_prerm
354 +}