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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20