www-client/firefox-bin: ensure apulse will not be loaded if USE=-pulseaudio
authorIan Stakenvicius <axs@gentoo.org>
Wed, 3 May 2017 17:43:28 +0000 (13:43 -0400)
committerIan Stakenvicius <axs@gentoo.org>
Wed, 3 May 2017 17:46:25 +0000 (13:46 -0400)
If a system has apulse < 0.1.9 installed but USE=-pulseaudio set, then
the previous attempt at getting apulse working would still try and load
it, causing firefox-bin to crash.  This commit addresses that by only
attempting to load apulse if USE=pulseaudio is set.

Package-Manager: Portage-2.3.3, Repoman-2.3.1

www-client/firefox-bin/firefox-bin-52.1.0-r2.ebuild [moved from www-client/firefox-bin/firefox-bin-52.1.0-r1.ebuild with 97% similarity]
www-client/firefox-bin/firefox-bin-53.0-r2.ebuild [moved from www-client/firefox-bin/firefox-bin-53.0-r1.ebuild with 95% similarity]

similarity index 97%
rename from www-client/firefox-bin/firefox-bin-52.1.0-r1.ebuild
rename to www-client/firefox-bin/firefox-bin-52.1.0-r2.ebuild
index ed5784e0f7ba00638bbec0e6325990b4e36056a6..63712e923b1c81f9e45322623d1b484572f5086c 100644 (file)
@@ -136,10 +136,11 @@ src_install() {
 
        # Create /usr/bin/firefox-bin
        dodir /usr/bin/
+       local apulselib=$(usex pulseaudio "/usr/$(get_libdir)/apulse:" "")
        cat <<-EOF >"${ED}"usr/bin/${PN}
        #!/bin/sh
        unset LD_PRELOAD
-       LD_LIBRARY_PATH="/usr/$(get_libdir)/apulse:/opt/firefox/" \\
+       LD_LIBRARY_PATH="${apulselib}/opt/firefox/" \\
        GTK_PATH=/usr/lib/gtk-3.0/ \\
        exec /opt/${MOZ_PN}/${MOZ_PN} "\$@"
        EOF
@@ -170,7 +171,7 @@ 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 apulse or pulseaudio installed"
+       use pulseaudio || ewarn "USE=-pulseaudio : audio will not play without pulseaudio installed"
 
        # Update mimedb for the new .desktop file
        fdo-mime_desktop_database_update
similarity index 95%
rename from www-client/firefox-bin/firefox-bin-53.0-r1.ebuild
rename to www-client/firefox-bin/firefox-bin-53.0-r2.ebuild
index 69ec314d827c72c3cfb3b26fdac07e626e986cba..da78aea4869dbd3a7ba9ade8e15d1a3aa13538ab 100644 (file)
@@ -23,7 +23,7 @@ MOZ_P="${MOZ_PN}-${MOZ_PV}"
 
 MOZ_HTTP_URI="http://archive.mozilla.org/pub/mozilla.org/${MOZ_PN}/releases/"
 
-inherit eutils pax-utils fdo-mime gnome2-utils mozlinguas-v2
+inherit eutils pax-utils fdo-mime gnome2-utils mozlinguas-v2 nsplugins
 
 DESCRIPTION="Firefox Web Browser"
 SRC_URI="${SRC_URI}
@@ -135,10 +135,11 @@ src_install() {
 
        # Create /usr/bin/firefox-bin
        dodir /usr/bin/
+       local apulselib=$(usex pulseaudio "/usr/$(get_libdir)/apulse:" "")
        cat <<-EOF >"${ED}"usr/bin/${PN}
        #!/bin/sh
        unset LD_PRELOAD
-       LD_LIBRARY_PATH="/usr/$(get_libdir)/apulse:/opt/firefox/" \\
+       LD_LIBRARY_PATH="${apulselib}/opt/firefox/" \\
        GTK_PATH=/usr/lib/gtk-3.0/ \\
        exec /opt/${MOZ_PN}/${MOZ_PN} "\$@"
        EOF
@@ -149,7 +150,7 @@ src_install() {
        echo "SEARCH_DIRS_MASK=${MOZILLA_FIVE_HOME}" >> ${T}/10${PN}
        doins "${T}"/10${PN} || die
 
-       # Plugins dir
+       # Plugins dir, still used for flash
        share_plugins_dir
 
        # Required in order to use plugins and even run firefox on hardened.
@@ -169,7 +170,7 @@ 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 apulse or pulseaudio installed"
+       use pulseaudio || ewarn "USE=-pulseaudio : audio will not play without pulseaudio installed"
 
        # Update mimedb for the new .desktop file
        fdo-mime_desktop_database_update