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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Sat May 29 11:15:43 2010 UTC (10 years, 1 month ago) by jlec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
Don't use bundled libtheora, moved USE ogg -> theora
(Portage version: 2.2_rc67/cvs/Linux x86_64)

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

  ViewVC Help
Powered by ViewVC 1.1.20