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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.13 - (show annotations) (download)
Fri Mar 20 15:19:16 2015 UTC (5 years, 4 months ago) by jlec
Branch: MAIN
Changes since 1.12: +3 -3 lines
Fix tcl/tk slotting

(Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key B9D4F231BD1558AB!)

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sci-libs/vtk/vtk-6.0.0.ebuild,v 1.12 2015/03/11 08:30:12 jlec Exp $
4
5 EAPI=5
6
7 PYTHON_COMPAT=( python{2_6,2_7} )
8 CMAKE_MAKEFILE_GENERATOR=ninja
9
10 inherit eutils flag-o-matic java-pkg-opt-2 python-single-r1 qmake-utils versionator toolchain-funcs cmake-utils virtualx
11
12 # Short package version
13 SPV="$(get_version_component_range 1-2)"
14
15 DESCRIPTION="The Visualization Toolkit"
16 HOMEPAGE="http://www.vtk.org/"
17 SRC_URI="
18 http://www.${PN}.org/files/release/${SPV}/${P/_rc/.rc}.tar.gz
19 doc? ( http://www.${PN}.org/files/release/${SPV}/${PN}DocHtml-${PV}.tar.gz )"
20
21 LICENSE="BSD LGPL-2"
22 KEYWORDS="~amd64 ~arm ~x86 ~amd64-linux ~x86-linux"
23 SLOT="0"
24 IUSE="
25 aqua boost cg doc examples imaging ffmpeg java mpi mysql odbc
26 offscreen postgres python qt4 rendering test theora tk tcl
27 video_cards_nvidia views R +X"
28
29 REQUIRED_USE="
30 java? ( qt4 )
31 python? ( ${PYTHON_REQUIRED_USE} )
32 tcl? ( rendering )
33 test? ( python )
34 tk? ( tcl )
35 ^^ ( X aqua offscreen )"
36
37 RDEPEND="
38 dev-libs/expat
39 dev-libs/libxml2:2
40 media-libs/freetype
41 media-libs/libpng:0
42 media-libs/mesa
43 media-libs/libtheora
44 media-libs/tiff:0
45 sci-libs/exodusii
46 sci-libs/hdf5:=
47 sci-libs/netcdf-cxx:3
48 sys-libs/zlib
49 virtual/jpeg:0
50 virtual/opengl
51 >=x11-libs/gl2ps-1.3.8
52 x11-libs/libX11
53 x11-libs/libXmu
54 x11-libs/libXt
55 boost? ( >=dev-libs/boost-1.40.0[mpi?] )
56 cg? ( media-gfx/nvidia-cg-toolkit )
57 examples? (
58 dev-qt/qtcore:4
59 dev-qt/qtgui:4
60 sci-libs/vtkdata
61 )
62 ffmpeg? ( virtual/ffmpeg )
63 java? ( >=virtual/jre-1.5:* )
64 mpi? ( virtual/mpi[cxx,romio] )
65 mysql? ( virtual/mysql )
66 odbc? ( dev-db/unixODBC )
67 offscreen? ( media-libs/mesa[osmesa] )
68 postgres? ( dev-db/postgresql:= )
69 python? (
70 ${PYTHON_DEPS}
71 dev-python/sip[${PYTHON_USEDEP}]
72 )
73 qt4? (
74 dev-qt/designer:4
75 dev-qt/qtcore:4
76 dev-qt/qtgui:4
77 dev-qt/qtopengl:4
78 dev-qt/qtsql:4
79 dev-qt/qtwebkit:4
80 python? ( dev-python/PyQt4[${PYTHON_USEDEP}] )
81 )
82 tcl? ( dev-lang/tcl:0= )
83 tk? ( dev-lang/tk:0= )
84 video_cards_nvidia? ( media-video/nvidia-settings )
85 R? ( dev-lang/R )"
86 DEPEND="${RDEPEND}
87 doc? ( app-doc/doxygen )
88 java? ( >=virtual/jdk-1.5 )
89 test? ( sci-libs/vtkdata )"
90
91 S="${WORKDIR}"/VTK${PV}
92
93 PATCHES=(
94 "${FILESDIR}"/${P}-cg-path.patch
95 "${FILESDIR}"/${P}-install.patch
96 "${FILESDIR}"/${P}-system.patch
97 "${FILESDIR}"/${P}-netcdf.patch
98 "${FILESDIR}"/${P}-vtkpython.patch
99 )
100
101 RESTRICT=test
102
103 pkg_setup() {
104 use java && java-pkg-opt-2_pkg_setup
105 use python && python-single-r1_pkg_setup
106
107 append-cppflags -D__STDC_CONSTANT_MACROS -D_UNICODE
108 }
109
110 src_prepare() {
111 sed \
112 -e 's:libproj4:libproj:g' \
113 -e 's:lib_proj.h:lib_abi.h:g' \
114 -i CMake/FindLIBPROJ4.cmake || die
115
116 local x
117 for x in expat freetype gl2ps hdf5 jpeg libxml2 netcdf oggtheora png tiff zlib; do
118 rm -r ThirdParty/${x}/vtk${x} || die
119 done
120
121 if use examples || use test; then
122 # Replace relative path ../../../VTKData with
123 # otherwise it will break on symlinks.
124 grep -rl '\.\./\.\./\.\./\.\./VTKData' . | xargs \
125 sed \
126 -e "s|\.\./\.\./\.\./\.\./VTKData|${EPREFIX}/usr/share/vtk/data|g" \
127 -e "s|\.\./\.\./\.\./\.\./\.\./VTKData|${EPREFIX}/usr/share/vtk/data|g" \
128 -i || die
129 fi
130
131 use java && export JAVA_HOME="${EPREFIX}/etc/java-config-2/current-system-vm"
132
133 cmake-utils_src_prepare
134 }
135
136 src_configure() {
137 # general configuration
138 local mycmakeargs=(
139 -Wno-dev
140 # -DCMAKE_SKIP_RPATH=YES
141 -DVTK_DIR="${S}"
142 -DVTK_INSTALL_LIBRARY_DIR=$(get_libdir)
143 -DVTK_DATA_ROOT:PATH="${EPREFIX}/usr/share/${PN}/data"
144 -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
145 -DVTK_CUSTOM_LIBRARY_SUFFIX=""
146 -DBUILD_SHARED_LIBS=ON
147 -DVTK_USE_SYSTEM_EXPAT=ON
148 -DVTK_USE_SYSTEM_FREETYPE=ON
149 -DVTK_USE_SYSTEM_FreeType=ON
150 -DVTK_USE_SYSTEM_GL2PS=ON
151 -DVTK_USE_SYSTEM_HDF5=ON
152 -DVTK_USE_SYSTEM_JPEG=ON
153 -DVTK_USE_SYSTEM_LIBPROJ4=OFF
154 # -DLIBPROJ4_DIR="${EPREFIX}/usr"
155 -DVTK_USE_SYSTEM_LIBXML2=ON
156 -DVTK_USE_SYSTEM_LibXml2=ON
157 -DVTK_USE_SYSTEM_NETCDF=ON
158 -DVTK_USE_SYSTEM_OGGTHEORA=ON
159 -DVTK_USE_SYSTEM_PNG=ON
160 -DVTK_USE_SYSTEM_TIFF=ON
161 # -DVTK_USE_SYSTEM_XDMF2=ON
162 -DVTK_USE_SYSTEM_ZLIB=ON
163 -DVTK_USE_SYSTEM_LIBRARIES=ON
164 -DVTK_USE_GL2PS=ON
165 -DVTK_USE_PARALLEL=ON
166 )
167
168 mycmakeargs+=(
169 -DVTK_EXTRA_COMPILER_WARNINGS=ON
170 -DVTK_Group_StandAlone=ON
171 )
172
173 mycmakeargs+=(
174 $(cmake-utils_use_build doc DOCUMENTATION)
175 $(cmake-utils_use_build examples EXAMPLES)
176 $(cmake-utils_use_build test TESTING)
177 $(cmake-utils_use_build test VTK_BUILD_ALL_MODULES_FOR_TESTS)
178 $(cmake-utils_use doc DOCUMENTATION_HTML_HELP)
179 $(cmake-utils_use imaging VTK_Group_Imaging)
180 $(cmake-utils_use mpi VTK_Group_MPI)
181 $(cmake-utils_use qt4 VTK_Group_Qt)
182 $(cmake-utils_use rendering VTK_Group_Rendering)
183 $(cmake-utils_use tk VTK_Group_Tk)
184 $(cmake-utils_use views VTK_Group_Views)
185 $(cmake-utils_use java VTK_WRAP_JAVA)
186 $(cmake-utils_use python VTK_WRAP_PYTHON)
187 $(cmake-utils_use python VTK_WRAP_PYTHON_SIP)
188 $(cmake-utils_use tcl VTK_WRAP_TCL)
189 # -DVTK_BUILD_ALL_MODULES=ON
190 )
191
192 mycmakeargs+=(
193 $(cmake-utils_use boost VTK_USE_BOOST)
194 $(cmake-utils_use cg VTK_USE_CG_SHADERS)
195 $(cmake-utils_use odbc VTK_USE_ODBC)
196 $(cmake-utils_use offscreen VTK_USE_OFFSCREEN)
197 $(cmake-utils_use offscreen VTK_OPENGL_HAS_OSMESA)
198 $(cmake-utils_use theora VTK_USE_OGGTHEORA_ENCODER)
199 $(cmake-utils_use ffmpeg VTK_USE_FFMPEG_ENCODER)
200 $(cmake-utils_use video_cards_nvidia VTK_USE_NVCONTROL)
201 $(cmake-utils_use R Module_vtkFiltersStatisticsGnuR)
202 $(cmake-utils_use X VTK_USE_X)
203 )
204
205 # Apple stuff, does it really work?
206 mycmakeargs+=( $(cmake-utils_use aqua VTK_USE_COCOA) )
207
208 if use java; then
209 # local _ejavahome=${EPREFIX}/etc/java-config-2/current-system-vm
210 #
211 # mycmakeargs+=(
212 # -DJAVAC=${EPREFIX}/usr/bin/javac
213 # -DJAVAC=$(java-config -c)
214 # -DJAVA_AWT_INCLUDE_PATH=${JAVA_HOME}/include
215 # -DJAVA_INCLUDE_PATH:PATH=${JAVA_HOME}/include
216 # -DJAVA_INCLUDE_PATH2:PATH=${JAVA_HOME}/include/linux
217 # )
218 #
219 if [ "${ARCH}" == "amd64" ]; then
220 mycmakeargs+=( -DJAVA_AWT_LIBRARY="${JAVA_HOME}/jre/lib/${ARCH}/libjawt.so;${JAVA_HOME}/jre/lib/${ARCH}/xawt/libmawt.so" )
221 else
222 mycmakeargs+=( -DJAVA_AWT_LIBRARY="${JAVA_HOME}/jre/lib/i386/libjawt.so;${JAVA_HOME}/jre/lib/i386/xawt/libmawt.so" )
223 fi
224 fi
225 if use python; then
226 mycmakeargs+=(
227 -DPYTHON_INCLUDE_DIR="$(python_get_includedir)"
228 -DPYTHON_LIBRARY="$(python_get_library_path)"
229 -DSIP_PYQT_DIR="${EPREFIX}/usr/share/sip"
230 -DSIP_INCLUDE_DIR="$(python_get_includedir)"
231 -DVTK_PYTHON_INCLUDE_DIR="$(python_get_includedir)"
232 -DVTK_PYTHON_LIBRARY="$(python_get_library_path)"
233 -DVTK_PYTHON_SETUP_ARGS:STRING="--prefix=${PREFIX} --root=${D}"
234 )
235 fi
236
237 if use qt4; then
238 mycmakeargs+=(
239 -DVTK_USE_QVTK=ON
240 -DVTK_USE_QVTK_OPENGL=ON
241 -DVTK_USE_QVTK_QTOPENGL=ON
242 -DQT_WRAP_CPP=ON
243 -DQT_WRAP_UI=ON
244 -DVTK_INSTALL_QT_DIR=/$(get_libdir)/qt4/plugins/designer
245 -DDESIRED_QT_VERSION=4
246 -DQT_MOC_EXECUTABLE="$(qt4_get_bindir)/moc"
247 -DQT_UIC_EXECUTABLE="$(qt4_get_bindir)/uic"
248 -DQT_INCLUDE_DIR="${EPREFIX}/usr/include/qt4"
249 -DQT_QMAKE_EXECUTABLE="$(qt4_get_bindir)/qmake"
250 )
251 fi
252
253 if use R; then
254 mycmakeargs+=(
255 # -DR_LIBRARY_BLAS=$($(tc-getPKG_CONFIG) --libs blas)
256 # -DR_LIBRARY_LAPACK=$($(tc-getPKG_CONFIG) --libs lapack)
257 -DR_LIBRARY_BLAS=/usr/$(get_libdir)/R/lib/libR.so
258 -DR_LIBRARY_LAPACK=/usr/$(get_libdir)/R/lib/libR.so
259 )
260 fi
261
262 cmake-utils_src_configure
263
264 cat >> "${BUILD_DIR}"/Utilities/MaterialLibrary/ProcessShader.sh <<- EOF
265 #!${EPREFIX}/bin/bash
266
267 export LD_LIBRARY_PATH="${BUILD_DIR}"/lib
268 "${BUILD_DIR}"/bin/vtkProcessShader \$@
269 EOF
270 chmod 750 "${BUILD_DIR}"/Utilities/MaterialLibrary/ProcessShader.sh || die
271 }
272
273 src_test() {
274 local tcllib
275 ln -sf "${BUILD_DIR}"/lib "${BUILD_DIR}"/lib/Release || die
276 for tcllib in "${BUILD_DIR}"/lib/lib*TCL*so; do
277 ln -sf $(basename "${tcllib}").1 "${tcllib/.so/-${SPV}.so}" || die
278 done
279 export LD_LIBRARY_PATH="${BUILD_DIR}"/lib:"${JAVA_HOME}"/jre/lib/${ARCH}/:"${JAVA_HOME}"/jre/lib/${ARCH}/xawt/
280 local VIRTUALX_COMMAND="cmake-utils_src_test"
281 # local VIRTUALX_COMMAND="cmake-utils_src_test -R Java"
282 # local VIRTUALX_COMMAND="cmake-utils_src_test -I 364,365"
283 virtualmake
284 }
285
286 src_install() {
287 # install docs
288 HTML_DOCS=( "${S}"/README.html )
289
290 cmake-utils_src_install
291
292 use java && java-pkg_regjar "${ED}"/usr/$(get_libdir)/${PN}.jar
293
294 if use tcl; then
295 # install Tcl docs
296 docinto vtk_tcl
297 dodoc "${S}"/Wrapping/Tcl/README
298 fi
299
300 # install examples
301 if use examples; then
302 insinto /usr/share/${PN}
303 mv -v Examples examples || die
304 doins -r examples
305 fi
306
307 #install big docs
308 if use doc; then
309 cd "${WORKDIR}"/html || die
310 rm -f *.md5 || die "Failed to remove superfluous hashes"
311 einfo "Installing API docs. This may take some time."
312 insinto "/usr/share/doc/${PF}/api-docs"
313 doins -r ./*
314 fi
315
316 # environment
317 cat >> "${T}"/40${PN} <<- EOF
318 VTK_DATA_ROOT=${EPREFIX}/usr/share/${PN}/data
319 VTK_DIR=${EPREFIX}/usr/$(get_libdir)/${PN}-${SPV}
320 VTKHOME=${EPREFIX}/usr
321 EOF
322 doenvd "${T}"/40${PN}
323 }

  ViewVC Help
Powered by ViewVC 1.1.20