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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (show annotations) (download)
Wed Jun 9 07:06:16 2010 UTC (10 years, 2 months ago) by jlec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.9: +1 -1 lines
FILE REMOVED
removed old version which having problems with PYTHON ABIs stuff
(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.4.2.ebuild,v 1.9 2010/05/28 20:05:21 jlec Exp $
4
5 EAPI="2"
6 inherit distutils eutils flag-o-matic toolchain-funcs versionator java-pkg-opt-2 python 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/doc/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 qt4"
21 RDEPEND="mpi? ( || (
22 sys-cluster/openmpi
23 sys-cluster/lam-mpi
24 sys-cluster/mpich2[cxx] ) )
25 python? ( >=dev-lang/python-2.0 )
26 cg? ( media-gfx/nvidia-cg-toolkit )
27 tcl? ( >=dev-lang/tcl-8.2.3 )
28 tk? ( >=dev-lang/tk-8.2.3 )
29 java? ( >=virtual/jre-1.5 )
30 qt4? ( x11-libs/qt-core:4
31 x11-libs/qt-opengl:4
32 x11-libs/qt-gui:4
33 x11-libs/qt-sql:4 )
34 examples? ( x11-libs/qt-core:4[qt3support]
35 x11-libs/qt-gui:4[qt3support] )
36 dev-libs/expat
37 dev-libs/libxml2
38 media-libs/freetype
39 media-libs/jpeg
40 media-libs/libpng
41 media-libs/tiff
42 virtual/opengl
43 x11-libs/libXmu"
44
45 DEPEND="${RDEPEND}
46 java? ( >=virtual/jdk-1.5 )
47 boost? ( >=dev-libs/boost-1.40 )
48 >=dev-util/cmake-2.6"
49
50 S="${WORKDIR}"/VTK
51
52 pkg_setup() {
53 echo
54 einfo "Please note that the VTK build occasionally fails when"
55 einfo "using parallel make. Hence, if you experience a build"
56 einfo "failure please try re-emerging with MAKEOPTS=\"-j1\" first."
57 echo
58 epause 5
59
60 java-pkg-opt-2_pkg_setup
61 if use qt4; then
62 qt4_pkg_setup
63 fi
64 }
65
66 src_prepare() {
67 epatch "${FILESDIR}"/${P}-cg-path.patch
68 epatch "${FILESDIR}"/${PN}-5.2.0-tcl-install.patch
69 sed -e "s:@VTK_TCL_LIBRARY_DIR@:/usr/$(get_libdir):" \
70 -i Wrapping/Tcl/pkgIndex.tcl.in \
71 || die "Failed to fix tcl pkgIndex file"
72 }
73
74 src_compile() {
75 # gcc versions 3.2.x seem to have sse-related bugs that are
76 # triggered by VTK when compiling for pentium3/4
77 if [ "$(gcc-major-version)" -eq 3 -a "$(gcc-minor-version)" -eq 2 -a \
78 "$(get-flag -march)" == "-march=pentium4" ]; then
79 filter-mfpmath sse
80 filter-flags "-msse -msse2"
81 echo "$(get-flag -march)"
82 fi
83
84 # build list of config variable define's to pass to cmake
85 # Let's ignore developer warnings via -Wno-dev
86 local CMAKE_VARIABLES="-Wno-dev"
87 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_INSTALL_PACKAGE_DIR:PATH=/$(get_libdir)/${PN}-${SPV}"
88 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DCMAKE_SKIP_RPATH:BOOL=YES"
89 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_DIR:PATH=${S}"
90 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_INSTALL_LIB_DIR:PATH=/$(get_libdir)/"
91 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DCMAKE_INSTALL_PREFIX:PATH=/usr"
92 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DBUILD_SHARED_LIBS:BOOL=ON"
93 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_SYSTEM_FREETYPE:BOOL=ON"
94 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_SYSTEM_JPEG:BOOL=ON"
95 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_SYSTEM_PNG:BOOL=ON"
96 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_SYSTEM_TIFF:BOOL=ON"
97 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_SYSTEM_ZLIB:BOOL=ON"
98 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_SYSTEM_EXPAT:BOOL=ON"
99 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_SYSTEM_LIBXML2:BOOL=ON"
100 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DBUILD_TESTING:BOOL=OFF"
101 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_HYBRID:BOOL=ON"
102 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_GL2PS:BOOL=ON"
103 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_RENDERING:BOOL=ON"
104
105 use boost && CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_BOOST:BOOL=ON"
106 use cg && CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_CG_SHADERS:BOOL=ON"
107
108 use examples && CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_DATA_ROOT:PATH=/usr/share/${PN}/data -DBUILD_EXAMPLES:BOOL=ON"
109 if use java; then
110 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_WRAP_JAVA:BOOL=ON"
111 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DJAVA_AWT_INCLUDE_PATH:PATH=`java-config -O`/include"
112 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DJAVA_INCLUDE_PATH:PATH=`java-config -O`/include"
113 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DJAVA_INCLUDE_PATH2:PATH=`java-config -O`/include/linux"
114 if [ "${ARCH}" == "amd64" ]; then
115 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DJAVA_AWT_LIBRARY:PATH=`java-config -O`/jre/lib/${ARCH}/libjawt.so"
116 else
117 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DJAVA_AWT_LIBRARY:PATH=`java-config -O`/jre/lib/i386/libjawt.so"
118 fi
119 fi
120
121 if use mpi; then
122 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_MPI:BOOL=ON"
123 use !threads && CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_PARALLEL:BOOL=ON"
124 fi
125
126 if use python; then
127 python_version
128 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_WRAP_PYTHON:BOOL=ON"
129 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DPYTHON_INCLUDE_PATH:PATH=/usr/include/python${PYVER}"
130 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DPYTHON_LIBRARY:PATH=/usr/$(get_libdir)/libpython${PYVER}.so"
131 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_PYTHON_SETUP_ARGS:STRING=\"--prefix=${D}/usr\""
132 fi
133
134 if use qt4 ; then
135 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_GUISUPPORT:BOOL=ON"
136 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_QVTK:BOOL=ON"
137 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_QVTK_QTOPENGL:BOOL=ON"
138 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_WRAP_CPP:BOOL=ON"
139 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_WRAP_UI:BOOL=ON"
140 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_INSTALL_QT_DIR:PATH=/$(get_libdir)/qt4/plugins/${PN}"
141 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DDESIRED_QT_VERSION:STRING=4"
142 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_MOC_EXECUTABLE:FILEPATH=/usr/bin/moc"
143 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_UIC_EXECUTABLE:FILEPATH=/usr/bin/uic"
144 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_INCLUDE_DIR:PATH=/usr/include/qt4"
145 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_QMAKE_EXECUTABLE:PATH=/usr/bin/qmake"
146 fi
147
148 if use tcl; then
149 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_WRAP_TCL:BOOL=ON"
150 else
151 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_WRAP_TCL:BOOL=OFF"
152 fi
153
154 if use tk; then
155 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_TK:BOOL=ON"
156 else
157 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_TK:BOOL=OFF"
158 fi
159
160 use threads && CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_PARALLEL:BOOL=ON"
161 use patented && CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_PATENTED:BOOL=ON"
162 use doc && CMAKE_VARIABLES="${CMAKE_VARIABLES} -DDOCUMENTATION_HTML_HELP:BOOL=ON -DBUILD_DOCUMENTATION:BOOL=ON"
163
164 # run cmake twice to achieve proper
165 # configuration with cmake 2.2.x
166 cmake ${CMAKE_VARIABLES} || die "cmake configuration failed"
167
168 # fix java.lang.OutOfMemoryError on amd64 (see bug #123178)
169 if use java && [ "${ARCH}" == "amd64" ]; then
170 sed -e "s/javac/javac -J-Xmx256m/" \
171 -i "${S}"/Wrapping/Java/CMakeFiles/VTKBuildAll.dir/build.make \
172 || die "Failed to patch javac"
173 fi
174
175 emake || die "emake failed"
176 }
177
178 src_install() {
179 # remove portage paths from dynamically created Type
180 # headers
181 sed -e "s:${S}/Common/::" \
182 -e "s:${S}/Rendering/::" \
183 -i "${S}"/Utilities/InstallOnly/*.cmake || \
184 die "Failed to fix cmake files"
185
186 make DESTDIR="${D}" install || die "make install failed"
187
188 # install docs
189 dohtml "${S}"/README.html || die "Failed to install docs"
190
191 # install python modules
192 if use python; then
193 cd "${S}"/Wrapping/Python
194 docinto vtk_python
195 distutils_src_install
196 fi
197
198 # install jar
199 use java && java-pkg_dojar "${S}"/bin/vtk.jar
200
201 # install Tcl docs
202 docinto vtk_tcl
203 dodoc "${S}"/Wrapping/Tcl/README || \
204 die "Failed to install Tcl docs"
205
206 # install examples
207 if use examples; then
208 dodir /usr/share/${PN} || \
209 die "Failed to create examples directory"
210 cp -pPR "${S}"/Examples "${D}"/usr/share/${PN}/examples || \
211 die "Failed to copy example files"
212
213 # fix example's permissions
214 find "${D}"/usr/share/${PN}/examples -type d -exec \
215 chmod 0755 {} \; || \
216 die "Failed to fix example directories permissions"
217 find "${D}"/usr/share/${PN}/examples -type f -exec \
218 chmod 0644 {} \; || \
219 die "Failed to fix example files permissions"
220
221 cp -pPR "${WORKDIR}"/VTKData "${D}"/usr/share/${PN}/data || \
222 die "Failed to copy data files"
223
224 # fix data's permissions
225 find "${D}"/usr/share/${PN}/data -type d -exec \
226 chmod 0755 {} \; || \
227 die "Failed to fix data directories permissions"
228 find "${D}"/usr/share/${PN}/data -type f -exec \
229 chmod 0644 {} \; || \
230 die "Failed to fix data files permissions"
231 fi
232
233 #install big docs
234 if use doc; then
235 cd "${WORKDIR}"/html
236 rm -f *.md5 || die "Failed to remove superfluous hashes"
237 einfo "Installing API docs. This may take some time."
238 insinto "/usr/share/doc/${PF}/api-docs"
239 doins -r ./* || die "Failed to install docs"
240 fi
241
242 # environment
243 echo "VTK_DATA_ROOT=/usr/share/${PN}/data" >> "${T}"/40${PN}
244 echo "VTK_DIR=/usr/$(get_libdir)/${PN}-${SPV}" >> "${T}"/40${PN}
245 echo "VTKHOME=/usr" >> "${T}"/40${PN}
246 doenvd "${T}"/40${PN}
247 }
248
249 pkg_postinst() {
250 if use patented; then
251 ewarn "Using patented code in VTK may require a license."
252 ewarn "For more information, please read:"
253 ewarn "http://public.kitware.com/cgi-bin/vtkfaq?req=show&file=faq07.005.htp"
254 fi
255 }

  ViewVC Help
Powered by ViewVC 1.1.20