/[gentoo-x86]/sci-libs/vtk/vtk-6.1.0-r1.ebuild
Gentoo

Contents of /sci-libs/vtk/vtk-6.1.0-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (show annotations) (download)
Wed Apr 8 18:49:15 2015 UTC (5 years, 4 months ago) by mgorny
Branch: MAIN
CVS Tags: HEAD
Changes since 1.9: +2 -2 lines
Drop old Python implementations

(Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key EFB4464E!)

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sci-libs/vtk/vtk-6.1.0-r1.ebuild,v 1.9 2015/03/20 15:19:16 jlec Exp $
4
5 EAPI=5
6
7 PYTHON_COMPAT=( python2_7 )
8 CMAKE_MAKEFILE_GENERATOR=ninja
9 WEBAPP_OPTIONAL=yes
10 WEBAPP_MANUAL_SLOT=yes
11
12 inherit eutils flag-o-matic java-pkg-opt-2 python-single-r1 qmake-utils versionator toolchain-funcs cmake-utils virtualx webapp
13
14 # Short package version
15 SPV="$(get_version_component_range 1-2)"
16
17 DESCRIPTION="The Visualization Toolkit"
18 HOMEPAGE="http://www.vtk.org/"
19 SRC_URI="
20 http://www.${PN}.org/files/release/${SPV}/VTK-${PV}.tar.gz
21 doc? ( http://www.${PN}.org/files/release/${SPV}/${PN}DocHtml-${PV}.tar.gz )
22 test? (
23 http://www.${PN}.org/files/release/${SPV}/VTKData-${PV}.tar.gz
24 http://www.${PN}.org/files/release/${SPV}/VTKLargeData-${PV}.tar.gz
25 )
26 "
27
28 LICENSE="BSD LGPL-2"
29 KEYWORDS="amd64 ~arm x86 ~amd64-linux ~x86-linux"
30 SLOT="0"
31 IUSE="
32 all-modules aqua boost cg doc examples imaging ffmpeg gdal java json kaapi mpi
33 mysql odbc offscreen postgres python qt4 rendering smp tbb test theora tk tcl
34 video_cards_nvidia views web xdmf2 R +X"
35
36 REQUIRED_USE="
37 all-modules? ( python xdmf2 )
38 java? ( qt4 )
39 python? ( ${PYTHON_REQUIRED_USE} )
40 tcl? ( rendering )
41 smp? ( ^^ ( kaapi tbb ) )
42 test? ( python )
43 tk? ( tcl )
44 web? ( python )
45 ^^ ( X aqua offscreen )
46 "
47
48 RDEPEND="
49 dev-libs/expat
50 dev-libs/jsoncpp
51 dev-libs/libxml2:2
52 >=media-libs/freetype-2.5.4
53 media-libs/libpng:0
54 media-libs/mesa
55 media-libs/libtheora
56 media-libs/tiff:0
57 sci-libs/exodusii
58 sci-libs/hdf5:=
59 sci-libs/netcdf-cxx:3
60 sys-libs/zlib
61 virtual/jpeg:0
62 virtual/opengl
63 >=x11-libs/gl2ps-1.3.8
64 x11-libs/libX11
65 x11-libs/libXmu
66 x11-libs/libXt
67 boost? ( >=dev-libs/boost-1.40.0[mpi?] )
68 cg? ( media-gfx/nvidia-cg-toolkit )
69 examples? (
70 dev-qt/qtcore:4
71 dev-qt/qtgui:4
72 sci-libs/vtkdata
73 )
74 ffmpeg? ( virtual/ffmpeg )
75 gdal? ( sci-libs/gdal )
76 java? ( >=virtual/jre-1.5:* )
77 kaapi? ( <sci-libs/xkaapi-3 )
78 mpi? (
79 virtual/mpi[cxx,romio]
80 python? ( dev-python/mpi4py[${PYTHON_USEDEP}] )
81 mysql? ( virtual/mysql )
82 odbc? ( dev-db/unixODBC )
83 offscreen? ( media-libs/mesa[osmesa] )
84 postgres? ( dev-db/postgresql:= )
85 python? (
86 ${PYTHON_DEPS}
87 dev-python/sip[${PYTHON_USEDEP}]
88 )
89 )
90 qt4? (
91 dev-qt/designer:4
92 dev-qt/qtcore:4
93 dev-qt/qtgui:4
94 dev-qt/qtopengl:4
95 dev-qt/qtsql:4
96 dev-qt/qtwebkit:4
97 python? ( dev-python/PyQt4[${PYTHON_USEDEP}] )
98 )
99 tbb? ( dev-cpp/tbb )
100 tcl? ( dev-lang/tcl:0= )
101 tk? ( dev-lang/tk:0= )
102 video_cards_nvidia? ( media-video/nvidia-settings )
103 web? (
104 ${WEBAPP_DEPEND}
105 python? (
106 dev-python/autobahn[${PYTHON_USEDEP}]
107 dev-python/twisted-core[${PYTHON_USEDEP}]
108 dev-python/zope-interface[${PYTHON_USEDEP}]
109 )
110 )
111 xdmf2? ( sci-libs/xdmf2 )
112 R? ( dev-lang/R )"
113 DEPEND="${RDEPEND}
114 doc? ( app-doc/doxygen )
115 java? ( >=virtual/jdk-1.5 )"
116
117 S="${WORKDIR}"/VTK-${PV}
118
119 PATCHES=(
120 "${FILESDIR}"/${P}-freetype.patch
121 "${FILESDIR}"/${P}-install.patch
122 "${FILESDIR}"/${P}-system.patch
123 "${FILESDIR}"/${P}-netcdf.patch
124 "${FILESDIR}"/${P}-web.patch
125 "${FILESDIR}"/${P}-glext.patch
126 "${FILESDIR}"/${P}-memset.patch
127 )
128
129 RESTRICT=test
130
131 pkg_setup() {
132 use java && java-pkg-opt-2_pkg_setup
133 use python && python-single-r1_pkg_setup
134 use web && webapp_pkg_setup
135
136 append-cppflags -D__STDC_CONSTANT_MACROS -D_UNICODE
137 }
138
139 src_prepare() {
140 sed \
141 -e 's:libproj4:libproj:g' \
142 -e 's:lib_proj.h:lib_abi.h:g' \
143 -i CMake/FindLIBPROJ4.cmake || die
144
145 local x
146 # missing: VPIC alglib exodusII freerange ftgl libproj4 mrmpi sqlite utf8 verdict xmdf2 xmdf3
147 for x in expat freetype gl2ps hdf5 jpeg jsoncpp libxml2 netcdf oggtheora png tiff zlib; do
148 ebegin "Dropping bundled ${x}"
149 rm -r ThirdParty/${x}/vtk${x} || die
150 eend $?
151 done
152 rm -r \
153 ThirdParty/AutobahnPython/autobahn \
154 ThirdParty/Twisted/twisted \
155 ThirdParty/ZopeInterface/zope \
156 || die
157
158 use java && export JAVA_HOME="${EPREFIX}/etc/java-config-2/current-system-vm"
159
160 if use mpi; then
161 export CC=mpicc
162 export CXX=mpicxx
163 export FC=mpif90
164 export F90=mpif90
165 export F77=mpif77
166 fi
167
168 cmake-utils_src_prepare
169 }
170
171 src_configure() {
172 # general configuration
173 local mycmakeargs=(
174 -Wno-dev
175 # -DCMAKE_SKIP_RPATH=YES
176 -DVTK_DIR="${S}"
177 -DVTK_INSTALL_LIBRARY_DIR=$(get_libdir)
178 -DVTK_DATA_ROOT:PATH="${EPREFIX}/usr/share/${PN}/data"
179 -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
180 -DVTK_CUSTOM_LIBRARY_SUFFIX=""
181 -DBUILD_SHARED_LIBS=ON
182 -DVTK_USE_SYSTEM_AUTOBAHN=ON
183 -DVTK_USE_SYSTEM_EXPAT=ON
184 -DVTK_USE_SYSTEM_FREETYPE=ON
185 -DVTK_USE_SYSTEM_FreeType=ON
186 -DVTK_USE_SYSTEM_GL2PS=ON
187 -DVTK_USE_SYSTEM_HDF5=ON
188 -DVTK_USE_SYSTEM_JPEG=ON
189 -DVTK_USE_SYSTEM_LIBPROJ4=OFF
190 # -DLIBPROJ4_DIR="${EPREFIX}/usr"
191 -DVTK_USE_SYSTEM_LIBXML2=ON
192 -DVTK_USE_SYSTEM_LibXml2=ON
193 -DVTK_USE_SYSTEM_NETCDF=ON
194 -DVTK_USE_SYSTEM_OGGTHEORA=ON
195 -DVTK_USE_SYSTEM_PNG=ON
196 -DVTK_USE_SYSTEM_TIFF=ON
197 -DVTK_USE_SYSTEM_TWISTED=ON
198 -DVTK_USE_SYSTEM_XDMF2=OFF
199 -DVTK_USE_SYSTEM_XDMF3=OFF
200 -DVTK_USE_SYSTEM_ZLIB=ON
201 -DVTK_USE_SYSTEM_ZOPE=ON
202 -DVTK_USE_SYSTEM_LIBRARIES=ON
203 -DVTK_USE_GL2PS=ON
204 -DVTK_USE_LARGE_DATA=ON
205 -DVTK_USE_PARALLEL=ON
206 )
207
208 mycmakeargs+=(
209 -DVTK_EXTRA_COMPILER_WARNINGS=ON
210 -DVTK_Group_StandAlone=ON
211 )
212
213 mycmakeargs+=(
214 $(cmake-utils_use_build doc DOCUMENTATION)
215 $(cmake-utils_use_build examples EXAMPLES)
216 $(cmake-utils_use_build test VTK_BUILD_ALL_MODULES_FOR_TESTS)
217 $(cmake-utils_use all-modules VTK_BUILD_ALL_MODULES)
218 $(cmake-utils_use doc DOCUMENTATION_HTML_HELP)
219 $(cmake-utils_use imaging VTK_Group_Imaging)
220 $(cmake-utils_use mpi VTK_Group_MPI)
221 $(cmake-utils_use qt4 VTK_Group_Qt)
222 $(cmake-utils_use rendering VTK_Group_Rendering)
223 $(cmake-utils_use tk VTK_Group_Tk)
224 $(cmake-utils_use views VTK_Group_Views)
225 $(cmake-utils_use web VTK_Group_Web)
226 $(cmake-utils_use web VTK_WWW_DIR="${ED}/${MY_HTDOCSDIR}")
227 $(cmake-utils_use java VTK_WRAP_JAVA)
228 $(cmake-utils_use python VTK_WRAP_PYTHON)
229 $(cmake-utils_use python VTK_WRAP_PYTHON_SIP)
230 $(cmake-utils_use tcl VTK_WRAP_TCL)
231 )
232
233 mycmakeargs+=(
234 $(cmake-utils_use boost VTK_USE_BOOST)
235 $(cmake-utils_use cg VTK_USE_CG_SHADERS)
236 $(cmake-utils_use odbc VTK_USE_ODBC)
237 $(cmake-utils_use offscreen VTK_USE_OFFSCREEN)
238 $(cmake-utils_use offscreen VTK_OPENGL_HAS_OSMESA)
239 $(cmake-utils_use smp vtkFiltersSMP)
240 $(cmake-utils_use theora VTK_USE_OGGTHEORA_ENCODER)
241 $(cmake-utils_use video_cards_nvidia VTK_USE_NVCONTROL)
242 $(cmake-utils_use R Module_vtkFiltersStatisticsGnuR)
243 $(cmake-utils_use X VTK_USE_X)
244 )
245
246 # IO
247 mycmakeargs+=(
248 $(cmake-utils_use ffmpeg VTK_USE_FFMPEG_ENCODER)
249 $(cmake-utils_use gdal Module_vtkIOGDAL)
250 $(cmake-utils_use json Module_vtkIOGeoJSON)
251 $(cmake-utils_use xdmf2 Module_vtkIOXdmf2)
252 )
253 # Apple stuff, does it really work?
254 mycmakeargs+=( $(cmake-utils_use aqua VTK_USE_COCOA) )
255
256 if use examples || use test; then
257 mycmakeargs+=( -DBUILD_TESTING=ON )
258 fi
259
260 if use kaapi; then
261 mycmakeargs+=( -DVTK_SMP_IMPLEMENTATION_TYPE="Kaapi" )
262 elif use tbb; then
263 mycmakeargs+=( -DVTK_SMP_IMPLEMENTATION_TYPE="TBB" )
264 else
265 mycmakeargs+=( -DVTK_SMP_IMPLEMENTATION_TYPE="Sequential" )
266 fi
267
268 if use java; then
269 # local _ejavahome=${EPREFIX}/etc/java-config-2/current-system-vm
270 #
271 # mycmakeargs+=(
272 # -DJAVAC=${EPREFIX}/usr/bin/javac
273 # -DJAVAC=$(java-config -c)
274 # -DJAVA_AWT_INCLUDE_PATH=${JAVA_HOME}/include
275 # -DJAVA_INCLUDE_PATH:PATH=${JAVA_HOME}/include
276 # -DJAVA_INCLUDE_PATH2:PATH=${JAVA_HOME}/include/linux
277 # )
278 #
279 if [ "${ARCH}" == "amd64" ]; then
280 mycmakeargs+=( -DJAVA_AWT_LIBRARY="${JAVA_HOME}/jre/lib/${ARCH}/libjawt.so;${JAVA_HOME}/jre/lib/${ARCH}/xawt/libmawt.so" )
281 else
282 mycmakeargs+=( -DJAVA_AWT_LIBRARY="${JAVA_HOME}/jre/lib/i386/libjawt.so;${JAVA_HOME}/jre/lib/i386/xawt/libmawt.so" )
283 fi
284 fi
285 if use python; then
286 mycmakeargs+=(
287 -DVTK_INSTALL_PYTHON_MODULE_DIR="$(python_get_sitedir)"
288 -DPYTHON_INCLUDE_DIR="$(python_get_includedir)"
289 -DPYTHON_LIBRARY="$(python_get_library_path)"
290 -DSIP_PYQT_DIR="${EPREFIX}/usr/share/sip"
291 -DSIP_INCLUDE_DIR="$(python_get_includedir)"
292 -DVTK_PYTHON_INCLUDE_DIR="$(python_get_includedir)"
293 -DVTK_PYTHON_LIBRARY="$(python_get_library_path)"
294 -DVTK_PYTHON_SETUP_ARGS:STRING="--prefix=${PREFIX} --root=${D}"
295 )
296 fi
297
298 if use qt4; then
299 mycmakeargs+=(
300 -DVTK_USE_QVTK=ON
301 -DVTK_USE_QVTK_OPENGL=ON
302 -DVTK_USE_QVTK_QTOPENGL=ON
303 -DQT_WRAP_CPP=ON
304 -DQT_WRAP_UI=ON
305 -DVTK_INSTALL_QT_DIR=/$(get_libdir)/qt4/plugins/designer
306 -DDESIRED_QT_VERSION=4
307 -DVTK_QT_VERSION=4
308 -DQT_MOC_EXECUTABLE="$(qt4_get_bindir)/moc"
309 -DQT_UIC_EXECUTABLE="$(qt4_get_bindir)/uic"
310 -DQT_INCLUDE_DIR="${EPREFIX}/usr/include/qt4"
311 -DQT_QMAKE_EXECUTABLE="$(qt4_get_bindir)/qmake"
312 )
313 fi
314
315 if use R; then
316 mycmakeargs+=(
317 # -DR_LIBRARY_BLAS=$($(tc-getPKG_CONFIG) --libs blas)
318 # -DR_LIBRARY_LAPACK=$($(tc-getPKG_CONFIG) --libs lapack)
319 -DR_LIBRARY_BLAS=/usr/$(get_libdir)/R/lib/libR.so
320 -DR_LIBRARY_LAPACK=/usr/$(get_libdir)/R/lib/libR.so
321 )
322 fi
323
324 cmake-utils_src_configure
325 }
326
327 src_test() {
328 local tcllib
329 ln -sf "${BUILD_DIR}"/lib "${BUILD_DIR}"/lib/Release || die
330 for tcllib in "${BUILD_DIR}"/lib/lib*TCL*so; do
331 ln -sf $(basename "${tcllib}").1 "${tcllib/.so/-${SPV}.so}" || die
332 done
333 export LD_LIBRARY_PATH="${BUILD_DIR}"/lib:"${JAVA_HOME}"/jre/lib/${ARCH}/:"${JAVA_HOME}"/jre/lib/${ARCH}/xawt/
334 local VIRTUALX_COMMAND="cmake-utils_src_test"
335 # local VIRTUALX_COMMAND="cmake-utils_src_test -R Java"
336 # local VIRTUALX_COMMAND="cmake-utils_src_test -I 364,365"
337 virtualmake
338 }
339
340 src_install() {
341 use web && webapp_src_preinst
342 # install docs
343 HTML_DOCS=( "${S}"/README.html )
344
345 cmake-utils_src_install
346
347 use java && java-pkg_regjar "${ED}"/usr/$(get_libdir)/${PN}.jar
348
349 if use tcl; then
350 # install Tcl docs
351 docinto vtk_tcl
352 dodoc "${S}"/Wrapping/Tcl/README
353 fi
354
355 # install examples
356 if use examples; then
357 insinto /usr/share/${PN}
358 mv -v Examples examples || die
359 doins -r examples
360 fi
361
362 #install big docs
363 if use doc; then
364 cd "${WORKDIR}"/html || die
365 rm -f *.md5 || die "Failed to remove superfluous hashes"
366 einfo "Installing API docs. This may take some time."
367 docinto html
368 dodoc -r ./*
369 fi
370
371 # environment
372 cat >> "${T}"/40${PN} <<- EOF
373 VTK_DATA_ROOT=${EPREFIX}/usr/share/${PN}/data
374 VTK_DIR=${EPREFIX}/usr/$(get_libdir)/${PN}-${SPV}
375 VTKHOME=${EPREFIX}/usr
376 EOF
377 doenvd "${T}"/40${PN}
378
379 use web && webapp_src_install
380 }
381
382 # webapp.eclass exports these but we want it optional #534036
383 pkg_postinst() {
384 use web && webapp_pkg_postinst
385 }
386
387 pkg_prerm() {
388 use web && webapp_pkg_prerm
389 }

  ViewVC Help
Powered by ViewVC 1.1.20