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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (show annotations) (download)
Tue Sep 4 06:28:56 2012 UTC (7 years, 11 months ago) by jlec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.8: +1 -1 lines
FILE REMOVED
sci-libs/vtk: Drop old

(Portage version: 2.2.0_alpha124/cvs/Linux x86_64)

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.8.0.ebuild,v 1.8 2012/03/20 14:51:41 jer Exp $
4
5 EAPI=3
6
7 PYTHON_DEPEND="python? 2"
8
9 inherit eutils flag-o-matic java-pkg-opt-2 python qt4-r2 versionator toolchain-funcs cmake-utils
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}.tar.gz
18 doc? ( http://www.${PN}.org/doc/release/${SPV}/${PN}DocHtml-${PV}.tar.gz )
19 examples? ( http://www.${PN}.org/files/release/${SPV}/${PN}data-${PV}.tar.gz )"
20
21 LICENSE="BSD LGPL-2"
22 KEYWORDS="~amd64 ~x86"
23 SLOT="0"
24 IUSE="boost cg doc examples ffmpeg java mpi mysql odbc patented postgres python qt4 R theora threads tk video_cards_nvidia X"
25
26 RDEPEND="
27 dev-libs/expat
28 dev-libs/libxml2:2
29 media-libs/freetype
30 media-libs/libpng
31 media-libs/mesa
32 media-libs/tiff
33 sci-libs/hdf5
34 sys-libs/zlib
35 virtual/jpeg
36 virtual/opengl
37 x11-libs/libX11
38 x11-libs/libXmu
39 x11-libs/libXt
40 cg? ( media-gfx/nvidia-cg-toolkit )
41 examples? (
42 x11-libs/qt-core:4[qt3support]
43 x11-libs/qt-gui:4[qt3support] )
44 ffmpeg? ( virtual/ffmpeg )
45 java? ( >=virtual/jre-1.5 )
46 mpi? ( virtual/mpi[cxx,romio] )
47 mysql? ( virtual/mysql )
48 odbc? ( dev-db/unixODBC )
49 postgres? ( dev-db/postgresql-base )
50 python? ( dev-python/sip )
51 qt4? (
52 x11-libs/qt-core:4
53 x11-libs/qt-gui:4
54 x11-libs/qt-opengl:4
55 x11-libs/qt-sql:4
56 x11-libs/qt-webkit:4
57 python? ( dev-python/PyQt4 )
58 )
59 tk? ( dev-lang/tk )
60 theora? ( media-libs/libtheora )
61 tk? ( dev-lang/tk )
62 video_cards_nvidia? ( media-video/nvidia-settings )
63 R? ( dev-lang/R )"
64 DEPEND="${RDEPEND}
65 java? ( >=virtual/jdk-1.5 )
66 boost? ( >=dev-libs/boost-1.40.0[mpi?] )
67 dev-util/cmake"
68
69 S="${WORKDIR}"/VTK
70
71 PATCHES=(
72 "${FILESDIR}"/${PN}-5.6.0-cg-path.patch
73 "${FILESDIR}"/${PN}-5.2.0-tcl-install.patch
74 "${FILESDIR}"/${P}-R.patch
75 "${FILESDIR}"/${PN}-5.6.0-odbc.patch
76 "${FILESDIR}"/${PN}-5.6.1-ffmpeg.patch
77 "${FILESDIR}"/${PN}-5.6.1-libav-0.8.patch
78 "${FILESDIR}"/${P}-boost.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 )
143
144 use tk &&
145 mycmakeargs+=(
146 -DVTK_WRAP_TCL=ON
147 -DVTK_WRAP_TK=ON
148 -DVTK_TCL_INCLUDE_DIR="${EPREFIX}/usr/include"
149 -DVTK_TCL_LIBRARY="${EPREFIX}/usr/$(get_libdir)"
150 -DVTK_TK_INCLUDE_DIR="${EPREFIX}/usr/include"
151 -DVTK_TK_LIBRARY="${EPREFIX}/usr/$(get_libdir)"
152 )
153
154 use theora &&
155 mycmakeargs+=(-DVTK_USE_SYSTEM_OGGTHEORA=ON)
156
157 # mpi needs the parallel framework
158 if use mpi && use !threads; then
159 mycmakeargs+=(-DVTK_USE_PARALLEL=ON)
160 fi
161
162 if use java; then
163 mycmakeargs+=(
164 -DVTK_WRAP_JAVA=ON
165 -DJAVA_AWT_INCLUDE_PATH=`java-config -O`/include
166 -DJAVA_INCLUDE_PATH:PATH=`java-config -O`/include
167 -DJAVA_INCLUDE_PATH2:PATH=`java-config -O`/include/linux
168 )
169
170 if [ "${ARCH}" == "amd64" ]; then
171 mycmakeargs+=(-DJAVA_AWT_LIBRARY=`java-config -O`/jre/lib/${ARCH}/libjawt.so)
172 else
173 mycmakeargs+=(-DJAVA_AWT_LIBRARY:PATH=`java-config -O`/jre/lib/i386/libjawt.so)
174 fi
175 fi
176
177 if use python; then
178 mycmakeargs+=(
179 -DPYTHON_INCLUDE_DIR="${EPREFIX}"$(python_get_includedir)
180 -DPYTHON_LIBRARY="${EPREFIX}$(python_get_library)"
181 -DVTK_WRAP_PYTHON=ON
182 -DVTK_WRAP_PYTHON_SIP=ON
183 -DSIP_PYQT_DIR="${EPREFIX}/usr/share/sip"
184 -DSIP_INCLUDE_DIR="${EPREFIX}$(python_get_includedir)"
185 -DPYTHON_INCLUDE_DIR="${EPREFIX}$(python_get_includedir)"
186 -DPYTHON_LIBRARY="${EPREFIX}$(python_get_library)"
187 -DVTK_PYTHON_INCLUDE_DIR="${EPREFIX}$(python_get_includedir)"
188 -DVTK_PYTHON_LIBRARY="${EPREFIX}$(python_get_library)"
189 -DVTK_PYTHON_SETUP_ARGS:STRING=--root="${D}")
190 fi
191
192 if use qt4 ; then
193 mycmakeargs+=(
194 -DVTK_USE_GUISUPPORT=ON
195 -DVTK_USE_QVTK=ON
196 -DVTK_USE_QVTK_OPENGL=ON
197 -DVTK_USE_QVTK_QTOPENGL=ON
198 -DQT_WRAP_CPP=ON
199 -DQT_WRAP_UI=ON
200 -DVTK_INSTALL_QT_DIR=/$(get_libdir)/qt4/plugins/${PN}
201 -DDESIRED_QT_VERSION=4
202 -DQT_MOC_EXECUTABLE="${EPREFIX}/usr/bin/moc"
203 -DQT_UIC_EXECUTABLE="${EPREFIX}/usr/bin/uic"
204 -DQT_INCLUDE_DIR="${EPREFIX}/usr/include/qt4"
205 -DQT_QMAKE_EXECUTABLE="${EPREFIX}/usr/bin/qmake")
206 fi
207
208 cmake-utils_src_configure
209 }
210
211 src_install() {
212 cmake-utils_src_install
213
214 # install docs
215 dohtml "${S}"/README.html || die "Failed to install docs"
216
217 # install Tcl docs
218 docinto vtk_tcl
219 dodoc "${S}"/Wrapping/Tcl/README || \
220 die "Failed to install Tcl docs"
221
222 # install examples
223 if use examples; then
224 insinto /usr/share/${PN}
225 mv -v Examples examples
226 doins -r examples || die
227 mv -v "${WORKDIR}"/{VTKData,data} || die
228 doins -r "${WORKDIR}"/data || die
229 fi
230
231 #install big docs
232 if use doc; then
233 cd "${WORKDIR}"/html
234 rm -f *.md5 || die "Failed to remove superfluous hashes"
235 einfo "Installing API docs. This may take some time."
236 insinto "/usr/share/doc/${PF}/api-docs"
237 doins -r ./* || die "Failed to install docs"
238 fi
239
240 # environment
241 cat >> "${T}"/40${PN} <<- EOF
242 VTK_DATA_ROOT=${EPREFIX}/usr/share/${PN}/data
243 VTK_DIR=${EPREFIX}/usr/$(get_libdir)/${PN}-${SPV}
244 VTKHOME=${EPREFIX}/usr
245 EOF
246 doenvd "${T}"/40${PN}
247 }
248
249 pkg_postinst() {
250 if use patented; then
251 ewarn "Using patented code in VTK may require a license."
252 ewarn "For more information, please read:"
253 ewarn "http://public.kitware.com/cgi-bin/vtkfaq?req=show&file=faq07.005.htp"
254 fi
255
256 if use python; then
257 python_mod_optimize vtk
258 fi
259 }
260
261 pkg_postrm() {
262 if use python; then
263 python_mod_cleanup vtk
264 fi
265 }

  ViewVC Help
Powered by ViewVC 1.1.20