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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (show annotations) (download)
Fri Dec 26 12:19:44 2014 UTC (5 years, 7 months ago) by jlec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.10: +1 -1 lines
FILE REMOVED
sci-libs/vtk: Version BUmp, #500814; fixes GLintptr declaration problems, #523786; Add slot operators to dependencies, #531040; drop old which obsoletes, #477638, #497224, #520310

(Portage version: 2.2.15/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-5.10.1.ebuild,v 1.10 2014/11/03 13:58:24 titanofold 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 dev-qt/qtcore:4[qt3support]
44 dev-qt/qtgui: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? ( virtual/postgresql )
51 python? ( dev-python/sip )
52 qt4? (
53 dev-qt/qtcore:4
54 || ( ( >=dev-qt/qtgui-4.8.5:4 dev-qt/designer:4 ) <dev-qt/qtgui-4.8.5:4 )
55 dev-qt/qtopengl:4
56 dev-qt/qtsql:4
57 dev-qt/qtwebkit: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${PV}
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 "${FILESDIR}"/${P}-tcl8.6.patch
80 "${FILESDIR}"/${P}-ffmpeg-1.patch
81 "${FILESDIR}"/${P}-libav-9.patch
82 )
83
84 pkg_setup() {
85 echo
86 einfo "Please note that the VTK build occasionally fails when"
87 einfo "using parallel make. Hence, if you experience a build"
88 einfo "failure please try re-emerging with MAKEOPTS=\"-j1\" first."
89 echo
90
91 java-pkg-opt-2_pkg_setup
92
93 use python && python_set_active_version 2
94 append-cppflags -D__STDC_CONSTANT_MACROS
95 }
96
97 src_configure() {
98 # general configuration
99 local mycmakeargs=(
100 -Wno-dev
101 -DVTK_INSTALL_PACKAGE_DIR=/$(get_libdir)/${PN}-${SPV}
102 -DCMAKE_SKIP_RPATH=YES
103 -DVTK_DIR="${S}"
104 -DVTK_INSTALL_LIB_DIR=/$(get_libdir)/
105 -DVTK_DATA_ROOT:PATH="${EPREFIX}/usr/share/${PN}/data"
106 -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
107 -DBUILD_SHARED_LIBS=ON
108 -DVTK_USE_SYSTEM_EXPAT=ON
109 -DVTK_USE_SYSTEM_FREETYPE=ON
110 -DVTK_USE_SYSTEM_JPEG=ON
111 -DVTK_USE_SYSTEM_LIBXML2=ON
112 -DVTK_USE_SYSTEM_PNG=ON
113 -DVTK_USE_SYSTEM_TIFF=ON
114 -DVTK_USE_SYSTEM_ZLIB=ON
115 -DVTK_USE_SYSTEM_HDF5=ON
116 -DHDF5_LIBRARY="${EPREFIX}/usr/$(get_libdir)"
117 -DHDF5_INCLUDE_DIRS="${EPREFIX}/usr/include"
118 -DBUILD_TESTING=OFF
119 -DBUILD_EXAMPLES=OFF
120 -DVTK_USE_HYBRID=ON
121 -DVTK_USE_GL2PS=ON
122 -DVTK_USE_RENDERING=ON)
123
124 # use flag triggered options
125 mycmakeargs+=(
126 $(cmake-utils_use boost VTK_USE_BOOST)
127 $(cmake-utils_use cg VTK_USE_CG_SHADERS)
128 $(cmake-utils_use doc DOCUMENTATION_HTML_HELP)
129 $(cmake-utils_use_build doc DOCUMENTATION)
130 $(cmake-utils_use java VTK_USE_JAVA)
131 $(cmake-utils_use mpi VTK_USE_MPI)
132 $(cmake-utils_use mysql VTK_USE_MYSQL)
133 $(cmake-utils_use patented VTK_USE_PATENTED)
134 $(cmake-utils_use postgres VTK_USE_POSTGRES)
135 $(cmake-utils_use odbc VTK_USE_ODBC)
136 $(cmake-utils_use qt4 VTK_USE_QT)
137 $(cmake-utils_use theora VTK_USE_OGGTHEORA_ENCODER)
138 $(cmake-utils_use ffmpeg VTK_USE_FFMPEG_ENCODER)
139 $(cmake-utils_use tk VTK_USE_TK)
140 $(cmake-utils_use threads VTK_USE_PARALLEL)
141 $(cmake-utils_use video_cards_nvidia VTK_USE_NVCONTROL)
142 $(cmake-utils_use X VTK_USE_X)
143 $(cmake-utils_use X VTK_USE_GUISUPPORT)
144 $(cmake-utils_use R VTK_USE_GNU_R)
145 $(cmake-utils_use chemistry VTK_USE_CHEMISTRY)
146 )
147
148 use tk &&
149 mycmakeargs+=(
150 -DVTK_WRAP_TCL=ON
151 -DVTK_WRAP_TK=ON
152 -DVTK_TCL_INCLUDE_DIR="${EPREFIX}/usr/include"
153 -DVTK_TCL_LIBRARY="${EPREFIX}/usr/$(get_libdir)"
154 -DVTK_TK_INCLUDE_DIR="${EPREFIX}/usr/include"
155 -DVTK_TK_LIBRARY="${EPREFIX}/usr/$(get_libdir)"
156 )
157
158 use theora &&
159 mycmakeargs+=(-DVTK_USE_SYSTEM_OGGTHEORA=ON)
160
161 # mpi needs the parallel framework
162 if use mpi && use !threads; then
163 mycmakeargs+=(-DVTK_USE_PARALLEL=ON)
164 fi
165
166 if use java; then
167 mycmakeargs+=(
168 -DVTK_WRAP_JAVA=ON
169 -DJAVA_AWT_INCLUDE_PATH=`java-config -O`/include
170 -DJAVA_INCLUDE_PATH:PATH=`java-config -O`/include
171 -DJAVA_INCLUDE_PATH2:PATH=`java-config -O`/include/linux
172 )
173
174 if [ "${ARCH}" == "amd64" ]; then
175 mycmakeargs+=(-DJAVA_AWT_LIBRARY=`java-config -O`/jre/lib/${ARCH}/libjawt.so)
176 else
177 mycmakeargs+=(-DJAVA_AWT_LIBRARY:PATH=`java-config -O`/jre/lib/i386/libjawt.so)
178 fi
179 fi
180
181 if use python; then
182 mycmakeargs+=(
183 -DPYTHON_INCLUDE_DIR="${EPREFIX}"$(python_get_includedir)
184 -DPYTHON_LIBRARY="${EPREFIX}$(python_get_library)"
185 -DVTK_WRAP_PYTHON=ON
186 -DVTK_WRAP_PYTHON_SIP=ON
187 -DSIP_PYQT_DIR="${EPREFIX}/usr/share/sip"
188 -DSIP_INCLUDE_DIR="${EPREFIX}$(python_get_includedir)"
189 -DPYTHON_INCLUDE_DIR="${EPREFIX}$(python_get_includedir)"
190 -DPYTHON_LIBRARY="${EPREFIX}$(python_get_library)"
191 -DVTK_PYTHON_INCLUDE_DIR="${EPREFIX}$(python_get_includedir)"
192 -DVTK_PYTHON_LIBRARY="${EPREFIX}$(python_get_library)"
193 -DVTK_PYTHON_SETUP_ARGS:STRING=--root="${D}")
194 fi
195
196 if use qt4 ; then
197 mycmakeargs+=(
198 -DVTK_USE_GUISUPPORT=ON
199 -DVTK_USE_QVTK=ON
200 -DVTK_USE_QVTK_OPENGL=ON
201 -DVTK_USE_QVTK_QTOPENGL=ON
202 -DQT_WRAP_CPP=ON
203 -DQT_WRAP_UI=ON
204 -DVTK_INSTALL_QT_DIR=/$(get_libdir)/qt4/plugins/${PN}
205 -DDESIRED_QT_VERSION=4
206 -DQT_MOC_EXECUTABLE="${EPREFIX}/usr/bin/moc"
207 -DQT_UIC_EXECUTABLE="${EPREFIX}/usr/bin/uic"
208 -DQT_INCLUDE_DIR="${EPREFIX}/usr/include/qt4"
209 -DQT_QMAKE_EXECUTABLE="${EPREFIX}/usr/bin/qmake")
210 fi
211
212 cmake-utils_src_configure
213 }
214
215 src_install() {
216 cmake-utils_src_install
217
218 # install docs
219 dohtml "${S}"/README.html || die "Failed to install docs"
220
221 # install Tcl docs
222 docinto vtk_tcl
223 dodoc "${S}"/Wrapping/Tcl/README || \
224 die "Failed to install Tcl docs"
225
226 # install examples
227 if use examples; then
228 insinto /usr/share/${PN}
229 mv -v Examples examples
230 doins -r examples || die
231 mv -v "${WORKDIR}"/{VTKData${PV},data} || die
232 doins -r "${WORKDIR}"/data || die
233 fi
234
235 #install big docs
236 if use doc; then
237 cd "${WORKDIR}"/html
238 rm -f *.md5 || die "Failed to remove superfluous hashes"
239 einfo "Installing API docs. This may take some time."
240 insinto "/usr/share/doc/${PF}/api-docs"
241 doins -r ./* || die "Failed to install docs"
242 fi
243
244 # environment
245 cat >> "${T}"/40${PN} <<- EOF
246 VTK_DATA_ROOT=${EPREFIX}/usr/share/${PN}/data
247 VTK_DIR=${EPREFIX}/usr/$(get_libdir)/${PN}-${SPV}
248 VTKHOME=${EPREFIX}/usr
249 EOF
250 doenvd "${T}"/40${PN}
251 }
252
253 pkg_postinst() {
254 if use patented; then
255 ewarn "Using patented code in VTK may require a license."
256 ewarn "For more information, please read:"
257 ewarn "http://public.kitware.com/cgi-bin/vtkfaq?req=show&file=faq07.005.htp"
258 fi
259
260 if use python; then
261 python_mod_optimize vtk
262 fi
263 }
264
265 pkg_postrm() {
266 if use python; then
267 python_mod_cleanup vtk
268 fi
269 }

  ViewVC Help
Powered by ViewVC 1.1.20