Gentoo Archives: gentoo-commits

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