# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit debug eutils toolchain-funcs MY_PN=OpenSceneGraph MY_P=${MY_PN}-${PV} DESCRIPTION="Cross-platform, high performance 3D graphics toolkit" HOMEPAGE="http://www.openscenegraph.org/" SRC_URI="http://www.openscenegraph.com/svn/osg/OpenSceneGraph/developer_releases/${MY_P}/${MY_P}.tar.gz examples? ( http://www.openscenegraph.org/downloads/data/${MY_PN}-Data-1.1.zip )" LICENSE="OSGPL free-noncomm" SLOT="0" KEYWORDS="~x86 amd64" IUSE="coin debug doc examples gdal gif glut introspection inventor jasper jpeg png tiff truetype xine" RDEPEND="virtual/opengl coin? ( media-libs/coin ) gdal? ( sci-libs/gdal ) gif? ( media-libs/giflib ) glut? ( virtual/glut ) inventor? ( media-libs/openinventor ) jasper? ( media-libs/jasper ) jpeg? ( media-libs/jpeg ) png? ( media-libs/libpng sys-libs/zlib ) tiff? ( media-libs/tiff ) truetype? ( media-libs/freetype ) xine? ( media-libs/xine-lib )" DEPEND="${REDEPEND} doc? ( app-doc/doxygen ) examples? ( app-arch/unzip ) >=dev-util/cmake-2.4.5" S="${WORKDIR}/OpenSceneGraph" src_unpack() { unpack ${A} cd "${S}" # sed -i "s:OPTF *= .*:OPTF = \"${CXXFLAGS}\":" Make/makedefs \ # || die "sed (CXXFLAGS) failed" # sed -i 's/-lungif/-lgif/' Make/makedefs \ # || die "sed (lgif) failed" } src_compile() { # Compilation options in the form of # OPTION ?= yes/no # are read from the file # ${OSG_DEPENDENCIES} function myconf { echo "${1} ?= $(use ${flag} && echo yes || echo no)" >> "${T}/myconf" } for flag in ${IUSE} ; do case ${flag} in coin) myconf COIN_INSTALLED ;; examples) myconf COMPILE_EXAMPLES ;; gdal) myconf GDAL_INSTALLED ;; gif) myconf LIBUNGIF_INSTALLED ;; glut) myconf GLUT_INSTALLED ;; introspection) myconf COMPILE_INTROSPECTION ;; inventor) myconf INVENTOR_INSTALLED ;; jasper) myconf JASPER_INSTALLED ;; jpeg) myconf LIBJPEG_INSTALLED ;; png) myconf LIBPNG_INSTALLED ;; tiff) myconf LIBTIFF_INSTALLED ;; truetype) myconf FREETYPE_INSTALLED ;; xine) myconf XINE_INSTALLED ;; esac done # SGI OpenGL Performer echo "PERFORMER_INSTALLED ?= no" >> "${T}"/myconf # Mac OS X Only echo "QUICKTIME_INSTALLED ?= no" >> "${T}"/myconf cat "${T}"/myconf export OSG_DEPENDENCIES="${T}"/myconf cmake -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_C_COMPILER=$(type -p $(tc-getCC)) \ -DCMAKE_CXX_COMPILER=$(type -p $(tc-getCXX)) || die "cmake failed" emake $(use debug && echo debug) || die "emake failed" if use doc ; then export OSGHOME="${S}" doxygen doc/Doxyfiles/all_Doxyfile fi } src_install() { # make install \ # INST_LOCATION="${D}"/usr \ # INST_EXAMPLES="${D}"/usr/bin \ # || die "make install failed" make DESTDIR=${D} install || die "make install failed" if use doc ; then dodoc doc/ProgrammingGuide/ProgrammingGuide.odt dohtml -r doc/doxygen/html fi dodoc AUTHORS.txt ChangeLog NEWS.txt README.txt insinto /usr/$(get_libdir)/pkgconfig doins Make/${PN}.pc if use examples ; then cp -r "${WORKDIR}"/${MY_PN}-Data \ "${D}"/usr/share/${PN} echo OSG_FILE_PATH=/usr/share/${PN} \ > "${T}"/99${PN} doenvd "${T}"/99${PN} || die "doenvd failed" fi rm -rf "${D}"/usr/share/${MY_PN} }