# Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit flag-o-matic distutils DESCRIPTION="visualization toolkit" HOMEPAGE="http://www.vtk.org" LICENSE="VTK" SLOT="0" KEYWORDS="~x86" IUSE="doc python tcltk patented" RDEPEND="python? ( >=dev-lang/python-2.0 ) tcltk? ( >=dev-lang/tcl-8.2.3 ) media-libs/jpeg media-libs/tiff media-libs/libpng sys-libs/zlib dev-libs/expat" DEPEND=">=dev-util/cmake-1.8 ${RDEPEND}" SHORT_PV=`echo ${PV} | sed -e "s/\(^[0-9]*\.[0-9]*\).*/\1/"` SRC_URI="ftp://public.kitware.com/pub/vtk/vtk${SHORT_PV}/VTK-${PV}.tar.gz doc? ( ftp://public.kitware.com/pub/vtk/vtk${SHORT_PV}/VTKDocHtml-${SHORT_PV}.tar.gz )" S=${WORKDIR}/VTK src_compile() { # gcc versions 3.2.x seem to have sse-related bugs that are triggered # by VTK when compiling for pentium3/4 filter-mfpmath sse filter-flags "-msse -msse2" use x86 && append-flags "-mno-sse" # build list of config variable defines to pass to cmake CMAKE_VARIABLES="-DCMAKE_INSTALL_PREFIX:PATH=/usr" CMAKE_VARIABLES="${CMAKE_VARIABLES} -DBUILD_SHARED_LIBS:BOOL=ON" # is local flag the right way to deal with this? use patented && CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_PATENTED:BOOL=ON" CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_HYBRID:BOOL=ON" # should this be configurable? CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_PARALLEL:BOOL=ON" use tcltk && CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_WRAP_TCL:BOOL=ON" use python && CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_WRAP_PYTHON:BOOL=ON" CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_SYSTEM_JPEG:BOOL=ON" CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_SYSTEM_PNG:BOOL=ON" CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_SYSTEM_TIFF:BOOL=ON" CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_SYSTEM_ZLIB:BOOL=ON" CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_SYSTEM_EXPAT:BOOL=ON" # we do not run tests (but it might be a good ide to do so) CMAKE_VARIABLES="${CMAKE_VARIABLES} -DBUILD_TESTING:BOOL=OFF" # make cmake prefer searching libraries in /usr/lib (otherwise wrong ones - # like /opt/ibm-jdk-1.4.1/jre/bin/libjpeg.so instead of /usr/lib/libjpeg.so # - might be selected) export PATH="/usr/lib:${PATH}" cmake ${CMAKE_VARIABLES} . || die "cmake configuration failed" emake || die "emake failed" } src_install() { make install || die "make install failed" # paths for dynamic linking LD_PATHS="/usr/lib/vtk" # python are not installed by 'make install' if [ `use python` ]; then cd ${S}/Wrapping/Python docinto vtk_python distutils_src_install distutils_python_version LD_PATHS="${LD_PATHS}:/usr/lib/python${PY_VER}/site-packages/vtk_python" # fix broken symlinks cd ${D}/usr/lib/python${PY_VER}/site-packages/vtk_python ln -s ../../../libvtk*Python*.so . fi if [ `use doc` ]; then dohtml -r ${WORKDIR}/html docinto examples dodoc ${S}/Examples fi # env.d stuff insinto /etc/env.d/ echo "LDPATH=${LD_PATHS}" > 40vtk doins 40vtk } pkg_postinst() { if [ `use patented` ]; then ewarn "Using patented classes in commercial application requires a licence." ewarn "For more information read" ewarn "http://public.kitware.com/cgi-bin/vtkfaq?req=show&file=faq07.005.htp" fi }