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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Fri Sep 18 18:03:25 2009 UTC (10 years, 10 months ago) by betelgeuse
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Remove old versions using built_with_use.
(Portage version: 2.2_rc40/cvs/Linux i686)

1 # Copyright 1999-2008 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.2.0-r1.ebuild,v 1.2 2008/10/27 14:00:55 markusle Exp $
4
5 EAPI="1"
6 inherit distutils eutils flag-o-matic toolchain-funcs versionator java-pkg-opt-2 python qt3 qt4
7
8 # Short package version
9 SPV="$(get_version_component_range 1-2)"
10
11 DESCRIPTION="The Visualization Toolkit"
12 HOMEPAGE="http://www.vtk.org"
13 SRC_URI="http://www.${PN}.org/files/release/${SPV}/${P}.tar.gz
14 examples? ( http://www.${PN}.org/files/release/${SPV}/${PN}data-${PV}.tar.gz )
15 doc? ( http://www.${PN}.org/files/release/${SPV}/${PN}DocHtml-${PV}.tar.gz )"
16
17 LICENSE="BSD LGPL-2"
18 KEYWORDS="~amd64 ~x86"
19 SLOT="0"
20 IUSE="boost cg doc examples mpi patented python tcl tk threads qt3 qt4"
21 RDEPEND="mpi? ( || (
22 sys-cluster/openmpi
23 sys-cluster/lam-mpi
24 sys-cluster/mpich2 ) )
25 python? ( >=dev-lang/python-2.0 )
26 boost? ( dev-libs/boost )
27 cg? ( media-gfx/nvidia-cg-toolkit )
28 tcl? ( >=dev-lang/tcl-8.2.3 )
29 tk? ( >=dev-lang/tk-8.2.3 )
30 java? ( >=virtual/jre-1.5 )
31 !qt4? ( qt3? ( >=x11-libs/qt-3.3.4:3 ) )
32 qt4? (
33 || ( ( x11-libs/qt-core:4 x11-libs/qt-gui:4 ) =x11-libs/qt-4.3*:4 ) )
34 dev-libs/expat
35 dev-libs/libxml2
36 media-libs/freetype
37 media-libs/jpeg
38 media-libs/libpng
39 media-libs/tiff
40 virtual/opengl
41 x11-libs/libXmu"
42
43 DEPEND="${RDEPEND}
44 java? ( >=virtual/jdk-1.5 )
45 >=dev-util/cmake-2.2.3"
46
47 S="${WORKDIR}"/VTK
48
49 pkg_setup() {
50 java-pkg-opt-2_pkg_setup
51 if use qt3 && use qt4; then
52 echo
53 ewarn "qt3 and qt4 support for vtk are mutually exclusive and"
54 ewarn "qt4 support has therefore been enabled by default."
55 echo
56 fi
57
58 if use mpi && has_version sys-cluster/mpich2; then
59 append-flags -DMPICH_IGNORE_CXX_SEEK
60 if ! built_with_use sys-cluster/mpich2 cxx; then
61 die "Please re-emerge sys-cluster/mpich2 with USE=\"cxx\""
62 fi
63 fi
64
65 if use qt4 && use examples; then
66 QT4_BUILT_WITH_USE_CHECK="qt3support"
67 qt4_pkg_setup
68 fi
69 }
70
71 src_unpack() {
72 unpack ${A}
73 cd "${S}"
74 epatch "${FILESDIR}"/${P}-tcl-install.patch
75 sed -e "s:@VTK_TCL_LIBRARY_DIR@:/usr/$(get_libdir):" \
76 -i Wrapping/Tcl/pkgIndex.tcl.in \
77 || die "Failed to fix tcl pkgIndex file"
78 }
79
80 src_compile() {
81 # gcc versions 3.2.x seem to have sse-related bugs that are
82 # triggered by VTK when compiling for pentium3/4
83 if [ "$(gcc-major-version)" -eq 3 -a "$(gcc-minor-version)" -eq 2 -a \
84 "$(get-flag -march)" == "-march=pentium4" ]; then
85 filter-mfpmath sse
86 filter-flags "-msse -msse2"
87 echo "$(get-flag -march)"
88 fi
89
90 # Fix Examples cmake file
91 sed -e "s/MAKEPROGRAM/CMAKE_MAKE_PROGRAM/g" \
92 -i "${S}"/Examples/CMakeLists.txt || \
93 die "Failed to fix examples CMakeList.txt"
94
95 # build list of config variable define's to pass to cmake
96 local CMAKE_VARIABLES=""
97 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_INSTALL_PACKAGE_DIR:PATH=/$(get_libdir)/${PN}-${SPV}"
98 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DCMAKE_SKIP_RPATH:BOOL=YES"
99 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_DIR:PATH=${S}"
100 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_INSTALL_LIB_DIR:PATH=/$(get_libdir)/"
101 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DCMAKE_INSTALL_PREFIX:PATH=/usr"
102 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DBUILD_SHARED_LIBS:BOOL=ON"
103 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_SYSTEM_FREETYPE:BOOL=ON"
104 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_SYSTEM_JPEG:BOOL=ON"
105 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_SYSTEM_PNG:BOOL=ON"
106 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_SYSTEM_TIFF:BOOL=ON"
107 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_SYSTEM_ZLIB:BOOL=ON"
108 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_SYSTEM_EXPAT:BOOL=ON"
109 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_SYSTEM_LIBXML2:BOOL=ON"
110 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DBUILD_TESTING:BOOL=OFF"
111 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_HYBRID:BOOL=ON"
112 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_GL2PS:BOOL=ON"
113 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_RENDERING:BOOL=ON"
114
115 use boost && CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_BOOST:BOOL=ON"
116 use cg && CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_CG_SHADERS:BOOL=ON"
117
118 use examples && CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_DATA_ROOT:PATH=/usr/share/${PN}/data -DBUILD_EXAMPLES:BOOL=ON"
119 if use java; then
120 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_WRAP_JAVA:BOOL=ON"
121 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DJAVA_AWT_INCLUDE_PATH:PATH=`java-config -O`/include"
122 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DJAVA_INCLUDE_PATH:PATH=`java-config -O`/include"
123 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DJAVA_INCLUDE_PATH2:PATH=`java-config -O`/include/linux"
124 if [ "${ARCH}" == "amd64" ]; then
125 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DJAVA_AWT_LIBRARY:PATH=`java-config -O`/jre/lib/${ARCH}/libjawt.so"
126 else
127 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DJAVA_AWT_LIBRARY:PATH=`java-config -O`/jre/lib/i386/libjawt.so"
128 fi
129 fi
130
131 if use mpi; then
132 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_MPI:BOOL=ON"
133 use !threads && CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_PARALLEL:BOOL=ON"
134 fi
135
136 if use python; then
137 python_version
138 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_WRAP_PYTHON:BOOL=ON"
139 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DPYTHON_INCLUDE_PATH:PATH=/usr/include/python${PYVER}"
140 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DPYTHON_LIBRARY:PATH=/usr/$(get_libdir)/libpython${PYVER}.so"
141 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_PYTHON_SETUP_ARGS:STRING=\"--prefix=${D}/usr\""
142 fi
143
144 if use qt3 || use qt4 ; then
145 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_GUISUPPORT:BOOL=ON"
146 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_QVTK:BOOL=ON"
147 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_WRAP_CPP:BOOL=ON"
148 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_WRAP_UI:BOOL=ON"
149 fi
150
151 if use qt3; then
152 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_INSTALL_QT_DIR:PATH=/qt/3/plugins/${PN}"
153 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DDESIRED_QT_VERSION:STRING=3"
154 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_MOC_EXECUTABLE:FILEPATH=/usr/qt/3/bin/moc"
155 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_UIC_EXECUTABLE:FILEPATH=/usr/qt/3/bin/uic"
156 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_INCLUDE_DIR:PATH=/usr/qt/3/include"
157 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_QMAKE_EXECUTABLE:PATH=/usr/qt/3/bin/qmake"
158 fi
159
160 if use qt4; then
161 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_INSTALL_QT_DIR:PATH=/$(get_libdir)/qt4/plugins/${PN}"
162 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DDESIRED_QT_VERSION:STRING=4"
163 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_MOC_EXECUTABLE:FILEPATH=/usr/bin/moc"
164 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_UIC_EXECUTABLE:FILEPATH=/usr/bin/uic"
165 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_INCLUDE_DIR:PATH=/usr/include/qt4"
166 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_QMAKE_EXECUTABLE:PATH=/usr/bin/qmake"
167 fi
168
169 if use tcl; then
170 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_WRAP_TCL:BOOL=ON"
171 else
172 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_WRAP_TCL:BOOL=OFF"
173 fi
174
175 if use tk; then
176 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_TK:BOOL=ON"
177 else
178 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_TK:BOOL=OFF"
179 fi
180
181 use threads && CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_PARALLEL:BOOL=ON"
182 use patented && CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_PATENTED:BOOL=ON"
183 use doc && CMAKE_VARIABLES="${CMAKE_VARIABLES} -DDOCUMENTATION_HTML_HELP:BOOL=ON -DBUILD_DOCUMENTATION:BOOL=ON"
184
185 # run cmake twice to achieve proper
186 # configuration with cmake 2.2.x
187 cmake ${CMAKE_VARIABLES} . && cmake ${CMAKE_VARIABLES} . \
188 || die "cmake configuration failed"
189
190 # fix java.lang.OutOfMemoryError on amd64 (see bug #123178)
191 if use java && [ "${ARCH}" == "amd64" ]; then
192 sed -e "s/javac/javac -J-Xmx256m/" \
193 -i "${S}"/Wrapping/Java/CMakeFiles/VTKBuildAll.dir/build.make \
194 || die "Failed to patch javac"
195 fi
196
197 emake || die "emake failed"
198 }
199
200 src_install() {
201 # remove portage paths from dynamically created Type
202 # headers
203 sed -e "s:${S}/Common/::" \
204 -e "s:${S}/Rendering/::" \
205 -i "${S}"/Utilities/InstallOnly/*.cmake || \
206 die "Failed to fix cmake files"
207
208 make DESTDIR="${D}" install || die "make install failed"
209
210 # install docs
211 dohtml "${S}"/README.html || die "Failed to install docs"
212
213 # install python modules
214 if use python; then
215 cd "${S}"/Wrapping/Python
216 docinto vtk_python
217 distutils_src_install
218 fi
219
220 # install jar
221 use java && java-pkg_dojar "${S}"/bin/vtk.jar
222
223 # install Tcl docs
224 docinto vtk_tcl
225 dodoc "${S}"/Wrapping/Tcl/README || \
226 die "Failed to install Tcl docs"
227
228 # install examples
229 if use examples; then
230 dodir /usr/share/${PN} || \
231 die "Failed to create examples directory"
232 cp -pPR "${S}"/Examples "${D}"/usr/share/${PN}/examples || \
233 die "Failed to copy example files"
234
235 # fix example's permissions
236 find "${D}"/usr/share/${PN}/examples -type d -exec \
237 chmod 0755 {} \; || \
238 die "Failed to fix example directories permissions"
239 find "${D}"/usr/share/${PN}/examples -type f -exec \
240 chmod 0644 {} \; || \
241 die "Failed to fix example files permissions"
242
243 cp -pPR "${WORKDIR}"/VTKData "${D}"/usr/share/${PN}/data || \
244 die "Failed to copy data files"
245
246 # fix data's permissions
247 find "${D}"/usr/share/${PN}/data -type d -exec \
248 chmod 0755 {} \; || \
249 die "Failed to fix data directories permissions"
250 find "${D}"/usr/share/${PN}/data -type f -exec \
251 chmod 0644 {} \; || \
252 die "Failed to fix data files permissions"
253 fi
254
255 #install big docs
256 if use doc; then
257 cd "${WORKDIR}"/html
258 rm -f *.md5 || die "Failed to remove superfluous hashes"
259 einfo "Installing API docs. This may take some time."
260 insinto "/usr/share/doc/${PF}/api-docs"
261 doins -r ./* || die "Failed to install docs"
262 fi
263
264 # environment
265 echo "VTK_DATA_ROOT=/usr/share/${PN}/data" >> "${T}"/40${PN}
266 echo "VTK_DIR=/usr/$(get_libdir)/${PN}-${SPV}" >> "${T}"/40${PN}
267 echo "VTKHOME=/usr" >> "${T}"/40${PN}
268 doenvd "${T}"/40${PN}
269 }
270
271 pkg_postinst() {
272 if use patented; then
273 ewarn "Using patented code in VTK may require a license."
274 ewarn "For more information, please read:"
275 ewarn "http://public.kitware.com/cgi-bin/vtkfaq?req=show&file=faq07.005.htp"
276 fi
277 }

  ViewVC Help
Powered by ViewVC 1.1.20