commit:     7eaaabf232470e21d2206ba7a74c832c2278d55f
Author:     Ian Stakenvicius <axs <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 23 14:48:47 2016 +0000
Commit:     Ian Stakenvicius <axs <AT> gentoo <DOT> org>
CommitDate: Sat Apr 23 14:48:53 2016 +0000
URL:        https://gitweb.gentoo.org/proj/mozilla.git/commit/?id=7eaaabf2

force the graphite pref when system-harfbuzz is enabled

As system-harfbuzz is a mozconfig-based pref, a helper function has been added
to the mozconfig eclass that will add common entries into the specified prefs
file based on values from use flags or settings controlled by mozconfig.

 eclass/mozconfig-v6.46.eclass                 | 41 +++++++++++++++++++++++++++
 www-client/firefox/firefox-46.0_beta11.ebuild |  9 ++----
 2 files changed, 44 insertions(+), 6 deletions(-)

diff --git a/eclass/mozconfig-v6.46.eclass b/eclass/mozconfig-v6.46.eclass
index 7cb2322..62cc189 100644
--- a/eclass/mozconfig-v6.46.eclass
+++ b/eclass/mozconfig-v6.46.eclass
@@ -361,3 +361,44 @@ mozconfig_config() {
                fi
        fi
 }
+
+# @FUNCTION: mozconfig_install_prefs
+# @DESCRIPTION:
+# Set preferences into the prefs.js file specified as a parameter to
+# the function.  This sets both some common prefs to all mozilla
+# packages, and any prefs that may relate to the use flags administered
+# by mozconfig_config().
+#
+# Call this within src_install() phase, after copying the template
+# prefs file (if any) from ${FILESDIR}
+#
+# Example:
+#
+# inherit mozconfig-v6.46
+#
+# src_install() {
+#      cp "${FILESDIR}"/gentoo-default-prefs.js \
+#      "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js"  
\
+#      || die
+#
+#      mozconfig_install_prefs \
+#      "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js"
+#
+#      ...
+# }
+
+mozconfig_install_prefs() {
+       local prefs_file="${1}"
+
+       einfo "Adding prefs from mozconfig to ${prefs_file}"
+
+       # set dictionary path, to use system hunspell
+       echo "pref(\"spellchecker.dictionary_path\", 
\"${EPREFIX}/usr/share/myspell\");" \
+               >>"${prefs_file}" || die
+
+       # force the graphite pref if system-harfbuzz is enabled, since the pref 
cant disable it
+       if use system-harfbuzz ; then
+               echo 
"sticky_pref(\"gfx.font_rendering.graphite.enabled\",true);" \
+                       >>"${prefs_file}" || die
+       fi
+}

diff --git a/www-client/firefox/firefox-46.0_beta11.ebuild 
b/www-client/firefox/firefox-46.0_beta11.ebuild
index 7e8f883..3cccb6c 100644
--- a/www-client/firefox/firefox-46.0_beta11.ebuild
+++ b/www-client/firefox/firefox-46.0_beta11.ebuild
@@ -256,7 +256,6 @@ src_compile() {
 
 src_install() {
        MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
-       DICTPATH="\"${EPREFIX}/usr/share/myspell\""
 
        cd "${BUILD_OBJ_DIR}" || die
 
@@ -265,6 +264,9 @@ src_install() {
                
"${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
                || die
 
+       mozconfig_install_prefs \
+               
"${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js"
+
        # Augment this with hwaccel prefs
        if use hwaccel ; then
                cat "${FILESDIR}"/gentoo-hwaccel-prefs.js-1 >> \
@@ -272,11 +274,6 @@ src_install() {
                || die
        fi
 
-       # Set default path to search for dictionaries.
-       echo "pref(\"spellchecker.dictionary_path\", ${DICTPATH});" \
-               >> 
"${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
-               || die
-
        echo "pref(\"extensions.autoDisableScopes\", 3);" >> \
                
"${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
                || die

Reply via email to