# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ WANT_AUTOMAKE="latest" WANT_AUTOCONF="latest" MY_PN="moon" MY_PV="${PV/_beta/b/}" MY_P="${MY_PN}-${MY_PV}" inherit autotools eutils flag-o-matic multilib nsplugins DESCRIPTION="Moonlight is an open source implementation of Microsoft Silverlight for Unix systems" HOMEPAGE="http://www.go-mono.com/moonlight/" SRC_URI="ftp://ftp.novell.com/pub/mono/sources/${MY_PN}/${MY_P}.tar.bz2" LICENSE="LGPL-2.1" SLOT="0" KEYWORDS="~x86 ~amd64" IUSE="ffmpeg mono nsplugin debug test" DEPEND="ffmpeg? ( media-video/ffmpeg ) mono? ( >=dev-lang/mono-2.0.1 ) debug? ( dev-util/mono-debugger ) test? ( dev-util/monodevelop ) || ( >=www-client/mozilla-firefox-bin-2.0.0.14 >=www-client/mozilla-firefox-2.0.0.14 ) media-sound/alsa-headers media-sound/alsa-tools net-libs/libgssglue app-text/opensp net-libs/xulrunner dev-util/mono-tools dev-dotnet/mono-zeroconf dev-dotnet/mono-addins media-libs/libpixman x11-libs/pixman x11-libs/xcb-util x11-libs/libXdmcp >=x11-libs/cairo-1.8" RDEPEND="${DEPEND}" S="${WORKDIR}/${MY_P}" src_unpack() { unpack ${A} cd "${S}" einfo "Building new configuration files...please wait..." eautoreconf elibtoolize } src_test() { cd "${S}"/plugin make test-plugin || die "plugin tests failed" make untest-plugin || ewarn "plugin tests not removed" } src_compile() { local myconf # GCC gets angry at mfpath filter-mfpmath sse if has_version '>=www-client/mozilla-firefox-3.0' ; then myconf="${myconf} --with-ff3=yes --enable-optimize=-O1 --with-ff2=no" else myconf="${myconf} --with-ff2=yes --with-ff3=no" fi econf \ --enable-user-plugin \ $(use_with mono) \ $(use_with ffmpeg) \ $(use_with debug) \ --target=${CHOST} \ --with-PACKAGE=yes \ --with-cairo=system \ --with-pixman=system \ --with-expat-dir=/usr/include \ --enable-shared=yes \ XULRUNNER_LIBS=/usr/$(get_libdir)/xulrunner/ \ ${myconf} || die "econf failed" emake LDFLAGS="$(raw-ldflags)" || die "make failed" # not LDFLAG friendly } src_install(){ emake DESTDIR="${D}" install || die install failed if use nsplugin ; then cd "${S}"/plugin/install exeinto /usr/$(get_libdir)/${PLUGINS_DIR} doexe novell-${PN}.xpi || die "plugin install failed" fi cd "${S}" dodoc README AUTHORS NEWS TODO ChangeLog } pkg_postinst(){ einfo einfo "To launch Firefox with shape caching and ffmpeg converters use:" einfo einfo '$> MOONLIGHT_OVERRIDES="shapecache=yes,converter=ffmpeg" firefox' einfo einfo "To install plugin, open mozilla-based brower and run:" einfo einfo "file:///usr/$(get_libdir)/${PLUGINS_DIR}/novell-${PN}.xpi" einfo }