www-client/firefox-bin: add apulse compatibility to wrapper and some use-flags
authorIan Stakenvicius <axs@gentoo.org>
Wed, 12 Apr 2017 21:09:22 +0000 (17:09 -0400)
committerIan Stakenvicius <axs@gentoo.org>
Fri, 14 Apr 2017 02:19:04 +0000 (22:19 -0400)
Added ffmpeg and pulseaudio to IUSE, default-enabled, to be (A) compatible with
www-client/firefox and (B) ensure dependencies for this functionality is brought
in and retained without @world entries required.  It's a binary package so the
hit is minimal to be dealing with optional runtime-only deps with use flags.

Also added apulse to the LD_LIBRARY_PATH so that it will be used to provide
audio support when it is installed.

Bug: http://bugs.gentoo.org/615000

Package-Manager: Portage-2.3.3, Repoman-2.3.1

www-client/firefox-bin/firefox-bin-52.0.1-r1.ebuild [moved from www-client/firefox-bin/firefox-bin-52.0.1.ebuild with 91% similarity]

similarity index 91%
rename from www-client/firefox-bin/firefox-bin-52.0.1.ebuild
rename to www-client/firefox-bin/firefox-bin-52.0.1-r1.ebuild
index 5a15b94ea048e7e5dfbcfabdc8831a9e3a7c004c..138b3285c87c1faf09a314c34875f00858ca9570 100644 (file)
@@ -31,14 +31,13 @@ RESTRICT="strip mirror"
 KEYWORDS="-* ~amd64 ~x86"
 SLOT="0"
 LICENSE="MPL-2.0 GPL-2 LGPL-2.1"
-IUSE="selinux startup-notification"
+IUSE="+ffmpeg +pulseaudio selinux startup-notification"
 
 DEPEND="app-arch/unzip"
 RDEPEND="dev-libs/atk
        >=sys-apps/dbus-0.60
        >=dev-libs/dbus-glib-0.72
        >=dev-libs/glib-2.26:2
-       >=media-libs/alsa-lib-1.0.16
        media-libs/fontconfig
        >=media-libs/freetype-2.4.10
        >=x11-libs/cairo-1.10[X]
@@ -54,6 +53,9 @@ RDEPEND="dev-libs/atk
        x11-libs/libXt
        >=x11-libs/pango-1.22.0
        virtual/freedesktop-icon-theme
+       pulseaudio? ( || ( media-sound/pulseaudio
+               >=media-sound/apulse-0.1.9 ) )
+       ffmpeg? ( media-video/ffmpeg )
        selinux? ( sec-policy/selinux-mozilla )
 "
 
@@ -132,8 +134,8 @@ src_install() {
        cat <<-EOF >"${ED}"usr/bin/${PN}
        #!/bin/sh
        unset LD_PRELOAD
-       LD_LIBRARY_PATH="/opt/firefox/"
-       GTK_PATH=/usr/lib/gtk-2.0/
+       LD_LIBRARY_PATH="/usr/$(get_libdir)/apulse:/opt/firefox/" \\
+       GTK_PATH=/usr/lib/gtk-3.0/ \\
        exec /opt/${MOZ_PN}/${MOZ_PN} "\$@"
        EOF
        fperms 0755 /usr/bin/${PN}
@@ -162,15 +164,8 @@ pkg_postinst() {
                einfo "gnome-base/orbit and net-misc/curl emerged."
                einfo
        fi
-       einfo "For HTML5 video you need media-video/ffmpeg installed."
-
-       # Drop requirement of curl not built with nss as it's not necessary anymore
-       #if has_version 'net-misc/curl[nss]'; then
-       #       einfo
-       #       einfo "Crashreporter won't be able to send reports"
-       #       einfo "if you have curl emerged with the nss USE-flag"
-       #       einfo
-       #fi
+       use ffmpeg || ewarn "USE=-ffmpeg : HTML5 video will not render without media-video/ffmpeg installed"
+       use pulseaudio || ewarn "USE=-pulseaudio : audio will not play without apulse or pulseaudio installed"
 
        # Update mimedb for the new .desktop file
        fdo-mime_desktop_database_update