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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.16 - (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.15: +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.4.2-r1.ebuild,v 1.15 2011/03/02 21:00:54 jlec Exp $
4
5 EAPI="3"
6 PYTHON_DEPEND="python? 2"
7
8 inherit cmake-utils eutils flag-o-matic java-pkg-opt-2 python qt4 versionator toolchain-funcs
9
10 # Short package version
11 SPV="$(get_version_component_range 1-2)"
12
13 DESCRIPTION="The Visualization Toolkit"
14 HOMEPAGE="http://www.vtk.org"
15 SRC_URI="http://www.${PN}.org/files/release/${SPV}/${P}.tar.gz
16 examples? ( http://www.${PN}.org/files/release/${SPV}/${PN}data-${PV}.tar.gz )
17 doc? ( http://www.${PN}.org/doc/release/${SPV}/${PN}DocHtml-${PV}.tar.gz )"
18
19 LICENSE="BSD LGPL-2"
20 KEYWORDS="~amd64 ~x86"
21 SLOT="0"
22 IUSE="boost cg doc examples mpi patented python qt4 tcl tk threads"
23 RDEPEND="mpi? ( || (
24 sys-cluster/openmpi
25 sys-cluster/mpich2[cxx] ) )
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 )
34 examples? ( x11-libs/qt-core:4[qt3support]
35 x11-libs/qt-gui:4[qt3support] )
36 dev-libs/expat
37 dev-libs/libxml2:2
38 media-libs/freetype
39 virtual/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.0 )
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
59 java-pkg-opt-2_pkg_setup
60
61 use python && python_set_active_version 2
62 use qt4 && qt4_pkg_setup
63 }
64
65 src_prepare() {
66 epatch "${FILESDIR}"/${P}-cg-path.patch
67 epatch "${FILESDIR}"/${PN}-5.2.0-tcl-install.patch
68 epatch "${FILESDIR}"/${P}-boost-property_map.patch
69 epatch "${FILESDIR}"/${P}-libpng14.patch
70 sed -e "s:@VTK_TCL_LIBRARY_DIR@:/usr/$(get_libdir):" \
71 -i Wrapping/Tcl/pkgIndex.tcl.in \
72 || die "Failed to fix tcl pkgIndex file"
73 }
74
75 src_configure() {
76 # general configuration
77 local mycmakeargs=(
78 -Wno-dev
79 -DVTK_INSTALL_PACKAGE_DIR=/$(get_libdir)/${PN}-${SPV}
80 -DCMAKE_SKIP_RPATH=YES
81 -DVTK_DIR="${S}"
82 -DVTK_INSTALL_LIB_DIR=/$(get_libdir)/
83 -DVTK_DATA_ROOT:PATH=/usr/share/${PN}/data
84 -DCMAKE_INSTALL_PREFIX=/usr
85 -DBUILD_SHARED_LIBS=ON
86 -DVTK_USE_SYSTEM_FREETYPE=ON
87 -DVTK_USE_SYSTEM_JPEG=ON
88 -DVTK_USE_SYSTEM_PNG=ON
89 -DVTK_USE_SYSTEM_TIFF=ON
90 -DVTK_USE_SYSTEM_ZLIB=ON
91 -DVTK_USE_SYSTEM_EXPAT=ON
92 -DVTK_USE_SYSTEM_LIBXML2=ON
93 -DBUILD_TESTING=OFF
94 -DBUILD_EXAMPLES=OFF
95 -DVTK_USE_HYBRID=ON
96 -DVTK_USE_GL2PS=ON
97 -DVTK_USE_RENDERING=ON)
98
99 # use flag triggered options
100 mycmakeargs+=(
101 $(cmake-utils_use boost VTK_USE_BOOST)
102 $(cmake-utils_use cg VTK_USE_CG_SHADERS)
103 $(cmake-utils_use tcl VTK_WRAP_TCL)
104 $(cmake-utils_use tk VTK_USE_TK)
105 $(cmake-utils_use threads VTK_USE_PARALLEL)
106 $(cmake-utils_use patented VTK_USE_PATENTED)
107 $(cmake-utils_use doc DOCUMENTATION_HTML_HELP)
108 $(cmake-utils_use_build doc DOCUMENTATION)
109 $(cmake-utils_use mpi VTK_USE_MPI))
110
111 # mpi needs the parallel framework
112 if use mpi && use !threads; then
113 mycmakeargs+=(-DVTK_USE_PARALLEL=ON)
114 fi
115
116 if use java; then
117 mycmakeargs+=(
118 -DVTK_WRAP_JAVA=ON
119 -DJAVA_AWT_INCLUDE_PATH=`java-config -O`/include
120 -DJAVA_INCLUDE_PATH:PATH=`java-config -O`/include
121 -DJAVA_INCLUDE_PATH2:PATH=`java-config -O`/include/linux)
122
123 if [ "${ARCH}" == "amd64" ]; then
124 mycmakeargs+=(-DJAVA_AWT_LIBRARY=`java-config -O`/jre/lib/${ARCH}/libjawt.so)
125 else
126 mycmakeargs+=(-DJAVA_AWT_LIBRARY:PATH=`java-config -O`/jre/lib/i386/libjawt.so)
127 fi
128 fi
129
130 if use python; then
131 mycmakeargs+=(
132 -DVTK_WRAP_PYTHON=ON
133 -DPYTHON_INCLUDE_PATH=$(python_get_includedir)
134 -DPYTHON_LIBRARY=$(python_get_library)
135 -DVTK_PYTHON_SETUP_ARGS:STRING=--root="${D}")
136 fi
137
138 if use qt4 ; then
139 mycmakeargs+=(
140 -DVTK_USE_GUISUPPORT=ON
141 -DVTK_USE_QVTK=ON
142 -DVTK_USE_QVTK_QTOPENGL=ON
143 -DQT_WRAP_CPP=ON
144 -DQT_WRAP_UI=ON)
145 fi
146
147 if use qt4; then
148 mycmakeargs+=(
149 -DVTK_INSTALL_QT_DIR=/$(get_libdir)/qt4/plugins/${PN}
150 -DDESIRED_QT_VERSION=4
151 -DQT_MOC_EXECUTABLE=/usr/bin/moc
152 -DQT_UIC_EXECUTABLE=/usr/bin/uic
153 -DQT_INCLUDE_DIR=/usr/include/qt4
154 -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake)
155 fi
156
157 cmake-utils_src_configure
158 }
159
160 src_install() {
161 cmake-utils_src_install
162
163 # install docs
164 dohtml "${S}"/README.html || die "Failed to install docs"
165
166 # install Tcl docs
167 docinto vtk_tcl
168 dodoc "${S}"/Wrapping/Tcl/README || \
169 die "Failed to install Tcl docs"
170
171 # install examples
172 if use examples; then
173 dodir /usr/share/${PN} || \
174 die "Failed to create data/examples directory"
175
176 cp -pPR "${S}"/Examples "${D}"/usr/share/${PN}/examples || \
177 die "Failed to copy example files"
178
179 # fix example's permissions
180 find "${D}"/usr/share/${PN}/examples -type d -exec \
181 chmod 0755 {} \; || \
182 die "Failed to fix example directories permissions"
183 find "${D}"/usr/share/${PN}/examples -type f -exec \
184 chmod 0644 {} \; || \
185 die "Failed to fix example files permissions"
186
187 cp -pPR "${WORKDIR}"/VTKData "${D}"/usr/share/${PN}/data || \
188 die "Failed to copy data files"
189
190 # fix data's permissions
191 find "${D}"/usr/share/${PN}/data -type d -exec \
192 chmod 0755 {} \; || \
193 die "Failed to fix data directories permissions"
194 find "${D}"/usr/share/${PN}/data -type f -exec \
195 chmod 0644 {} \; || \
196 die "Failed to fix data files permissions"
197 fi
198
199 #install big docs
200 if use doc; then
201 cd "${WORKDIR}"/html
202 rm -f *.md5 || die "Failed to remove superfluous hashes"
203 einfo "Installing API docs. This may take some time."
204 insinto "/usr/share/doc/${PF}/api-docs"
205 doins -r ./* || die "Failed to install docs"
206 fi
207
208 # environment
209 echo "VTK_DATA_ROOT=/usr/share/${PN}/data" >> "${T}"/40${PN}
210 echo "VTK_DIR=/usr/$(get_libdir)/${PN}-${SPV}" >> "${T}"/40${PN}
211 echo "VTKHOME=/usr" >> "${T}"/40${PN}
212 doenvd "${T}"/40${PN}
213 }
214
215 pkg_postinst() {
216 if use patented; then
217 ewarn "Using patented code in VTK may require a license."
218 ewarn "For more information, please read:"
219 ewarn "http://public.kitware.com/cgi-bin/vtkfaq?req=show&file=faq07.005.htp"
220 fi
221
222 if use python; then
223 python_mod_optimize vtk
224 fi
225 }
226
227 pkg_postrm() {
228 if use python; then
229 python_mod_cleanup vtk
230 fi
231 }

  ViewVC Help
Powered by ViewVC 1.1.20