Gentoo Archives: gentoo-commits

From: Matthias Maier <tamiko@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-visualization/paraview/
Date: Thu, 25 Apr 2019 22:11:29
Message-Id: 1556230275.b33b3e60d21c49c0fe9ebb58e607c3a5436a9a1a.tamiko@gentoo
1 commit: b33b3e60d21c49c0fe9ebb58e607c3a5436a9a1a
2 Author: Matthias Maier <tamiko <AT> gentoo <DOT> org>
3 AuthorDate: Thu Apr 25 18:14:10 2019 +0000
4 Commit: Matthias Maier <tamiko <AT> gentoo <DOT> org>
5 CommitDate: Thu Apr 25 22:11:15 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b33b3e60
7
8 sci-visualization/paraview: add USE=offscreen, reorganize configuration, QA
9
10 - Add USE=offscreen
11
12 - Fix QA warnings about unused configuration variables
13
14 - Reorganize configuration variables
15
16 - Add Python 3 support
17
18 Closes: https://bugs.gentoo.org/574072
19 Closes: https://bugs.gentoo.org/659602
20 Package-Manager: Portage-2.3.64, Repoman-2.3.12
21 Signed-off-by: Matthias Maier <tamiko <AT> gentoo.org>
22
23 sci-visualization/paraview/metadata.xml | 5 +-
24 .../paraview/paraview-5.6.0-r1.ebuild | 311 +++++++++++++++++++++
25 2 files changed, 314 insertions(+), 2 deletions(-)
26
27 diff --git a/sci-visualization/paraview/metadata.xml b/sci-visualization/paraview/metadata.xml
28 index d2593b87682..f5e4c3c6676 100644
29 --- a/sci-visualization/paraview/metadata.xml
30 +++ b/sci-visualization/paraview/metadata.xml
31 @@ -7,10 +7,11 @@
32 </maintainer>
33 <use>
34 <flag name="boost">Enable the usage of dev-libs/boost</flag>
35 - <flag name="coprocessing">Enable the coprocessing infrastructure which is mainly useful in the context of clusters</flag>
36 <flag name="cg">Add support for nvidia's cg shaders</flag>
37 + <flag name="coprocessing">Enable the coprocessing infrastructure which is mainly useful in the context of clusters</flag>
38 + <flag name="development">Install development files including headers</flag>
39 <flag name="nvcontrol">Add NVCONTROL support for OpenGL options</flag>
40 + <flag name="offscreen">Offscreen rendering through OSMesa</flag>
41 <flag name="plugins">Build and install additional plugins</flag>
42 - <flag name="development">Install development files including headers</flag>
43 </use>
44 </pkgmetadata>
45
46 diff --git a/sci-visualization/paraview/paraview-5.6.0-r1.ebuild b/sci-visualization/paraview/paraview-5.6.0-r1.ebuild
47 new file mode 100644
48 index 00000000000..dfb0e41082a
49 --- /dev/null
50 +++ b/sci-visualization/paraview/paraview-5.6.0-r1.ebuild
51 @@ -0,0 +1,311 @@
52 +# Copyright 1999-2019 Gentoo Authors
53 +# Distributed under the terms of the GNU General Public License v2
54 +
55 +EAPI=7
56 +
57 +PYTHON_COMPAT=( python{2_7,3_5,3_6} )
58 +inherit cmake-utils desktop gnome2-utils python-single-r1 toolchain-funcs
59 +
60 +MAIN_PV=$(ver_cut 0-1)
61 +MAJOR_PV=$(ver_cut 1-2)
62 +MY_P="ParaView-v${PV}"
63 +
64 +DESCRIPTION="Powerful scientific data visualization application"
65 +HOMEPAGE="https://www.paraview.org"
66 +SRC_URI="https://www.paraview.org/files/v${MAJOR_PV}/${MY_P}.tar.gz"
67 +
68 +LICENSE="paraview GPL-2"
69 +KEYWORDS="~amd64 ~x86"
70 +SLOT="0"
71 +IUSE="boost cg coprocessing development doc examples ffmpeg mpi mysql nvcontrol openmp offscreen plugins python +qt5 sqlite tcl test tk"
72 +
73 +RESTRICT="mirror test"
74 +
75 +# "vtksqlite, needed by vtkIOSQL" and "vtkIOSQL, needed by vtkIOMySQL"
76 +REQUIRED_USE="python? ( mpi ${PYTHON_REQUIRED_USE} )
77 + mysql? ( sqlite )
78 + ?? ( offscreen qt5 )"
79 +
80 +RDEPEND="
81 + app-arch/lz4
82 + dev-libs/expat
83 + dev-libs/jsoncpp
84 + dev-libs/libxml2:2
85 + dev-libs/protobuf
86 + dev-libs/pugixml
87 + media-libs/freetype
88 + media-libs/glew:0
89 + media-libs/libpng:0
90 + media-libs/libtheora
91 + media-libs/tiff:0=
92 + sci-libs/cgnslib
93 + sci-libs/hdf5[mpi=]
94 + >=sci-libs/netcdf-4.2[hdf5]
95 + >=sci-libs/netcdf-cxx-4.2:3
96 + sci-libs/xdmf2
97 + sys-libs/zlib
98 + virtual/glu
99 + virtual/jpeg:0
100 + x11-libs/libX11
101 + x11-libs/libXext
102 + x11-libs/libXmu
103 + x11-libs/libXt
104 + coprocessing? (
105 + plugins? (
106 + dev-python/PyQt5
107 + dev-qt/qtgui:5[-gles2]
108 + )
109 + )
110 + ffmpeg? ( virtual/ffmpeg )
111 + mpi? ( virtual/mpi[cxx,romio] )
112 + mysql? ( dev-db/mysql-connector-c )
113 + offscreen? ( >=media-libs/mesa-18.3.6[osmesa] )
114 + !offscreen? ( virtual/opengl )
115 + python? (
116 + ${PYTHON_DEPS}
117 + dev-python/constantly[${PYTHON_USEDEP}]
118 + dev-python/incremental[${PYTHON_USEDEP}]
119 + dev-python/matplotlib[${PYTHON_USEDEP}]
120 + dev-python/numpy[${PYTHON_USEDEP}]
121 + dev-python/pygments[${PYTHON_USEDEP}]
122 + dev-python/sip[${PYTHON_USEDEP}]
123 + dev-python/six[${PYTHON_USEDEP}]
124 + || ( dev-python/twisted[${PYTHON_USEDEP}]
125 + dev-python/twisted-core[${PYTHON_USEDEP}]
126 + )
127 + dev-python/zope-interface[${PYTHON_USEDEP}]
128 + mpi? ( dev-python/mpi4py )
129 + qt5? ( dev-python/PyQt5[opengl,webkit,${PYTHON_USEDEP}] )
130 + )
131 + qt5? (
132 + dev-qt/designer:5
133 + dev-qt/qtgui:5[-gles2]
134 + dev-qt/qthelp:5
135 + dev-qt/qtopengl:5[-gles2]
136 + dev-qt/qtsql:5
137 + dev-qt/qttest:5
138 + dev-qt/qtwebkit:5
139 + dev-qt/qtx11extras:5
140 + )
141 + sqlite? ( dev-db/sqlite:3 )
142 + tcl? ( dev-lang/tcl:0= )
143 + tk? ( dev-lang/tk:0= )"
144 +DEPEND="${RDEPEND}
145 + ${PYTHON_DEPS}
146 + boost? ( dev-libs/boost[mpi?,${PYTHON_USEDEP}] )
147 + doc? ( app-doc/doxygen )"
148 +
149 +S="${WORKDIR}/${MY_P}"
150 +
151 +PATCHES=(
152 + "${FILESDIR}"/${PN}-4.0.1-xdmf-cstring.patch
153 + "${FILESDIR}"/${PN}-5.3.0-fix_buildsystem.patch
154 + "${FILESDIR}"/${PN}-5.5.0-allow_custom_build_type.patch
155 +)
156 +
157 +pkg_setup() {
158 + [[ ${MERGE_TYPE} != "binary" ]] && use openmp && tc-check-openmp
159 + python-single-r1_pkg_setup
160 + PVLIBDIR=$(get_libdir)/${PN}-${MAJOR_PV}
161 +}
162 +
163 +src_prepare() {
164 +
165 + # Bug #661812
166 + mkdir -p Plugins/StreamLinesRepresentation/doc || die
167 +
168 + cmake-utils_src_prepare
169 +
170 + # lib64 fixes
171 + sed -i \
172 + -e "s:/lib/python:/$(get_libdir)/python:g" \
173 + VTK/ThirdParty/xdmf3/vtkxdmf3/CMakeLists.txt || die
174 + sed -i \
175 + -e "s:lib/paraview-:$(get_libdir)/paraview-:g" \
176 + ParaViewCore/ServerManager/SMApplication/vtkInitializationHelper.cxx || die
177 +}
178 +
179 +src_configure() {
180 + if use qt5; then
181 + export QT_SELECT=qt5
182 + fi
183 +
184 + local mycmakeargs=(
185 + -DCMAKE_INSTALL_LIBDIR="${PVLIBDIR}"
186 + -DCMAKE_INSTALL_PREFIX="${EPREFIX}"/usr
187 + -DEXPAT_INCLUDE_DIR="${EPREFIX}"/usr/include
188 + -DEXPAT_LIBRARY="${EPREFIX}"/usr/$(get_libdir)/libexpat.so
189 + -DBUILD_SHARED_LIBS=ON
190 + -DCMAKE_COLOR_MAKEFILE=TRUE
191 + -DCMAKE_VERBOSE_MAKEFILE=ON
192 +
193 + -DVTK_Group_StandAlone=ON
194 + -DVTK_DEFAULT_RENDER_WINDOW_OFFSCREEN=TRUE
195 +
196 + -DVTK_USE_OGGTHEORA_ENCODER=TRUE
197 + -DVTK_USE_SYSTEM_CGNS=ON
198 + -DVTK_USE_SYSTEM_PUGIXML=ON
199 + -DVTK_USE_SYSTEM_EXPAT=ON
200 + -DVTK_USE_SYSTEM_FREETYPE=ON
201 + -DVTK_USE_SYSTEM_GL2PS=OFF # doesn't compile, requires modified sources
202 + -DVTK_USE_SYSTEM_GLEW=ON
203 + -DVTK_USE_SYSTEM_HDF5=ON
204 + -DVTK_USE_SYSTEM_JPEG=ON
205 + -DVTK_USE_SYSTEM_JSONCPP=ON
206 + -DVTK_USE_SYSTEM_LIBXML2=ON
207 + -DVTK_USE_SYSTEM_LZ4=ON
208 + -DVTK_USE_SYSTEM_NETCDF=ON
209 + -DVTK_USE_SYSTEM_PNG=ON
210 + -DVTK_USE_SYSTEM_PROTOBUF=ON
211 + -DVTK_USE_SYSTEM_TIFF=ON
212 + -DVTK_USE_SYSTEM_XDMF2=OFF # does not compile with sci-libs/xdmf2-1.0_p141226
213 + -DVTK_USE_SYSTEM_ZLIB=ON
214 +
215 + # boost
216 + -DModule_vtkInfovisBoost="$(usex boost)"
217 +
218 + # coprocessing
219 + -DPARAVIEW_ENABLE_CATALYST="$(usex coprocessing)"
220 +
221 + # doc
222 + -DBUILD_DOCUMENTATION="$(usex doc)"
223 +
224 + # examples
225 + -DBUILD_EXAMPLES="$(usex examples)"
226 +
227 + # ffmpeg
228 + -DPARAVIEW_ENABLE_FFMPEG="$(usex ffmpeg)"
229 + -DVTK_USE_FFMPEG_ENCODER="$(usex ffmpeg)"
230 + -DModule_vtkIOFFMPEG="$(usex ffmpeg)"
231 +
232 + # mpi
233 + -DPARAVIEW_USE_ICE_T="$(usex mpi)"
234 + -DPARAVIEW_USE_MPI_SSEND="$(usex mpi)"
235 + -DPARAVIEW_USE_MPI="$(usex mpi)"
236 + -DVTK_Group_MPI="$(usex mpi)"
237 + -DVTK_XDMF_USE_MPI="$(usex mpi)"
238 + -DXDMF_BUILD_MPI="$(usex mpi)"
239 +
240 + # mysql
241 + -DModule_vtkIOMySQL="$(usex mysql)"
242 +
243 + # offscreen
244 + -DVTK_USE_X=$(usex !offscreen)
245 + -DVTK_OPENGL_HAS_OSMESA=$(usex offscreen)
246 + -DVTK_OPENGL_HAS_OSMESA=$(usex offscreen)
247 +
248 + # plugins
249 + -DPARAVIEW_BUILD_PLUGIN_AdiosReader="$(usex plugins)"
250 + -DPARAVIEW_BUILD_PLUGIN_AnalyzeNIfTIIO="$(usex plugins)"
251 + -DPARAVIEW_BUILD_PLUGIN_ArrowGlyph="$(usex plugins)"
252 + -DPARAVIEW_BUILD_PLUGIN_EyeDomeLighting="$(usex plugins)"
253 + -DPARAVIEW_BUILD_PLUGIN_GMVReader="$(usex plugins)"
254 + -DPARAVIEW_BUILD_PLUGIN_Moments="$(usex plugins)"
255 + -DPARAVIEW_BUILD_PLUGIN_NonOrthogonalSource="$(usex plugins)"
256 + -DPARAVIEW_BUILD_PLUGIN_PacMan="$(usex plugins)"
257 + -DPARAVIEW_BUILD_PLUGIN_SierraPlotTools="$(usex plugins)"
258 + -DPARAVIEW_BUILD_PLUGIN_SLACTools="$(usex plugins)"
259 + -DPARAVIEW_BUILD_PLUGIN_StreamingParticles="$(usex plugins)"
260 + -DPARAVIEW_BUILD_PLUGIN_SurfaceLIC="$(usex plugins)"
261 + # these are always needed for plugins
262 + -DModule_vtkFiltersFlowPaths="$(usex plugins)"
263 + -DModule_vtkPVServerManagerApplication="$(usex plugins)"
264 + # force this module due to incorrect build system deps wrt bug 460528
265 + -DModule_vtkUtilitiesProcessXML=ON
266 +
267 + # python
268 + -DModule_pqPython="$(usex python)"
269 + -DModule_vtkmpi4py="$(usex python)"
270 + -DModule_vtkPython="$(usex python)"
271 + -DModule_vtkWrappingPythonCore="$(usex python)"
272 + -DPARAVIEW_ENABLE_PYTHON="$(usex python)"
273 + -DXDMF_WRAP_PYTHON="$(usex python)"
274 +
275 + # qt5
276 + -DPARAVIEW_INSTALL_DEVELOPMENT_FILES="$(usex development)"
277 + -DModule_vtkGUISupportQtSQL="$(usex qt5)"
278 + -DModule_vtkRenderingQt="$(usex qt5)"
279 + -DModule_vtkViewsQt="$(usex qt5)"
280 + -DPARAVIEW_BUILD_QT_GUI="$(usex qt5)"
281 + -DVTK_Group_ParaViewQt="$(usex qt5)"
282 + -DVTK_Group_Qt="$(usex qt5)"
283 + -DModule_pqPython="$(usex qt5 "$(usex python)" "off")"
284 + $(usex qt5 "-DPARAVIEW_QT_VERSION=5" "")
285 + -DVTK_USE_NVCONTROL="$(usex nvcontrol)"
286 +
287 + # sqlite
288 + -DModule_vtksqlite="$(usex sqlite)"
289 +
290 + # tcl
291 + -DModule_vtkTclTk="$(usex tcl)"
292 +
293 + # test
294 + -DBUILD_TESTING="$(usex test)"
295 +
296 + # tk
297 + -DVTK_Group_Tk="$(usex tk)"
298 + -DVTK_USE_TK="$(usex tk)"
299 + -DModule_vtkRenderingTk="$(usex tk)"
300 + )
301 +
302 + if use openmp; then
303 + mycmakeargs+=( -DVTK_SMP_IMPLEMENTATION_TYPE=OpenMP )
304 + fi
305 +
306 + if use python; then
307 + mycmakeargs+=(
308 + -DVTK_USE_SYSTEM_TWISTED=ON
309 + -DVTK_USE_SYSTEM_AUTOBAHN=ON
310 + -DVTK_USE_SYSTEM_ZOPE=ON
311 + )
312 + fi
313 +
314 + if use qt5; then
315 + mycmakeargs+=(
316 + -DVTK_USE_QVTK=ON
317 + -DOPENGL_gl_LIBRARY="${EPREFIX}"/usr/$(get_libdir)/libGL.so
318 + -DOPENGL_glu_LIBRARY="${EPREFIX}"/usr/$(get_libdir)/libGLU.so
319 + -DVTK_QT_VERSION=5
320 + -DQT_MOC_EXECUTABLE="$(qt5_get_bindir)/moc"
321 + -DQT_UIC_EXECUTABLE="$(qt5_get_bindir)/uic"
322 + -DQT_QMAKE_EXECUTABLE="$(qt5_get_bindir)/qmake"
323 + -DVTK_Group_Qt:BOOL=ON
324 + )
325 + fi
326 +
327 + cmake-utils_src_configure
328 +}
329 +
330 +src_install() {
331 + cmake-utils_src_install
332 +
333 + # remove wrapper binaries and put the actual executable in place
334 + for i in {paraview-config,pvserver,pvdataserver,pvrenderserver,pvbatch,pvpython,paraview}; do
335 + if [ -f "${ED}"/usr/lib/"$i" ]; then
336 + mv "${ED}"/usr/lib/"$i" "${ED}"/usr/bin/"$i" || die
337 + fi
338 + done
339 +
340 + # install libraries into correct directory respecting get_libdir:
341 + mv "${ED}"/usr/lib "${ED}"/usr/lib_tmp || die
342 + mkdir -p "${ED}"/usr/"${PVLIBDIR}" || die
343 + mv "${ED}"/usr/lib_tmp/* "${ED}"/usr/"${PVLIBDIR}" || die
344 + rmdir "${ED}"/usr/lib_tmp || die
345 +
346 + # set up the environment
347 + echo "LDPATH=${EPREFIX}/usr/${PVLIBDIR}" > "${T}"/40${PN} || die
348 + doenvd "${T}"/40${PN}
349 +
350 + newicon "${S}"/Applications/ParaView/pvIcon-32x32.png paraview.png
351 + make_desktop_entry paraview "Paraview" paraview
352 +
353 + use python && python_optimize "${D}"/usr/$(get_libdir)/${PN}-${MAJOR_PV}
354 +}
355 +
356 +pkg_postinst() {
357 + gnome2_icon_cache_update
358 +}
359 +
360 +pkg_postrm() {
361 + gnome2_icon_cache_update
362 +}