commit:     94f34294e652cc99f47692a8c07a940005d82629
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 13 14:43:54 2020 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Thu Feb 13 14:49:51 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=94f34294

www-client/firefox-bin: add alsa support

Thanks-to: Vitaly Zdanevich <zdanevich.vitaly <AT> ya.ru>
Closes: https://github.com/gentoo/gentoo/pull/14278
Package-Manager: Portage-2.3.88, Repoman-2.3.20
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 www-client/firefox-bin/firefox-bin-68.5.0.ebuild | 25 ++++++++++++++++++++----
 www-client/firefox-bin/firefox-bin-73.0.ebuild   | 25 ++++++++++++++++++++----
 2 files changed, 42 insertions(+), 8 deletions(-)

diff --git a/www-client/firefox-bin/firefox-bin-68.5.0.ebuild 
b/www-client/firefox-bin/firefox-bin-68.5.0.ebuild
index a4bbc525473..030cfc8b6b1 100644
--- a/www-client/firefox-bin/firefox-bin-68.5.0.ebuild
+++ b/www-client/firefox-bin/firefox-bin-68.5.0.ebuild
@@ -35,9 +35,14 @@ RESTRICT="strip mirror"
 KEYWORDS="-* amd64 x86"
 SLOT="0"
 LICENSE="MPL-2.0 GPL-2 LGPL-2.1"
-IUSE="+ffmpeg +pulseaudio selinux startup-notification"
-
-DEPEND="app-arch/unzip"
+IUSE="alsa +ffmpeg +pulseaudio selinux startup-notification"
+REQUIRED_USE="alsa? ( !pulseaudio )"
+
+DEPEND="app-arch/unzip
+       alsa? (
+               dev-util/patchelf
+               media-sound/apulse
+       )"
 RDEPEND="dev-libs/atk
        >=sys-apps/dbus-0.60
        >=dev-libs/dbus-glib-0.72
@@ -129,6 +134,11 @@ src_install() {
                MOZ_INSTALL_L10N_XPIFILE="1" \
                mozlinguas_src_install
 
+       if use alsa ; then
+               local apulselib="/usr/$(get_libdir)/apulse"
+               patchelf --set-rpath "${apulselib}" 
"${ED}"${MOZILLA_FIVE_HOME}/libxul.so || die
+       fi
+
        # Create /usr/bin/firefox-bin
        dodir /usr/bin/
        local apulselib=$(usex pulseaudio "/usr/$(get_libdir)/apulse:" "")
@@ -162,7 +172,14 @@ pkg_postinst() {
                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 
pulseaudio installed"
+
+       local HAS_AUDIO=0
+       use pulseaudio && HAS_AUDIO=1
+       use alsa && HAS_AUDIO=1
+
+       if [[ ${HAS_AUDIO} -eq 0 ]] ; then
+               ewarn "USE=-pulseaudio & USE=-alsa : For audio please either 
set USE=pulseaudio or USE=alsa!"
+       fi
 
        # Update mimedb for the new .desktop file
        xdg_desktop_database_update

diff --git a/www-client/firefox-bin/firefox-bin-73.0.ebuild 
b/www-client/firefox-bin/firefox-bin-73.0.ebuild
index 1f61fc71c8b..b83288b7f7e 100644
--- a/www-client/firefox-bin/firefox-bin-73.0.ebuild
+++ b/www-client/firefox-bin/firefox-bin-73.0.ebuild
@@ -35,9 +35,14 @@ RESTRICT="strip mirror"
 KEYWORDS="-* amd64 x86"
 SLOT="0"
 LICENSE="MPL-2.0 GPL-2 LGPL-2.1"
-IUSE="+ffmpeg +pulseaudio selinux startup-notification"
-
-DEPEND="app-arch/unzip"
+IUSE="alsa +ffmpeg +pulseaudio selinux startup-notification"
+REQUIRED_USE="alsa? ( !pulseaudio )"
+
+DEPEND="app-arch/unzip
+       alsa? (
+               dev-util/patchelf
+               media-sound/apulse
+       )"
 RDEPEND="dev-libs/atk
        >=sys-apps/dbus-0.60
        >=dev-libs/dbus-glib-0.72
@@ -129,6 +134,11 @@ src_install() {
                MOZ_INSTALL_L10N_XPIFILE="1" \
                mozlinguas_src_install
 
+       if use alsa ; then
+               local apulselib="/usr/$(get_libdir)/apulse"
+               patchelf --set-rpath "${apulselib}" 
"${ED}"${MOZILLA_FIVE_HOME}/libxul.so || die
+       fi
+
        # Create /usr/bin/firefox-bin
        dodir /usr/bin/
        local apulselib=$(usex pulseaudio "/usr/$(get_libdir)/apulse:" "")
@@ -167,7 +177,14 @@ pkg_postinst() {
        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 
pulseaudio installed"
+
+       local HAS_AUDIO=0
+       use pulseaudio && HAS_AUDIO=1
+       use alsa && HAS_AUDIO=1
+
+       if [[ ${HAS_AUDIO} -eq 0 ]] ; then
+               ewarn "USE=-pulseaudio & USE=-alsa : For audio please either 
set USE=pulseaudio or USE=alsa!"
+       fi
 
        local show_doh_information
 

Reply via email to