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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20