From 94f34294e652cc99f47692a8c07a940005d82629 Mon Sep 17 00:00:00 2001 From: Thomas Deutschmann Date: Thu, 13 Feb 2020 15:43:54 +0100 Subject: [PATCH] www-client/firefox-bin: add alsa support Thanks-to: Vitaly Zdanevich Closes: https://github.com/gentoo/gentoo/pull/14278 Package-Manager: Portage-2.3.88, Repoman-2.3.20 Signed-off-by: Thomas Deutschmann --- .../firefox-bin/firefox-bin-68.5.0.ebuild | 25 ++++++++++++++++--- .../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 a4bbc5254737..030cfc8b6b15 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 1f61fc71c8b4..b83288b7f7e6 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 -- 2.26.2