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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Tue Jan 14 11:08:41 2014 UTC (6 years, 6 months ago) by jlec
Branch: MAIN
Changes since 1.2: +7 -2 lines
sci-libs/vtk: nvidia-settings ist provided by both packages

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

1 # Copyright 1999-2014 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.0.0.ebuild,v 1.2 2014/01/12 09:15:22 jlec Exp $
4
5 EAPI=5
6
7 PYTHON_COMPAT=( python{2_6,2_7} )
8
9 inherit eutils flag-o-matic java-pkg-opt-2 python-single-r1 qt4-r2 versionator toolchain-funcs cmake-utils virtualx
10
11 # Short package version
12 SPV="$(get_version_component_range 1-2)"
13
14 DESCRIPTION="The Visualization Toolkit"
15 HOMEPAGE="http://www.vtk.org/"
16 SRC_URI="
17 http://www.${PN}.org/files/release/${SPV}/${P/_rc/.rc}.tar.gz
18 doc? ( http://www.${PN}.org/files/release/${SPV}/${PN}DocHtml-${PV}.tar.gz )"
19
20 LICENSE="BSD LGPL-2"
21 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
22 SLOT="0"
23 IUSE="
24 aqua boost cg doc examples imaging ffmpeg java mpi mysql odbc
25 offscreen postgres python qt4 rendering test theora tk tcl
26 video_cards_nvidia views R +X"
27
28 REQUIRED_USE="
29 java? ( qt4 )
30 python? ( ${PYTHON_REQUIRED_USE} )
31 tcl? ( rendering )
32 test? ( python )
33 tk? ( tcl )
34 ^^ ( X aqua offscreen )"
35
36 RDEPEND="
37 dev-libs/expat
38 dev-libs/libxml2:2
39 media-libs/freetype
40 media-libs/libpng
41 media-libs/mesa
42 media-libs/libtheora
43 media-libs/tiff
44 sci-libs/exodusii
45 sci-libs/hdf5
46 sci-libs/netcdf-cxx:3
47 sys-libs/zlib
48 virtual/jpeg
49 virtual/opengl
50 >=x11-libs/gl2ps-1.3.8
51 x11-libs/libX11
52 x11-libs/libXmu
53 x11-libs/libXt
54 boost? ( >=dev-libs/boost-1.40.0[mpi?] )
55 cg? ( media-gfx/nvidia-cg-toolkit )
56 examples? (
57 dev-qt/qtcore:4
58 dev-qt/qtgui:4
59 sci-libs/vtkdata
60 )
61 ffmpeg? ( virtual/ffmpeg )
62 java? ( >=virtual/jre-1.5 )
63 mpi? ( virtual/mpi[cxx,romio] )
64 mysql? ( virtual/mysql )
65 odbc? ( dev-db/unixODBC )
66 offscreen? ( media-libs/mesa[osmesa] )
67 postgres? ( dev-db/postgresql-base )
68 python? (
69 ${PYTHON_DEPS}
70 dev-python/sip[${PYTHON_USEDEP}]
71 )
72 qt4? (
73 dev-qt/qtcore:4
74 dev-qt/qtgui:4
75 dev-qt/qtopengl:4
76 dev-qt/qtsql:4
77 dev-qt/qtwebkit:4
78 python? ( dev-python/PyQt4[${PYTHON_USEDEP}] )
79 )
80 tcl? ( dev-lang/tcl )
81 tk? ( dev-lang/tk )
82 video_cards_nvidia? (
83 || (
84 media-video/nvidia-settings
85 x11-drivers/nvidia-drivers[tools]
86 )
87 )
88 R? ( dev-lang/R )"
89 DEPEND="${RDEPEND}
90 doc? ( app-doc/doxygen )
91 java? ( >=virtual/jdk-1.5 )
92 test? ( sci-libs/vtkdata )"
93
94 S="${WORKDIR}"/VTK${PV}
95
96 PATCHES=(
97 "${FILESDIR}"/${P}-cg-path.patch
98 "${FILESDIR}"/${P}-install.patch
99 "${FILESDIR}"/${P}-system.patch
100 "${FILESDIR}"/${P}-netcdf.patch
101 "${FILESDIR}"/${P}-vtkpython.patch
102 )
103
104 RESTRICT=test
105
106 pkg_setup() {
107 use java && java-pkg-opt-2_pkg_setup
108 use python && python-single-r1_pkg_setup
109
110 append-cppflags -D__STDC_CONSTANT_MACROS -D_UNICODE
111 }
112
113 src_prepare() {
114 sed \
115 -e 's:libproj4:libproj:g' \
116 -e 's:lib_proj.h:lib_abi.h:g' \
117 -i CMake/FindLIBPROJ4.cmake || die
118
119 local x
120 for x in expat freetype gl2ps hdf5 jpeg libxml2 netcdf oggtheora png tiff zlib; do
121 rm -r ThirdParty/${x}/vtk${x} || die
122 done
123
124 if use examples || use test; then
125 # Replace relative path ../../../VTKData with
126 # otherwise it will break on symlinks.
127 grep -rl '\.\./\.\./\.\./\.\./VTKData' . | xargs \
128 sed \
129 -e "s|\.\./\.\./\.\./\.\./VTKData|${EPREFIX}/usr/share/vtk/data|g" \
130 -e "s|\.\./\.\./\.\./\.\./\.\./VTKData|${EPREFIX}/usr/share/vtk/data|g" \
131 -i || die
132 fi
133
134 use java && export JAVA_HOME="${EPREFIX}/etc/java-config-2/current-system-vm"
135
136 cmake-utils_src_prepare
137 }
138
139 src_configure() {
140 # general configuration
141 local mycmakeargs=(
142 -Wno-dev
143 # -DCMAKE_SKIP_RPATH=YES
144 -DVTK_DIR="${S}"
145 -DVTK_INSTALL_LIBRARY_DIR=$(get_libdir)
146 -DVTK_DATA_ROOT:PATH="${EPREFIX}/usr/share/${PN}/data"
147 -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
148 -DVTK_CUSTOM_LIBRARY_SUFFIX=""
149 -DBUILD_SHARED_LIBS=ON
150 -DVTK_USE_SYSTEM_EXPAT=ON
151 -DVTK_USE_SYSTEM_FREETYPE=ON
152 -DVTK_USE_SYSTEM_FreeType=ON
153 -DVTK_USE_SYSTEM_GL2PS=ON
154 -DVTK_USE_SYSTEM_HDF5=ON
155 -DVTK_USE_SYSTEM_JPEG=ON
156 -DVTK_USE_SYSTEM_LIBPROJ4=OFF
157 # -DLIBPROJ4_DIR="${EPREFIX}/usr"
158 -DVTK_USE_SYSTEM_LIBXML2=ON
159 -DVTK_USE_SYSTEM_LibXml2=ON
160 -DVTK_USE_SYSTEM_NETCDF=ON
161 -DVTK_USE_SYSTEM_OGGTHEORA=ON
162 -DVTK_USE_SYSTEM_PNG=ON
163 -DVTK_USE_SYSTEM_TIFF=ON
164 # -DVTK_USE_SYSTEM_XDMF2=ON
165 -DVTK_USE_SYSTEM_ZLIB=ON
166 -DVTK_USE_SYSTEM_LIBRARIES=ON
167 -DVTK_USE_GL2PS=ON
168 -DVTK_USE_PARALLEL=ON
169 )
170
171 mycmakeargs+=(
172 -DVTK_EXTRA_COMPILER_WARNINGS=ON
173 -DVTK_Group_StandAlone=ON
174 )
175
176 mycmakeargs+=(
177 $(cmake-utils_use_build doc DOCUMENTATION)
178 $(cmake-utils_use_build examples EXAMPLES)
179 $(cmake-utils_use_build test TESTING)
180 $(cmake-utils_use_build test VTK_BUILD_ALL_MODULES_FOR_TESTS)
181 $(cmake-utils_use doc DOCUMENTATION_HTML_HELP)
182 $(cmake-utils_use imaging VTK_Group_Imaging)
183 $(cmake-utils_use mpi VTK_Group_MPI)
184 $(cmake-utils_use qt4 VTK_Group_Qt)
185 $(cmake-utils_use rendering VTK_Group_Rendering)
186 $(cmake-utils_use tk VTK_Group_Tk)
187 $(cmake-utils_use views VTK_Group_Views)
188 $(cmake-utils_use java VTK_WRAP_JAVA)
189 $(cmake-utils_use python VTK_WRAP_PYTHON)
190 $(cmake-utils_use python VTK_WRAP_PYTHON_SIP)
191 $(cmake-utils_use tcl VTK_WRAP_TCL)
192 # -DVTK_BUILD_ALL_MODULES=ON
193 )
194
195 mycmakeargs+=(
196 $(cmake-utils_use boost VTK_USE_BOOST)
197 $(cmake-utils_use cg VTK_USE_CG_SHADERS)
198 $(cmake-utils_use odbc VTK_USE_ODBC)
199 $(cmake-utils_use offscreen VTK_USE_OFFSCREEN)
200 $(cmake-utils_use offscreen VTK_OPENGL_HAS_OSMESA)
201 $(cmake-utils_use theora VTK_USE_OGGTHEORA_ENCODER)
202 $(cmake-utils_use ffmpeg VTK_USE_FFMPEG_ENCODER)
203 $(cmake-utils_use video_cards_nvidia VTK_USE_NVCONTROL)
204 $(cmake-utils_use R Module_vtkFiltersStatisticsGnuR)
205 $(cmake-utils_use X VTK_USE_X)
206 )
207
208 # Apple stuff, does it really work?
209 mycmakeargs+=( $(cmake-utils_use aqua VTK_USE_COCOA) )
210
211 if use java; then
212 # local _ejavahome=${EPREFIX}/etc/java-config-2/current-system-vm
213 #
214 # mycmakeargs+=(
215 # -DJAVAC=${EPREFIX}/usr/bin/javac
216 # -DJAVAC=$(java-config -c)
217 # -DJAVA_AWT_INCLUDE_PATH=${JAVA_HOME}/include
218 # -DJAVA_INCLUDE_PATH:PATH=${JAVA_HOME}/include
219 # -DJAVA_INCLUDE_PATH2:PATH=${JAVA_HOME}/include/linux
220 # )
221 #
222 if [ "${ARCH}" == "amd64" ]; then
223 mycmakeargs+=( -DJAVA_AWT_LIBRARY="${JAVA_HOME}/jre/lib/${ARCH}/libjawt.so;${JAVA_HOME}/jre/lib/${ARCH}/xawt/libmawt.so" )
224 else
225 mycmakeargs+=( -DJAVA_AWT_LIBRARY="${JAVA_HOME}/jre/lib/i386/libjawt.so;${JAVA_HOME}/jre/lib/i386/xawt/libmawt.so" )
226 fi
227 fi
228 if use python; then
229 mycmakeargs+=(
230 -DPYTHON_INCLUDE_DIR="$(python_get_includedir)"
231 -DPYTHON_LIBRARY="$(python_get_library_path)"
232 -DSIP_PYQT_DIR="${EPREFIX}/usr/share/sip"
233 -DSIP_INCLUDE_DIR="$(python_get_includedir)"
234 -DVTK_PYTHON_INCLUDE_DIR="$(python_get_includedir)"
235 -DVTK_PYTHON_LIBRARY="$(python_get_library_path)"
236 -DVTK_PYTHON_SETUP_ARGS:STRING="--prefix=${PREFIX} --root=${D}"
237 )
238 fi
239
240 if use qt4; then
241 mycmakeargs+=(
242 -DVTK_USE_QVTK=ON
243 -DVTK_USE_QVTK_OPENGL=ON
244 -DVTK_USE_QVTK_QTOPENGL=ON
245 -DQT_WRAP_CPP=ON
246 -DQT_WRAP_UI=ON
247 -DVTK_INSTALL_QT_DIR=/$(get_libdir)/qt4/plugins/designer
248 -DDESIRED_QT_VERSION=4
249 -DQT_MOC_EXECUTABLE="${EPREFIX}/usr/bin/moc"
250 -DQT_UIC_EXECUTABLE="${EPREFIX}/usr/bin/uic"
251 -DQT_INCLUDE_DIR="${EPREFIX}/usr/include/qt4"
252 -DQT_QMAKE_EXECUTABLE="${EPREFIX}/usr/bin/qmake"
253 )
254 fi
255
256 if use R; then
257 mycmakeargs+=(
258 # -DR_LIBRARY_BLAS=$($(tc-getPKG_CONFIG) --libs blas)
259 # -DR_LIBRARY_LAPACK=$($(tc-getPKG_CONFIG) --libs lapack)
260 -DR_LIBRARY_BLAS=/usr/lib64/R/lib/libR.so
261 -DR_LIBRARY_LAPACK=/usr/lib64/R/lib/libR.so
262 )
263 fi
264
265 cmake-utils_src_configure
266
267 cat >> "${BUILD_DIR}"/Utilities/MaterialLibrary/ProcessShader.sh <<- EOF
268 #!${EPREFIX}/bin/bash
269
270 export LD_LIBRARY_PATH="${BUILD_DIR}"/lib
271 "${BUILD_DIR}"/bin/vtkProcessShader \$@
272 EOF
273 chmod 750 "${BUILD_DIR}"/Utilities/MaterialLibrary/ProcessShader.sh || die
274 }
275
276 src_test() {
277 local tcllib
278 ln -sf "${BUILD_DIR}"/lib "${BUILD_DIR}"/lib/Release || die
279 for tcllib in "${BUILD_DIR}"/lib/lib*TCL*so; do
280 ln -sf $(basename "${tcllib}").1 "${tcllib/.so/-${SPV}.so}" || die
281 done
282 export LD_LIBRARY_PATH="${BUILD_DIR}"/lib:"${JAVA_HOME}"/jre/lib/${ARCH}/:"${JAVA_HOME}"/jre/lib/${ARCH}/xawt/
283 local VIRTUALX_COMMAND="cmake-utils_src_test"
284 # local VIRTUALX_COMMAND="cmake-utils_src_test -R Java"
285 # local VIRTUALX_COMMAND="cmake-utils_src_test -I 364,365"
286 virtualmake
287 }
288
289 src_install() {
290 # install docs
291 HTML_DOCS=( "${S}"/README.html )
292
293 cmake-utils_src_install
294
295 use java && java-pkg_regjar "${ED}"/usr/$(get_libdir)/${PN}.jar
296
297 if use tcl; then
298 # install Tcl docs
299 docinto vtk_tcl
300 dodoc "${S}"/Wrapping/Tcl/README
301 fi
302
303 # install examples
304 if use examples; then
305 insinto /usr/share/${PN}
306 mv -v Examples examples || die
307 doins -r examples
308 fi
309
310 #install big docs
311 if use doc; then
312 cd "${WORKDIR}"/html || die
313 rm -f *.md5 || die "Failed to remove superfluous hashes"
314 einfo "Installing API docs. This may take some time."
315 insinto "/usr/share/doc/${PF}/api-docs"
316 doins -r ./*
317 fi
318
319 # environment
320 cat >> "${T}"/40${PN} <<- EOF
321 VTK_DATA_ROOT=${EPREFIX}/usr/share/${PN}/data
322 VTK_DIR=${EPREFIX}/usr/$(get_libdir)/${PN}-${SPV}
323 VTKHOME=${EPREFIX}/usr
324 EOF
325 doenvd "${T}"/40${PN}
326 }

  ViewVC Help
Powered by ViewVC 1.1.20