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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sun Oct 5 16:42:02 2008 UTC (11 years, 10 months ago) by markusle
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Fixed improper install location of support files (see bug #239553).
(Portage version: 2.2_rc11/cvs/Linux 2.6.26-SENTINEL-2 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.ebuild,v 1.1 2008/10/02 23:37:56 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_compile() {
72 # gcc versions 3.2.x seem to have sse-related bugs that are
73 # triggered by VTK when compiling for pentium3/4
74 if [ "$(gcc-major-version)" -eq 3 -a "$(gcc-minor-version)" -eq 2 -a \
75 "$(get-flag -march)" == "-march=pentium4" ]; then
76 filter-mfpmath sse
77 filter-flags "-msse -msse2"
78 echo "$(get-flag -march)"
79 fi
80
81 # Fix Examples cmake file
82 sed -e "s/MAKEPROGRAM/CMAKE_MAKE_PROGRAM/g" \
83 -i "${S}"/Examples/CMakeLists.txt || \
84 die "Failed to fix examples CMakeList.txt"
85
86 # build list of config variable define's to pass to cmake
87 local CMAKE_VARIABLES=""
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 fi
132
133 if use qt3 || use qt4 ; then
134 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_GUISUPPORT:BOOL=ON"
135 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_QVTK:BOOL=ON"
136 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_WRAP_CPP:BOOL=ON"
137 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_WRAP_UI:BOOL=ON"
138 fi
139
140 if use qt3; then
141 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_INSTALL_QT_DIR:PATH=/qt/3/plugins/${PN}"
142 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DDESIRED_QT_VERSION:STRING=3"
143 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_MOC_EXECUTABLE:FILEPATH=/usr/qt/3/bin/moc"
144 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_UIC_EXECUTABLE:FILEPATH=/usr/qt/3/bin/uic"
145 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_INCLUDE_DIR:PATH=/usr/qt/3/include"
146 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_QMAKE_EXECUTABLE:PATH=/usr/qt/3/bin/qmake"
147 fi
148
149 if use qt4; then
150 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_INSTALL_QT_DIR:PATH=/$(get_libdir)/qt4/plugins/${PN}"
151 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DDESIRED_QT_VERSION:STRING=4"
152 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_MOC_EXECUTABLE:FILEPATH=/usr/bin/moc"
153 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_UIC_EXECUTABLE:FILEPATH=/usr/bin/uic"
154 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_INCLUDE_DIR:PATH=/usr/include/qt4"
155 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_QMAKE_EXECUTABLE:PATH=/usr/bin/qmake"
156 fi
157
158 if use tcl; then
159 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_WRAP_TCL:BOOL=ON"
160 else
161 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_WRAP_TCL:BOOL=OFF"
162 fi
163
164 if use tk; then
165 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_TK:BOOL=ON"
166 else
167 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_TK:BOOL=OFF"
168 fi
169
170 use threads && CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_PARALLEL:BOOL=ON"
171 use patented && CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_PATENTED:BOOL=ON"
172 use doc && CMAKE_VARIABLES="${CMAKE_VARIABLES} -DDOCUMENTATION_HTML_HELP:BOOL=ON -DBUILD_DOCUMENTATION:BOOL=ON"
173
174 # run cmake twice to achieve proper
175 # configuration with cmake 2.2.x
176 cmake ${CMAKE_VARIABLES} . && cmake ${CMAKE_VARIABLES} . \
177 || die "cmake configuration failed"
178
179 # fix java.lang.OutOfMemoryError on amd64 (see bug #123178)
180 if use java && [ "${ARCH}" == "amd64" ]; then
181 sed -e "s/javac/javac -J-Xmx256m/" \
182 -i "${S}"/Wrapping/Java/CMakeFiles/VTKBuildAll.dir/build.make \
183 || die "Failed to patch javac"
184 fi
185
186 emake || die "emake failed"
187 }
188
189 src_install() {
190 # remove portage paths from dynamically created Type
191 # headers
192 sed -e "s:${S}/Common/::" \
193 -e "s:${S}/Rendering/::" \
194 -i "${S}"/Utilities/InstallOnly/*.cmake || \
195 die "Failed to fix cmake files"
196
197 make DESTDIR="${D}" install || die "make install failed"
198
199 # install docs
200 dohtml "${S}"/README.html || die "Failed to install docs"
201
202 # install python modules
203 if use python; then
204 cd "${S}"/Wrapping/Python
205 docinto vtk_python
206 distutils_src_install
207 fi
208
209 # install jar
210 use java && java-pkg_dojar "${S}"/bin/vtk.jar
211
212 # install Tcl docs
213 docinto vtk_tcl
214 dodoc "${S}"/Wrapping/Tcl/README || \
215 die "Failed to install Tcl docs"
216
217 # install examples
218 if use examples; then
219 dodir /usr/share/${PN} || \
220 die "Failed to create examples directory"
221 cp -pPR "${S}"/Examples "${D}"/usr/share/${PN}/examples || \
222 die "Failed to copy example files"
223
224 # fix example's permissions
225 find "${D}"/usr/share/${PN}/examples -type d -exec \
226 chmod 0755 {} \; || \
227 die "Failed to fix example directories permissions"
228 find "${D}"/usr/share/${PN}/examples -type f -exec \
229 chmod 0644 {} \; || \
230 die "Failed to fix example files permissions"
231
232 cp -pPR "${WORKDIR}"/VTKData "${D}"/usr/share/${PN}/data || \
233 die "Failed to copy data files"
234
235 # fix data's permissions
236 find "${D}"/usr/share/${PN}/data -type d -exec \
237 chmod 0755 {} \; || \
238 die "Failed to fix data directories permissions"
239 find "${D}"/usr/share/${PN}/data -type f -exec \
240 chmod 0644 {} \; || \
241 die "Failed to fix data files permissions"
242 fi
243
244 #install big docs
245 if use doc; then
246 cd "${WORKDIR}"/html
247 rm -f *.md5 || die "Failed to remove superfluous hashes"
248 einfo "Installing API docs. This may take some time."
249 insinto "/usr/share/doc/${PF}/api-docs"
250 doins -r ./* || die "Failed to install docs"
251 fi
252
253 # environment
254 echo "VTK_DATA_ROOT=/usr/share/${PN}/data" >> "${T}"/40${PN}
255 echo "VTK_DIR=/usr/$(get_libdir)/${PN}-${SPV}" >> "${T}"/40${PN}
256 echo "VTKHOME=/usr" >> "${T}"/40${PN}
257 doenvd "${T}"/40${PN}
258 }
259
260 pkg_postinst() {
261 if use patented; then
262 ewarn "Using patented code in VTK may require a license."
263 ewarn "For more information, please read:"
264 ewarn "http://public.kitware.com/cgi-bin/vtkfaq?req=show&file=faq07.005.htp"
265 fi
266 }

  ViewVC Help
Powered by ViewVC 1.1.20