www-client/firefox: improve and unify apulse support
authorIan Stakenvicius <axs@gentoo.org>
Sat, 29 Apr 2017 16:45:58 +0000 (12:45 -0400)
committerIan Stakenvicius <axs@gentoo.org>
Sat, 29 Apr 2017 16:48:06 +0000 (12:48 -0400)
Create relative symlinks to a defined set of apulse libs instead of
iterating over what libraries are installed on disk and using absolute
symlinks.  Also sync the code between 52.1 and 53.0 ebuilds

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

Package-Manager: Portage-2.3.3, Repoman-2.3.1

www-client/firefox/firefox-52.1.0-r1.ebuild [moved from www-client/firefox/firefox-52.1.0.ebuild with 96% similarity]
www-client/firefox/firefox-53.0.ebuild

similarity index 96%
rename from www-client/firefox/firefox-52.1.0.ebuild
rename to www-client/firefox/firefox-52.1.0-r1.ebuild
index e862929976226da2d3b7a370d22dde29f4139fee..91b2a431871e1e49606c36236dcab4d2863957d5 100644 (file)
@@ -366,15 +366,15 @@ pkg_preinst() {
 
        # if the apulse libs are available in MOZILLA_FIVE_HOME then apulse
        # doesn't need to be forced into the LD_LIBRARY_PATH
-       if use pulseaudio && [ -d "${EROOT}"usr/$(get_libdir)/apulse ] ; then
+       if use pulseaudio && has_version ">=media-sound/apulse-0.1.9" ; then
                einfo "APULSE found - Generating library symlinks for sound support"
                local lib
                pushd "${ED}"${MOZILLA_FIVE_HOME} &>/dev/null || die
-               for lib in "${EROOT}"usr/$(get_libdir)/apulse/libpulse* ; do
+               for lib in ../apulse/libpulse{.so{,.0},-simple.so{,.0}} ; do
                        # a quickpkg rolled by hand will grab symlinks as part of the package,
                        # so we need to avoid creating them if they already exist.
                        if ! [ -L ${lib##*/} ]; then
-                               ln -s "${lib}" || die
+                               ln -s "${lib}" ${lib##*/} || die
                        fi
                done
                popd &>/dev/null || die
@@ -392,6 +392,12 @@ pkg_postinst() {
                local plugin
                for plugin in "${GMP_PLUGIN_LIST[@]}"; do elog "\t ${plugin}" ; done
        fi
+
+       if use pulseaudio && has_version ">=media-sound/apulse-0.1.9" ; then
+               elog "Apulse was detected at merge time on this system and so it will always be"
+               elog "used for sound.  If you wish to use pulseaudio instead please unmerge"
+               elog "media-sound/apulse."
+       fi
 }
 
 pkg_postrm() {
index 16e714db9070ea30b180b37a90b405fedae3e739..a911896f0de70f635416c38278f4b2bde5ec5f6d 100644 (file)
@@ -371,15 +371,15 @@ pkg_preinst() {
 
        # if the apulse libs are available in MOZILLA_FIVE_HOME then apulse
        # doesn't need to be forced into the LD_LIBRARY_PATH
-       if use pulseaudio && [ -d "${EPREFIX}"/usr/$(get_libdir)/apulse ] ; then
+       if use pulseaudio && has_version ">=media-sound/apulse-0.1.9" ; then
                einfo "APULSE found - Generating library symlinks for sound support"
                local lib
                pushd "${ED}"${MOZILLA_FIVE_HOME} &>/dev/null || die
-               for lib in "${EPREFIX}"/usr/$(get_libdir)/apulse/libpulse* ; do
+               for lib in ../apulse/libpulse{.so{,.0},-simple.so{,.0}} ; do
                        # a quickpkg rolled by hand will grab symlinks as part of the package,
                        # so we need to avoid creating them if they already exist.
                        if ! [ -L ${lib##*/} ]; then
-                               ln -s "${lib}" || die
+                               ln -s "${lib}" ${lib##*/} || die
                        fi
                done
                popd &>/dev/null || die
@@ -398,7 +398,7 @@ pkg_postinst() {
                for plugin in "${GMP_PLUGIN_LIST[@]}"; do elog "\t ${plugin}" ; done
        fi
 
-       if use pulseaudio && [ -d "${EPREFIX}"/usr/$(get_libdir)/apulse ]; then
+       if use pulseaudio && has_version ">=media-sound/apulse-0.1.9"; then
                elog "Apulse was detected at merge time on this system and so it will always be"
                elog "used for sound.  If you wish to use pulseaudio instead please unmerge"
                elog "media-sound/apulse."