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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download)
Tue Sep 4 06:28:56 2012 UTC (7 years, 11 months ago) by jlec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.7: +1 -1 lines
FILE REMOVED
sci-libs/vtk: Drop old

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

1 # Copyright 1999-2012 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.1.ebuild,v 1.7 2012/02/10 18:55:37 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 DEPEND="${RDEPEND}
58 java? ( >=virtual/jdk-1.5 )
59 boost? ( >=dev-libs/boost-1.40.0[mpi?] )
60 dev-util/cmake"
61
62 S="${WORKDIR}"/VTK
63
64 pkg_setup() {
65 echo
66 einfo "Please note that the VTK build occasionally fails when"
67 einfo "using parallel make. Hence, if you experience a build"
68 einfo "failure please try re-emerging with MAKEOPTS=\"-j1\" first."
69 echo
70
71 java-pkg-opt-2_pkg_setup
72
73 use python && python_set_active_version 2
74 append-cppflags -D__STDC_CONSTANT_MACROS
75 }
76
77 src_prepare() {
78 epatch \
79 "${FILESDIR}"/${PN}-5.6.0-cg-path.patch \
80 "${FILESDIR}"/${PN}-5.2.0-tcl-install.patch \
81 "${FILESDIR}"/${PN}-5.6.0-boost-property_map.patch \
82 "${FILESDIR}"/${PN}-5.6.0-libpng14.patch \
83 "${FILESDIR}"/${PN}-5.6.0-R.patch \
84 "${FILESDIR}"/${PN}-5.6.0-odbc.patch \
85 "${FILESDIR}"/${P}-ffmpeg.patch \
86 "${FILESDIR}"/${P}-gcc-46.patch \
87 "${FILESDIR}"/${P}-libpng15.patch \
88 "${FILESDIR}"/${P}-libav-0.8.patch
89
90 # Fix sure buffer overflow on some processors as reported by Flameyes in #338819
91 sed -e "s:CHIPNAME_STRING_LENGTH (48 + 1):CHIPNAME_STRING_LENGTH (79 + 1):" \
92 -i Utilities/kwsys/SystemInformation.cxx \
93 || die "Failed to fix SystemInformation.cxx buffer overflow"
94 sed -e "s:@VTK_TCL_LIBRARY_DIR@:/usr/$(get_libdir):" \
95 -i Wrapping/Tcl/pkgIndex.tcl.in \
96 || die "Failed to fix tcl pkgIndex file"
97 # Patch FindPythonLibs.cmake for python-2.7, removing it does more harm than good.
98 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:" \
99 -i CMake/FindPythonLibs.cmake || die "failed to patch for python 2.7"
100 }
101
102 src_configure() {
103 # general configuration
104 local mycmakeargs=(
105 -Wno-dev
106 -DVTK_INSTALL_PACKAGE_DIR=/$(get_libdir)/${PN}-${SPV}
107 -DCMAKE_SKIP_RPATH=YES
108 -DVTK_DIR="${S}"
109 -DVTK_INSTALL_LIB_DIR=/$(get_libdir)/
110 -DVTK_DATA_ROOT:PATH="${EPREFIX}"/usr/share/${PN}/data
111 -DCMAKE_INSTALL_PREFIX="${EPREFIX}"/usr
112 -DBUILD_SHARED_LIBS=ON
113 -DVTK_USE_SYSTEM_EXPAT=ON
114 -DVTK_USE_SYSTEM_FREETYPE=ON
115 -DVTK_USE_SYSTEM_JPEG=ON
116 -DVTK_USE_SYSTEM_LIBXML2=ON
117 -DVTK_USE_SYSTEM_PNG=ON
118 -DVTK_USE_SYSTEM_TIFF=ON
119 -DVTK_USE_SYSTEM_ZLIB=ON
120 -DBUILD_TESTING=OFF
121 -DBUILD_EXAMPLES=OFF
122 -DVTK_USE_HYBRID=ON
123 -DVTK_USE_GL2PS=ON
124 -DVTK_USE_RENDERING=ON)
125
126 # use flag triggered options
127 mycmakeargs+=(
128 $(cmake-utils_use boost VTK_USE_BOOST)
129 $(cmake-utils_use cg VTK_USE_CG_SHADERS)
130 $(cmake-utils_use doc DOCUMENTATION_HTML_HELP)
131 $(cmake-utils_use_build doc DOCUMENTATION)
132 $(cmake-utils_use java VTK_USE_JAVA)
133 $(cmake-utils_use mpi VTK_USE_MPI)
134 $(cmake-utils_use patented VTK_USE_PATENTED)
135 $(cmake-utils_use qt4 VTK_USE_QT)
136 $(cmake-utils_use tcl VTK_WRAP_TCL)
137 $(cmake-utils_use theora VTK_USE_OGGTHEORA_ENCODER)
138 $(cmake-utils_use ffmpeg VTK_USE_FFMPEG_ENCODER)
139 $(cmake-utils_use tk VTK_USE_TK)
140 $(cmake-utils_use threads VTK_USE_PARALLEL)
141 $(cmake-utils_use R VTK_USE_GNU_R)
142 $(cmake-utils_use mysql VTK_USE_MYSQL)
143 $(cmake-utils_use postgres VTK_USE_POSTGRES)
144 $(cmake-utils_use odbc VTK_USE_ODBC) )
145
146 use theora &&
147 mycmakeargs+=(-DVTK_USE_SYSTEM_OGGTHEORA=ON)
148
149 # mpi needs the parallel framework
150 if use mpi && use !threads; then
151 mycmakeargs+=(-DVTK_USE_PARALLEL=ON)
152 fi
153
154 if use java; then
155 mycmakeargs+=(
156 -DVTK_WRAP_JAVA=ON
157 -DJAVA_AWT_INCLUDE_PATH=`java-config -O`/include
158 -DJAVA_INCLUDE_PATH:PATH=`java-config -O`/include
159 -DJAVA_INCLUDE_PATH2:PATH=`java-config -O`/include/linux)
160
161 if [ "${ARCH}" == "amd64" ]; then
162 mycmakeargs+=(-DJAVA_AWT_LIBRARY=`java-config -O`/jre/lib/${ARCH}/libjawt.so)
163 else
164 mycmakeargs+=(-DJAVA_AWT_LIBRARY:PATH=`java-config -O`/jre/lib/i386/libjawt.so)
165 fi
166 fi
167
168 if use python; then
169 mycmakeargs+=(
170 -DVTK_WRAP_PYTHON=ON
171 -DPYTHON_INCLUDE_PATH="${EPREFIX}$(python_get_includedir)"
172 -DPYTHON_LIBRARY="${EPREFIX}$(python_get_library)"
173 -DVTK_PYTHON_SETUP_ARGS:STRING=--root="${D}")
174 fi
175
176 if use qt4 ; then
177 mycmakeargs+=(
178 -DVTK_USE_GUISUPPORT=ON
179 -DVTK_USE_QVTK=ON
180 -DVTK_USE_QVTK_QTOPENGL=ON
181 -DQT_WRAP_CPP=ON
182 -DQT_WRAP_UI=ON
183 -DVTK_INSTALL_QT_DIR=/$(get_libdir)/qt4/plugins/${PN}
184 -DDESIRED_QT_VERSION=4
185 -DQT_MOC_EXECUTABLE="${EPREFIX}/usr/bin/moc"
186 -DQT_UIC_EXECUTABLE="${EPREFIX}/usr/bin/uic"
187 -DQT_INCLUDE_DIR="${EPREFIX}/usr/include/qt4"
188 -DQT_QMAKE_EXECUTABLE="${EPREFIX}/usr/bin/qmake")
189 fi
190
191 cmake-utils_src_configure
192 }
193
194 src_install() {
195 cmake-utils_src_install
196
197 # install docs
198 dohtml "${S}"/README.html || die "Failed to install docs"
199
200 # install Tcl docs
201 docinto vtk_tcl
202 dodoc "${S}"/Wrapping/Tcl/README || \
203 die "Failed to install Tcl docs"
204
205 # install examples
206 if use examples; then
207 insinto /usr/share/${PN}
208 mv -v Examples examples
209 doins -r examples || die
210 mv -v "${WORKDIR}"/{VTKData,data} || die
211 doins -r "${WORKDIR}"/data || die
212 fi
213
214 #install big docs
215 if use doc; then
216 cd "${WORKDIR}"/html
217 rm -f *.md5 || die "Failed to remove superfluous hashes"
218 einfo "Installing API docs. This may take some time."
219 insinto "/usr/share/doc/${PF}/api-docs"
220 doins -r ./* || die "Failed to install docs"
221 fi
222
223 # environment
224 cat >> "${T}"/40${PN} <<- EOF
225 VTK_DATA_ROOT=${EPREFIX}/usr/share/${PN}/data
226 VTK_DIR=${EPREFIX}/usr/$(get_libdir)/${PN}-${SPV}
227 VTKHOME=${EPREFIX}/usr
228 EOF
229 doenvd "${T}"/40${PN}
230 }
231
232 pkg_postinst() {
233 if use patented; then
234 ewarn "Using patented code in VTK may require a license."
235 ewarn "For more information, please read:"
236 ewarn "http://public.kitware.com/cgi-bin/vtkfaq?req=show&file=faq07.005.htp"
237 fi
238
239 if use python; then
240 python_mod_optimize vtk
241 fi
242 }
243
244 pkg_postrm() {
245 if use python; then
246 python_mod_cleanup vtk
247 fi
248 }

  ViewVC Help
Powered by ViewVC 1.1.20