/[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.1 - (hide annotations) (download)
Sat Jan 11 16:55:50 2014 UTC (6 years, 6 months ago) by jlec
Branch: MAIN
sci-libs/vtk: Version Bump; support offscreen rendering, #126270; unbundle as many as possible libs, #433481

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

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

  ViewVC Help
Powered by ViewVC 1.1.20