/[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.5 - (show annotations) (download)
Sat Jan 25 13:23:40 2014 UTC (6 years, 6 months ago) by jlec
Branch: MAIN
Changes since 1.4: +2 -1 lines
sci-libs/vtk: Add missing dep for qt (dev-qt/designer)

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

  ViewVC Help
Powered by ViewVC 1.1.20