www-client/firefox: fix PATH for FEATURES=ccache/distcc
authorThomas Deutschmann <whissi@gentoo.org>
Sun, 29 Mar 2020 21:10:29 +0000 (23:10 +0200)
committerThomas Deutschmann <whissi@gentoo.org>
Mon, 30 Mar 2020 11:45:09 +0000 (13:45 +0200)
Bug: https://bugs.gentoo.org/627726
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
www-client/firefox/firefox-68.6.0-r2.ebuild
www-client/firefox/firefox-74.0-r2.ebuild

index eb63ae0f71d5d0b04084caaf445675fe174a90f8..270ebf156407ebebfd878d5eb39833f2ff519268 100644 (file)
@@ -189,6 +189,21 @@ if [[ -z $GMP_PLUGIN_LIST ]] ; then
        GMP_PLUGIN_LIST=( gmp-gmpopenh264 gmp-widevinecdm )
 fi
 
+fix_path() {
+       local value_to_move=${1}
+       local new_path path_value
+       IFS=:; local -a path_values=( ${PATH} )
+       for path_value in "${path_values[@]}" ; do
+               if [[ ${path_value} == *"${value_to_move}"* ]] ; then
+                       new_path="${path_value}${new_path:+:}${new_path}"
+               else
+                       new_path+="${new_path:+:}${path_value}"
+               fi
+       done
+
+       echo "${new_path}"
+}
+
 llvm_check_deps() {
        if ! has_version --host-root "sys-devel/clang:${LLVM_SLOT}" ; then
                ewarn "sys-devel/clang:${LLVM_SLOT} is missing! Cannot use LLVM slot ${LLVM_SLOT} ..." >&2
@@ -262,6 +277,15 @@ pkg_setup() {
        addpredict /proc/self/oom_score_adj
 
        llvm_pkg_setup
+
+       # Workaround for #627726
+       if has ccache ${FEATURES} ; then
+               einfo "Fixing PATH for FEATURES=ccache ..."
+               PATH=$(fix_path 'ccache/bin')
+       elif has distcc ${FEATURES} ; then
+               einfo "Fixing PATH for FEATURES=distcc ..."
+               PATH=$(fix_path 'distcc/bin')
+       fi
 }
 
 src_unpack() {
index b6ff763a5bfc38c1248534c7cc3cd124af82c1e6..bf2680e31471f4a804b1f72884f7b55cdd37dec2 100644 (file)
@@ -199,6 +199,21 @@ if [[ -z $GMP_PLUGIN_LIST ]] ; then
        GMP_PLUGIN_LIST=( gmp-gmpopenh264 gmp-widevinecdm )
 fi
 
+fix_path() {
+       local value_to_move=${1}
+       local new_path path_value
+       IFS=:; local -a path_values=( ${PATH} )
+       for path_value in "${path_values[@]}" ; do
+               if [[ ${path_value} == *"${value_to_move}"* ]] ; then
+                       new_path="${path_value}${new_path:+:}${new_path}"
+               else
+                       new_path+="${new_path:+:}${path_value}"
+               fi
+       done
+
+       echo "${new_path}"
+}
+
 llvm_check_deps() {
        if ! has_version --host-root "sys-devel/clang:${LLVM_SLOT}" ; then
                ewarn "sys-devel/clang:${LLVM_SLOT} is missing! Cannot use LLVM slot ${LLVM_SLOT} ..." >&2
@@ -280,6 +295,15 @@ pkg_setup() {
        addpredict /proc/self/oom_score_adj
 
        llvm_pkg_setup
+
+       # Workaround for #627726
+       if has ccache ${FEATURES} ; then
+               einfo "Fixing PATH for FEATURES=ccache ..."
+               PATH=$(fix_path 'ccache/bin')
+       elif has distcc ${FEATURES} ; then
+               einfo "Fixing PATH for FEATURES=distcc ..."
+               PATH=$(fix_path 'distcc/bin')
+       fi
 }
 
 src_unpack() {