# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils fixheadtails multilib toolchain-funcs MY_PN=OpenSceneGraph OSG_V=1.2 DESCRIPTION="Cross-platform, high performance 3D graphics toolkit" HOMEPAGE="http://www.openscenegraph.org/" SRC_URI="http://www.openscenegraph.org/downloads/snapshots/OSG_OP_OT-${OSG_V}.zip examples? ( http://www.openscenegraph.org/downloads/data/${MY_PN}-Data-1.1.zip )" SLOT="0" LICENSE="OSGPL" KEYWORDS="x86" IUSE="coin doc examples gdal gif glut introspection inventor jasper jpeg png tiff truetype xine" RDEPEND="virtual/opengl >=dev-libs/openproducer-1.1.0 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 ) " S=${WORKDIR}/OSG_OP_OT-${OSG_V}/${MY_PN} src_unpack() { unpack ${A} cd "${S}" epatch "${FILESDIR}"/${P}-build.patch } 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 # Not worth making optional echo "PRODUCER_INSTALLED ?= yes" >> "${T}"/myconf cat "${T}"/myconf export OSG_DEPENDENCIES="${T}"/myconf emake CXX=$(tc-getCXX) || 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" 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} }