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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Fri Feb 10 18:55:37 2012 UTC (8 years, 6 months ago) by jlec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
Use selected python ABI, #401839, patch by JTRiley; dropped old

(Portage version: 2.2.0_alpha85/cvs/Linux x86_64)

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

  ViewVC Help
Powered by ViewVC 1.1.20