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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Thu Dec 6 19:36:02 2012 UTC (7 years, 8 months ago) by bicatali
Branch: MAIN
Changes since 1.1: +2 -2 lines
Keyword amd64-linux and x86-linux

(Portage version: 2.2.01.21313-prefix/cvs/Linux x86_64, signed Manifest commit with key 0x13CB1360)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sci-libs/vtk/vtk-5.10.0.ebuild,v 1.1 2012/06/07 14:39:26 jlec Exp $
4
5 EAPI=3
6
7 PYTHON_DEPEND="python? 2"
8 WANT_CMAKE="always"
9
10 inherit eutils flag-o-matic java-pkg-opt-2 python qt4-r2 versionator toolchain-funcs cmake-utils
11
12 # Short package version
13 SPV="$(get_version_component_range 1-2)"
14
15 DESCRIPTION="The Visualization Toolkit"
16 HOMEPAGE="http://www.vtk.org/"
17 SRC_URI="
18 http://www.${PN}.org/files/release/${SPV}/${P}.tar.gz
19 doc? ( http://www.${PN}.org/files/release/${SPV}/${PN}DocHtml-${PV}.tar.gz )
20 examples? ( http://www.${PN}.org/files/release/${SPV}/${PN}data-${PV}.tar.gz )"
21
22 LICENSE="BSD LGPL-2"
23 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
24 SLOT="0"
25 IUSE="boost chemistry cg doc examples ffmpeg java mpi mysql odbc patented postgres python qt4 R theora threads tk video_cards_nvidia X"
26
27 RDEPEND="
28 dev-libs/expat
29 dev-libs/libxml2:2
30 media-libs/freetype
31 media-libs/libpng
32 media-libs/mesa
33 media-libs/tiff
34 sci-libs/hdf5
35 sys-libs/zlib
36 virtual/jpeg
37 virtual/opengl
38 x11-libs/libX11
39 x11-libs/libXmu
40 x11-libs/libXt
41 cg? ( media-gfx/nvidia-cg-toolkit )
42 examples? (
43 x11-libs/qt-core:4[qt3support]
44 x11-libs/qt-gui:4[qt3support] )
45 ffmpeg? ( virtual/ffmpeg )
46 java? ( >=virtual/jre-1.5 )
47 mpi? ( virtual/mpi[cxx,romio] )
48 mysql? ( virtual/mysql )
49 odbc? ( dev-db/unixODBC )
50 postgres? ( dev-db/postgresql-base )
51 python? ( dev-python/sip )
52 qt4? (
53 x11-libs/qt-core:4
54 x11-libs/qt-gui:4
55 x11-libs/qt-opengl:4
56 x11-libs/qt-sql:4
57 x11-libs/qt-webkit:4
58 python? ( dev-python/PyQt4 )
59 )
60 tk? ( dev-lang/tk )
61 theora? ( media-libs/libtheora )
62 tk? ( dev-lang/tk )
63 video_cards_nvidia? ( media-video/nvidia-settings )
64 R? ( dev-lang/R )"
65 DEPEND="${RDEPEND}
66 java? ( >=virtual/jdk-1.5 )
67 boost? ( >=dev-libs/boost-1.40.0[mpi?] )
68 dev-util/cmake"
69
70 S="${WORKDIR}"/VTK
71
72 PATCHES=(
73 "${FILESDIR}"/${PN}-5.6.0-cg-path.patch
74 "${FILESDIR}"/${PN}-5.2.0-tcl-install.patch
75 "${FILESDIR}"/${PN}-5.8.0-R.patch
76 "${FILESDIR}"/${PN}-5.6.0-odbc.patch
77 "${FILESDIR}"/${PN}-5.6.1-ffmpeg.patch
78 "${FILESDIR}"/${PN}-5.6.1-libav-0.8.patch
79 )
80
81 pkg_setup() {
82 echo
83 einfo "Please note that the VTK build occasionally fails when"
84 einfo "using parallel make. Hence, if you experience a build"
85 einfo "failure please try re-emerging with MAKEOPTS=\"-j1\" first."
86 echo
87
88 java-pkg-opt-2_pkg_setup
89
90 use python && python_set_active_version 2
91 append-cppflags -D__STDC_CONSTANT_MACROS
92 }
93
94 src_configure() {
95 # general configuration
96 local mycmakeargs=(
97 -Wno-dev
98 -DVTK_INSTALL_PACKAGE_DIR=/$(get_libdir)/${PN}-${SPV}
99 -DCMAKE_SKIP_RPATH=YES
100 -DVTK_DIR="${S}"
101 -DVTK_INSTALL_LIB_DIR=/$(get_libdir)/
102 -DVTK_DATA_ROOT:PATH="${EPREFIX}/usr/share/${PN}/data"
103 -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
104 -DBUILD_SHARED_LIBS=ON
105 -DVTK_USE_SYSTEM_EXPAT=ON
106 -DVTK_USE_SYSTEM_FREETYPE=ON
107 -DVTK_USE_SYSTEM_JPEG=ON
108 -DVTK_USE_SYSTEM_LIBXML2=ON
109 -DVTK_USE_SYSTEM_PNG=ON
110 -DVTK_USE_SYSTEM_TIFF=ON
111 -DVTK_USE_SYSTEM_ZLIB=ON
112 -DVTK_USE_SYSTEM_HDF5=ON
113 -DHDF5_LIBRARY="${EPREFIX}/usr/$(get_libdir)"
114 -DHDF5_INCLUDE_DIRS="${EPREFIX}/usr/include"
115 -DBUILD_TESTING=OFF
116 -DBUILD_EXAMPLES=OFF
117 -DVTK_USE_HYBRID=ON
118 -DVTK_USE_GL2PS=ON
119 -DVTK_USE_RENDERING=ON)
120
121 # use flag triggered options
122 mycmakeargs+=(
123 $(cmake-utils_use boost VTK_USE_BOOST)
124 $(cmake-utils_use cg VTK_USE_CG_SHADERS)
125 $(cmake-utils_use doc DOCUMENTATION_HTML_HELP)
126 $(cmake-utils_use_build doc DOCUMENTATION)
127 $(cmake-utils_use java VTK_USE_JAVA)
128 $(cmake-utils_use mpi VTK_USE_MPI)
129 $(cmake-utils_use mysql VTK_USE_MYSQL)
130 $(cmake-utils_use patented VTK_USE_PATENTED)
131 $(cmake-utils_use postgres VTK_USE_POSTGRES)
132 $(cmake-utils_use odbc VTK_USE_ODBC)
133 $(cmake-utils_use qt4 VTK_USE_QT)
134 $(cmake-utils_use theora VTK_USE_OGGTHEORA_ENCODER)
135 $(cmake-utils_use ffmpeg VTK_USE_FFMPEG_ENCODER)
136 $(cmake-utils_use tk VTK_USE_TK)
137 $(cmake-utils_use threads VTK_USE_PARALLEL)
138 $(cmake-utils_use video_cards_nvidia VTK_USE_NVCONTROL)
139 $(cmake-utils_use X VTK_USE_X)
140 $(cmake-utils_use X VTK_USE_GUISUPPORT)
141 $(cmake-utils_use R VTK_USE_GNU_R)
142 $(cmake-utils_use chemistry VTK_USE_CHEMISTRY)
143 )
144
145 use tk &&
146 mycmakeargs+=(
147 -DVTK_WRAP_TCL=ON
148 -DVTK_WRAP_TK=ON
149 -DVTK_TCL_INCLUDE_DIR="${EPREFIX}/usr/include"
150 -DVTK_TCL_LIBRARY="${EPREFIX}/usr/$(get_libdir)"
151 -DVTK_TK_INCLUDE_DIR="${EPREFIX}/usr/include"
152 -DVTK_TK_LIBRARY="${EPREFIX}/usr/$(get_libdir)"
153 )
154
155 use theora &&
156 mycmakeargs+=(-DVTK_USE_SYSTEM_OGGTHEORA=ON)
157
158 # mpi needs the parallel framework
159 if use mpi && use !threads; then
160 mycmakeargs+=(-DVTK_USE_PARALLEL=ON)
161 fi
162
163 if use java; then
164 mycmakeargs+=(
165 -DVTK_WRAP_JAVA=ON
166 -DJAVA_AWT_INCLUDE_PATH=`java-config -O`/include
167 -DJAVA_INCLUDE_PATH:PATH=`java-config -O`/include
168 -DJAVA_INCLUDE_PATH2:PATH=`java-config -O`/include/linux
169 )
170
171 if [ "${ARCH}" == "amd64" ]; then
172 mycmakeargs+=(-DJAVA_AWT_LIBRARY=`java-config -O`/jre/lib/${ARCH}/libjawt.so)
173 else
174 mycmakeargs+=(-DJAVA_AWT_LIBRARY:PATH=`java-config -O`/jre/lib/i386/libjawt.so)
175 fi
176 fi
177
178 if use python; then
179 mycmakeargs+=(
180 -DPYTHON_INCLUDE_DIR="${EPREFIX}"$(python_get_includedir)
181 -DPYTHON_LIBRARY="${EPREFIX}$(python_get_library)"
182 -DVTK_WRAP_PYTHON=ON
183 -DVTK_WRAP_PYTHON_SIP=ON
184 -DSIP_PYQT_DIR="${EPREFIX}/usr/share/sip"
185 -DSIP_INCLUDE_DIR="${EPREFIX}$(python_get_includedir)"
186 -DPYTHON_INCLUDE_DIR="${EPREFIX}$(python_get_includedir)"
187 -DPYTHON_LIBRARY="${EPREFIX}$(python_get_library)"
188 -DVTK_PYTHON_INCLUDE_DIR="${EPREFIX}$(python_get_includedir)"
189 -DVTK_PYTHON_LIBRARY="${EPREFIX}$(python_get_library)"
190 -DVTK_PYTHON_SETUP_ARGS:STRING=--root="${D}")
191 fi
192
193 if use qt4 ; then
194 mycmakeargs+=(
195 -DVTK_USE_GUISUPPORT=ON
196 -DVTK_USE_QVTK=ON
197 -DVTK_USE_QVTK_OPENGL=ON
198 -DVTK_USE_QVTK_QTOPENGL=ON
199 -DQT_WRAP_CPP=ON
200 -DQT_WRAP_UI=ON
201 -DVTK_INSTALL_QT_DIR=/$(get_libdir)/qt4/plugins/${PN}
202 -DDESIRED_QT_VERSION=4
203 -DQT_MOC_EXECUTABLE="${EPREFIX}/usr/bin/moc"
204 -DQT_UIC_EXECUTABLE="${EPREFIX}/usr/bin/uic"
205 -DQT_INCLUDE_DIR="${EPREFIX}/usr/include/qt4"
206 -DQT_QMAKE_EXECUTABLE="${EPREFIX}/usr/bin/qmake")
207 fi
208
209 cmake-utils_src_configure
210 }
211
212 src_install() {
213 cmake-utils_src_install
214
215 # install docs
216 dohtml "${S}"/README.html || die "Failed to install docs"
217
218 # install Tcl docs
219 docinto vtk_tcl
220 dodoc "${S}"/Wrapping/Tcl/README || \
221 die "Failed to install Tcl docs"
222
223 # install examples
224 if use examples; then
225 insinto /usr/share/${PN}
226 mv -v Examples examples
227 doins -r examples || die
228 mv -v "${WORKDIR}"/{VTKData,data} || die
229 doins -r "${WORKDIR}"/data || die
230 fi
231
232 #install big docs
233 if use doc; then
234 cd "${WORKDIR}"/html
235 rm -f *.md5 || die "Failed to remove superfluous hashes"
236 einfo "Installing API docs. This may take some time."
237 insinto "/usr/share/doc/${PF}/api-docs"
238 doins -r ./* || die "Failed to install docs"
239 fi
240
241 # environment
242 cat >> "${T}"/40${PN} <<- EOF
243 VTK_DATA_ROOT=${EPREFIX}/usr/share/${PN}/data
244 VTK_DIR=${EPREFIX}/usr/$(get_libdir)/${PN}-${SPV}
245 VTKHOME=${EPREFIX}/usr
246 EOF
247 doenvd "${T}"/40${PN}
248 }
249
250 pkg_postinst() {
251 if use patented; then
252 ewarn "Using patented code in VTK may require a license."
253 ewarn "For more information, please read:"
254 ewarn "http://public.kitware.com/cgi-bin/vtkfaq?req=show&file=faq07.005.htp"
255 fi
256
257 if use python; then
258 python_mod_optimize vtk
259 fi
260 }
261
262 pkg_postrm() {
263 if use python; then
264 python_mod_cleanup vtk
265 fi
266 }

  ViewVC Help
Powered by ViewVC 1.1.20