# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit autotools bzr eutils kde-functions multilib nsplugins qt3 set-kdedir 3.5 EAPI="1" DESCRIPTION="Gnash is a GNU Flash movie player that supports many SWF v7 features" HOMEPAGE="http://www.gnu.org/software/gnash/" EBZR_BRANCH="trunk" EBZR_REPO_URI="http://bzr.savannah.gnu.org/r/gnash/" S="${WORKDIR}/${P}" LICENSE="GPL-3" SLOT="0" KEYWORDS="" IUSE="agg cairo cygnal doc fb ffmpeg gnome gstreamer gtk kde neon nsplugin opengl parallel sdl video_cards_i810 speex X" RDEPEND=" >dev-libs/boost-1.34 dev-libs/libxml2 media-libs/jpeg media-libs/libpng speex? ( media-libs/speex ) net-misc/curl sys-libs/zlib x11-libs/libX11 x11-libs/libXi x11-libs/libXmu x11-libs/libXt x11-proto/xproto agg? ( x11-libs/agg ) cairo? ( x11-libs/cairo ) doc? ( >=app-text/docbook2X-0.8.8 app-text/docbook-sgml-utils ) opengl? ( virtual/opengl gtk? ( x11-libs/gtkglext ) ) ffmpeg? ( !gstreamer? ( media-libs/libsdl >media-video/ffmpeg-0.4.9_p20080206 ) ) gstreamer? ( media-plugins/gst-plugins-ffmpeg media-plugins/gst-plugins-mad media-plugins/gst-plugins-meta gnome? ( media-plugins/gst-plugins-gnomevfs ) neon? ( >=media-plugins/gst-plugins-neon-0.10.7 ) ) gtk? ( dev-libs/atk dev-libs/glib >x11-libs/gtk+-2 x11-libs/pango ) kde? ( kde-base/kdelibs:3.5 ) sdl? ( media-libs/libsdl )" DEPEND="${RDEPEND} dev-util/pkgconfig" pkg_setup() { if ! ( use agg || use cairo || use opengl ); then eerror "You are trying to build Gnash without choosing a renderer." eerror "Please enable one of the following USE flags [agg,cairo,opengl]." die "No renderer selected !" fi if use cairo && use !agg && use !opengl && ( use kde || use fb ); then eerror "The cairo renderer and kde or fb gui's or not compatible." die "Cairo renderer incompatible with kde or fb gui !" fi if use !kde && use !gtk && !sdl && use !fb; then eerror "You are trying to build Gnash without choosing a gui frontend." eerror "Please enable at least one of the following USE flags [gtk,kde,sdl,fb]." die "No gui frontend selected !" fi if use nsplugin && use !gtk; then eerror "Building gnash with nsplugin requires the gtk gui." die "Nsplugin requires the gtk gui." fi } src_unpack() { bzr_src_unpack cd "${S}" epatch ${FILESDIR}/${P}-boost-dynamic-link.patch ./autogen.sh } src_compile() { local myconf local gui local jobs # Set nsplugin install directory. use nsplugin && myconf="${myconf} --with-npapi-plugindir=/opt/netscape/plugins" # Set kde and konqueror plugin directories. use kde && myconf="${myconf} --with-kde-pluginprefix=/usr --with-kde-plugindir=/usr/lib/kde3 \ --with-kde-appsdatadir=/usr/share/apps/klash --with-kde-servicesdir=/usr/share/services" # Set rendering engine. if use agg; then myconf="${myconf} --enable-renderer=agg" elif use opengl; then myconf="${myconf} --enable-renderer=ogl" else myconf="${myconf} --enable-renderer=cairo" fi # Set media handler. if use gstreamer; then myconf="${myconf} --enable-media=gst" elif use ffmpeg; then myconf="${myconf} --enable-media=ffmpeg" else myconf="${myconf} --enable-media=none" fi # Set gui. use gtk && gui=",gtk" use kde && gui="${gui},kde" use sdl && gui="${gui},sdl" use fb && gui="${gui},fb" # Strip extra comma from gui. gui=$( echo $gui|sed -e 's/,//' ) econf \ $(use_enable cygnal cygnal) \ $(use_enable doc docbook) \ $(use_enable gnome ghelp) \ $(use_enable nsplugin npapi) \ $(use_enable kde kparts) \ $(use_enable video_cards_i810 i810-lod-bias) \ $(use_enable speex speex) \ $(use_enable X mit-shm) \ --with-ffmpeg-incl=/usr/include \ --enable-gui=${gui} \ ${myconf} || die "econf failed" # Should the ebuild use parallel compiling ? if use parallel; then jobs=${MAKEOPTS} else jobs="-j1" fi emake ${jobs} || die "emake failed" } src_install() { emake ${jobs} DESTDIR="${D}" install || die "emake install failed" # Install nsplugin in directory set by --with-npapi-plugindir. use nsplugin && emake DESTDIR="${D}" install-plugin # Install kde konqueror plugin. if use kde; then cd "${S}/plugin/klash" emake DESTDIR="${D}" install-plugin fi # Create a symlink in /usr/$(get_libdir)/nsbrowser/plugins to the nsplugin install directory. use nsplugin && inst_plugin /opt/netscape/plugins/libgnashplugin.so \ || rm -rf "${D}/opt" dodoc AUTHORS ChangeLog NEWS README } pkg_postinst() { if use !ffmpeg && use !gstreamer || use gstreamer && ( use !gnome && use !neon ); then ewarn "" ewarn "Gnash was built without a media handler and or http handler !" ewarn "" ewarn "If you want Gnash to support video then you will need to" ewarn "rebuild Gnash with either the ffmpeg or gstreamer use flags set." ewarn "If you use gstreamer you will also need to set one of" ewarn "the two http handler use flags: gnome or neon." ewarn "" fi ewarn "DO NOT report bugs to Gentoo's bugzilla" ewarn "" ewarn "BETA" ewarn "gnash is still in heavy development" ewarn "please report gnash bugs upstream to the gnash devs" ewarn "" ewarn "If you think it is an ebuild bug please report it at http://bugzilla.biterror.net" }