# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils MY_P=OpenSceneGraph-${PV}-1 DESCRIPTION="Cross-platform, high performance 3D graphics toolkit" HOMEPAGE="http://www.openscenegraph.org/" SRC_URI="http://openscenegraph.org/downloads/developer/${MY_P}.tar.gz" LICENSE="OSGPL" SLOT="0" KEYWORDS="~x86" IUSE="coin doc examples gdal gif glut introspection inventor jasper jpeg png producer tiff truetype xine" DEPEND="virtual/opengl >=dev-libs/openthreads-1.4.2 coin? ( media-libs/coin ) doc? ( app-doc/doxygen ) 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 ) producer? ( >=media-libs/openproducer-1.0.1 ) tiff? ( media-libs/tiff ) truetype? ( media-libs/freetype ) xine? ( media-libs/xine-lib )" S="${WORKDIR}/${MY_P}" pkg_setup() { if use examples && ! use producer ; then echo eerror "You have selected to install the examples but" eerror "Open Producer support is required to so." echo eerror "To continue, either remove \"examples\"" eerror "from your USE flags or add \"producer\"" echo die fi } src_unpack() { unpack ${A} cd "${S}" sed -i "s:OPTF.*=.*:OPTF=\"${CXXFLAGS}\":" \ Make/makedefs \ || die "sed CXXFLAGS failed" if use gif ; then sed -i 's/-lungif/-lgif/' \ Make/makedefs \ || die "sed lgif failed" fi if use doc ; then # Fix OUTPUT_DIRECTORY sed -i 's:\$(OSGHOME)/::' \ doc/Doxyfiles/all_Doxyfile \ || die "sed doxyfile failed" fi } src_compile() { # This package has no configure script. # Compilation options in the form of # OPTION ?= yes/no # are read from a given file, specified # in ${OSG_DEPENDENCIES} function myconf { # Write config options to dependencies file einfo "${confopt} = ${2}" echo "${1} ?= ${2}" >> "${T}/my_dependencies" } for useopt in ${IUSE} ; do # Match USE flags to conf options... case ${useopt} in coin) local confopt=COIN_INSTALLED ;; doc) # doc isn't used here continue ;; examples) local confopt=COMPILE_EXAMPLES ;; gdal) local confopt=GDAL_INSTALLED ;; gif) local confopt=LIBUNGIF_INSTALLED ;; glut) local confopt=GLUT_INSTALLED ;; introspection) local confopt=COMPILE_INTROSPECTION ;; inventor) local confopt=INVENTOR_INSTALLED ;; jasper) local confopt=JASPER_INSTALLED ;; jpeg) local confopt=LIBJPEG_INSTALLED ;; png) local confopt=LIBPNG_INSTALLED ;; producer) local confopt=PRODUCER_INSTALLED ;; tiff) local confopt=LIBTIFF_INSTALLED ;; truetype) local confopt=FREETYPE_INSTALLED ;; xine) local confopt=XINE_INSTALLED ;; esac use ${useopt} && \ myconf ${confopt} yes \ || myconf ${confopt} no done # SGI OpenGL Performer. No ebuild available to test. local confopt=PERFORMER_INSTALLED myconf ${confopt} no # Quicktime support is for Mac OS X Only. local confopt=QUICKTIME_INSTALLED myconf ${confopt} no export OSG_DEPENDENCIES="${T}/my_dependencies" emake || die "emake failed" use doc && doxygen doc/Doxyfiles/all_Doxyfile } src_install() { make "INST_LOCATION=${D}/usr/" install \ "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 "${ROOT}/usr/$(get_libdir)/pkgconfig" doins "${S}/Make/${PN}.pc" if use examples ; then cd "${S}/examples" for example in $(ls) ; do rm -rf ${example}/Linux32.Opt/ done insinto "${ROOT}/usr/share/doc/${P}" doins -r "${S}/examples/" fi rm -rf "${D}/usr/share/OpenSceneGraph/" }