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

Contents of /sci-libs/vtk/vtk-5.6.0-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (show annotations) (download)
Fri Feb 10 18:55:37 2012 UTC (8 years, 5 months ago) by jlec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.10: +1 -1 lines
FILE REMOVED
Use selected python ABI, #401839, patch by JTRiley; dropped old

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

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

  ViewVC Help
Powered by ViewVC 1.1.20