diff options
-rw-r--r-- | www/cliqz/Makefile | 9 | ||||
-rw-r--r-- | www/cliqz/files/patch-bug1594027 | 54 | ||||
-rw-r--r-- | www/cliqz/files/patch-bug1607052 | 283 | ||||
-rw-r--r-- | www/cliqz/files/patch-bug1622551 | 30 | ||||
-rw-r--r-- | www/cliqz/files/patch-bug847568 | 289 |
5 files changed, 347 insertions, 318 deletions
diff --git a/www/cliqz/Makefile b/www/cliqz/Makefile index 7d8c2ffbdd95..04cf74d3b7a9 100644 --- a/www/cliqz/Makefile +++ b/www/cliqz/Makefile @@ -2,6 +2,7 @@ PORTNAME= cliqz DISTVERSION= 1.34.0 +PORTREVISION= 1 CATEGORIES= www MASTER_SITES= https://s3.amazonaws.com/cdn.cliqz.com/browser-f/APT/:amazon \ http://repository.cliqz.com/dist/${CLIQZ_CHANNEL}/${DISTVERSION}/${CLIQZ_LAST_BUILD_ID}/:cliqz @@ -20,7 +21,7 @@ LICENSE= MPL20 LICENSE_FILE= ${WRKSRC}/LICENSE DEPRECATED= Uses deprecated version of python -EXPIRATION_DATE= 2020-09-15 +EXPIRATION_DATE= 2020-12-31 FETCH_DEPENDS= ca_root_nss>=0:security/ca_root_nss LIB_DEPENDS= libdbus-1.so:devel/dbus \ @@ -98,9 +99,9 @@ MOZ_CONFIGURE_ARGS+= "--disable-crashreporter" \ "--disable-debug-symbols" \ "--disable-tests" \ "--disable-updater" \ - "--libclang-path=${LOCALBASE}/llvm${LLVM_DEFAULT}/lib" \ - "--with-system-graphite2" \ - "--with-system-harfbuzz" + "--libclang-path=${LOCALBASE}/llvm${LLVM_DEFAULT}/lib" +# "--with-system-graphite2" \ +# "--with-system-harfbuzz" .include "${.CURDIR}/Makefile.options" diff --git a/www/cliqz/files/patch-bug1594027 b/www/cliqz/files/patch-bug1594027 index d1022c9e722c..f966b6a40e81 100644 --- a/www/cliqz/files/patch-bug1594027 +++ b/www/cliqz/files/patch-bug1594027 @@ -1,31 +1,35 @@ -Disable STL wrappers in some places to help libc++ 9 +commit 9949bb054e7a +Author: Greg V <greg@unrelenting.technology> +Date: Mon Feb 24 20:18:01 2020 +0000 + + Bug 1594027 - add more STL wrappers to fix build with libc++ 9 r=froydnj + + Differential Revision: https://phabricator.services.mozilla.com/D62847 + + --HG-- + extra : moz-landing-system : lando +--- + config/gcc-stl-wrapper.template.h | 8 ++++++++ + 1 file changed, 8 insertions(+) Taken from www/firefox -diff --git config/external/rlbox/moz.build config/external/rlbox/moz.build -index d216e62cad861..391bbdf566b88 100644 ---- mozilla-release/config/external/rlbox/moz.build -+++ mozilla-release/config/external/rlbox/moz.build -@@ -26,4 +26,7 @@ SOURCES += [ - 'rlbox_thread_locals.cpp' - ] +diff --git config/gcc-stl-wrapper.template.h config/gcc-stl-wrapper.template.h +index 41ae14024b0c0..9fe70fbaab8dc 100644 +--- mozilla-release/config/gcc-stl-wrapper.template.h ++++ mozilla-release/config/gcc-stl-wrapper.template.h +@@ -32,6 +32,14 @@ + # define moz_dont_include_mozalloc_for_cstdlib + #endif -+# bug 1594027 -+DisableStlWrapping() ++#ifndef moz_dont_include_mozalloc_for_type_traits ++# define moz_dont_include_mozalloc_for_type_traits ++#endif + - FINAL_LIBRARY = 'xul' -\ No newline at end of file -diff --git gfx/graphite2/src/moz.build gfx/graphite2/src/moz.build -index 447cd861126a3..8a4fcd814e6fb 100755 ---- mozilla-release/gfx/graphite2/src/moz.build -+++ mozilla-release/gfx/graphite2/src/moz.build -@@ -69,6 +69,9 @@ if CONFIG['MOZ_WASM_SANDBOXING_GRAPHITE']: - # thebes - DefineAndWasmDefine('GRAPHITE2_STATIC', True) - -+# bug 1594027 -+DisableStlWrapping() ++#ifndef moz_dont_include_mozalloc_for_limits ++# define moz_dont_include_mozalloc_for_limits ++#endif + - # We allow warnings for third-party code that can be updated from upstream. - AllowCompilerWarnings() - + // Include mozalloc after the STL header and all other headers it includes + // have been preprocessed. + #if !defined(MOZ_INCLUDE_MOZALLOC_H) && \ diff --git a/www/cliqz/files/patch-bug1607052 b/www/cliqz/files/patch-bug1607052 new file mode 100644 index 000000000000..3c32807e53ca --- /dev/null +++ b/www/cliqz/files/patch-bug1607052 @@ -0,0 +1,283 @@ +commit 9d26727a4e85 +Author: Zibi Braniecki <zbraniecki@mozilla.com> +Date: Fri Feb 21 00:39:18 2020 +0000 + + Bug 1607052 - Unify language identifier canonicalization in LocaleService and OSPreferences to use unic_langid, and extend GTK's RegionalPrefs reading to fallback on SystemLocales. r=jfkthame + + Differential Revision: https://phabricator.services.mozilla.com/D63393 + + --HG-- + extra : moz-landing-system : lando +--- + intl/locale/LocaleService.cpp | 53 ++------------------------- + intl/locale/LocaleService.h | 18 +++++++++ + intl/locale/OSPreferences.cpp | 18 ++------- + intl/locale/rust/unic-langid-ffi/src/lib.rs | 33 ++++++++++++++--- + intl/locale/tests/gtest/TestLocaleService.cpp | 23 ++++++++++++ + intl/locale/tests/unit/test_localeService.js | 3 +- + 6 files changed, 77 insertions(+), 71 deletions(-) + +Taken from www/firefox. + +diff --git intl/locale/LocaleService.cpp intl/locale/LocaleService.cpp +index f7e13e36ccbc7..6708c4af4b5c3 100644 +--- mozilla-release/intl/locale/LocaleService.cpp ++++ mozilla-release/intl/locale/LocaleService.cpp +@@ -39,51 +39,6 @@ NS_IMPL_ISUPPORTS(LocaleService, mozILocaleService, nsIObserver, + + mozilla::StaticRefPtr<LocaleService> LocaleService::sInstance; + +-/** +- * This function transforms a canonical Mozilla Language Tag, into it's +- * BCP47 compilant form. +- * +- * Example: "ja-JP-mac" -> "ja-JP-macos" +- * +- * The BCP47 form should be used for all calls to ICU/Intl APIs. +- * The canonical form is used for all internal operations. +- */ +-static bool SanitizeForBCP47(nsACString& aLocale, bool strict) { +- // Currently, the only locale code we use that's not BCP47-conformant is +- // "ja-JP-mac" on OS X, and ICU canonicalizes it into a mouthfull +- // "ja-JP-x-lvariant-mac", so instead we're hardcoding a conversion +- // of it to "ja-JP-macos". +- if (aLocale.LowerCaseEqualsASCII("ja-jp-mac")) { +- aLocale.AssignLiteral("ja-JP-macos"); +- return true; +- } +- +- nsAutoCString locale(aLocale); +- locale.Trim(" "); +- +- // POSIX may bring us locales such as "en-US.UTF8", which +- // ICU converts to `en-US-u-va-posix`. Let's cut out +- // the `.UTF8`, since it doesn't matter for us. +- int32_t pos = locale.FindChar('.'); +- if (pos != -1) { +- locale.Cut(pos, locale.Length() - pos); +- } +- +- // The rest of this function will use ICU canonicalization for any other +- // tag that may come this way. +- const int32_t LANG_TAG_CAPACITY = 128; +- char langTag[LANG_TAG_CAPACITY]; +- UErrorCode err = U_ZERO_ERROR; +- // This is a fail-safe method that will set langTag to "und" if it cannot +- // match any part of the input locale code. +- int32_t len = uloc_toLanguageTag(locale.get(), langTag, LANG_TAG_CAPACITY, +- strict, &err); +- if (U_SUCCESS(err) && len > 0) { +- aLocale.Assign(langTag, len); +- } +- return U_SUCCESS(err); +-} +- + /** + * This function splits an input string by `,` delimiter, sanitizes the result + * language tags and returns them to the caller. +@@ -93,7 +48,7 @@ static void SplitLocaleListStringIntoArray(nsACString& str, + if (str.Length() > 0) { + for (const nsACString& part : str.Split(',')) { + nsAutoCString locale(part); +- if (SanitizeForBCP47(locale, true)) { ++ if (LocaleService::CanonicalizeLanguageId(locale)) { + if (!aRetVal.Contains(locale)) { + aRetVal.AppendElement(locale); + } +@@ -421,7 +376,7 @@ LocaleService::GetDefaultLocale(nsACString& aRetVal) { + locale.Trim(" \t\n\r"); + // This should never be empty. + MOZ_ASSERT(!locale.IsEmpty()); +- if (SanitizeForBCP47(locale, true)) { ++ if (CanonicalizeLanguageId(locale)) { + mDefaultLocale.Assign(locale); + } + +@@ -617,7 +572,7 @@ LocaleService::SetRequestedLocales(const nsTArray<nsCString>& aRequested) { + + for (auto& req : aRequested) { + nsAutoCString locale(req); +- if (!SanitizeForBCP47(locale, true)) { ++ if (!CanonicalizeLanguageId(locale)) { + NS_ERROR("Invalid language tag provided to SetRequestedLocales!"); + return NS_ERROR_INVALID_ARG; + } +@@ -667,7 +622,7 @@ LocaleService::SetAvailableLocales(const nsTArray<nsCString>& aAvailable) { + + for (auto& avail : aAvailable) { + nsAutoCString locale(avail); +- if (!SanitizeForBCP47(locale, true)) { ++ if (!CanonicalizeLanguageId(locale)) { + NS_ERROR("Invalid language tag provided to SetAvailableLocales!"); + return NS_ERROR_INVALID_ARG; + } +diff --git intl/locale/LocaleService.h intl/locale/LocaleService.h +index 2ff428da3e3fd..5f5152c1fbb7a 100644 +--- mozilla-release/intl/locale/LocaleService.h ++++ mozilla-release/intl/locale/LocaleService.h +@@ -10,6 +10,7 @@ + #include "nsString.h" + #include "nsTArray.h" + #include "nsWeakReference.h" ++#include "MozLocaleBindings.h" + + #include "mozILocaleService.h" + +@@ -104,6 +105,23 @@ class LocaleService final : public mozILocaleService, + return RefPtr<LocaleService>(GetInstance()).forget(); + } + ++ /** ++ * Canonicalize a Unicode Language Identifier string. ++ * ++ * The operation is: ++ * * Normalizing casing (`eN-Us-Windows` -> `en-US-windows`) ++ * * Switching `_` to `-` (`en_US` -> `en-US`) ++ * * Rejecting invalid identifiers (`e21-X` sets aLocale to `und` and ++ * returns false) ++ * * Normalizing Mozilla's `ja-JP-mac` to `ja-JP-macos` ++ * * Cutting off POSIX dot postfix (`en-US.utf8` -> `en-US`) ++ * ++ * This operation should be used on any external input before ++ * it gets used in internal operations. ++ */ ++ static bool CanonicalizeLanguageId(nsACString& aLocale) { ++ return ffi::unic_langid_canonicalize(&aLocale); ++ } + /** + * This method should only be called in the client mode. + * +diff --git intl/locale/OSPreferences.cpp intl/locale/OSPreferences.cpp +index 283db96e0d718..f816ca57abfea 100644 +--- mozilla-release/intl/locale/OSPreferences.cpp ++++ mozilla-release/intl/locale/OSPreferences.cpp +@@ -54,19 +54,7 @@ void OSPreferences::Refresh() { + * It returns true if the canonicalization was successful. + */ + bool OSPreferences::CanonicalizeLanguageTag(nsCString& aLoc) { +- char langTag[512]; +- +- UErrorCode status = U_ZERO_ERROR; +- +- int32_t langTagLen = uloc_toLanguageTag(aLoc.get(), langTag, +- sizeof(langTag) - 1, false, &status); +- +- if (U_FAILURE(status)) { +- return false; +- } +- +- aLoc.Assign(langTag, langTagLen); +- return true; ++ return LocaleService::CanonicalizeLanguageId(aLoc); + } + + /** +@@ -291,7 +279,9 @@ OSPreferences::GetRegionalPrefsLocales(nsTArray<nsCString>& aRetVal) { + return NS_OK; + } + +- return NS_ERROR_FAILURE; ++ // If we failed to read regional prefs locales, ++ // use system locales as last fallback. ++ return GetSystemLocales(aRetVal); + } + + static OSPreferences::DateTimeFormatStyle ToDateTimeFormatStyle( +diff --git intl/locale/rust/unic-langid-ffi/src/lib.rs intl/locale/rust/unic-langid-ffi/src/lib.rs +index 701d3679c4cec..517e08c1a64c1 100644 +--- mozilla-release/intl/locale/rust/unic-langid-ffi/src/lib.rs ++++ mozilla-release/intl/locale/rust/unic-langid-ffi/src/lib.rs +@@ -5,18 +5,39 @@ + use nsstring::nsACString; + use nsstring::nsCString; + use thin_vec::ThinVec; +-pub use unic_langid::LanguageIdentifier; ++pub use unic_langid::{LanguageIdentifier, LanguageIdentifierError}; ++ ++fn new_langid_for_mozilla(name: &nsACString) -> Result<LanguageIdentifier, LanguageIdentifierError> { ++ if name.eq_ignore_ascii_case(b"ja-jp-mac") { ++ "ja-JP-macos".parse() ++ } else { ++ // Cut out any `.FOO` like `en-US.POSIX`. ++ let mut name: &[u8] = name.as_ref(); ++ if let Some(ptr) = name.iter().position(|b| b == &b'.') { ++ name = &name[..ptr]; ++ } ++ LanguageIdentifier::from_bytes(name) ++ } ++} ++ ++#[no_mangle] ++pub unsafe extern "C" fn unic_langid_canonicalize(name: &mut nsACString) -> bool { ++ let langid = new_langid_for_mozilla(name); ++ ++ let result = langid.is_ok(); ++ ++ name.assign(&langid.unwrap_or_default().to_string()); ++ ++ result ++} ++ + + #[no_mangle] + pub unsafe extern "C" fn unic_langid_new( + name: &nsACString, + ret_val: &mut bool, + ) -> *mut LanguageIdentifier { +- let langid = if name.eq_ignore_ascii_case(b"ja-jp-mac") { +- "ja-JP-macos".parse() +- } else { +- LanguageIdentifier::from_bytes(name) +- }; ++ let langid = new_langid_for_mozilla(name); + + *ret_val = langid.is_ok(); + Box::into_raw(Box::new(langid.unwrap_or_default())) +diff --git intl/locale/tests/gtest/TestLocaleService.cpp intl/locale/tests/gtest/TestLocaleService.cpp +index b13ecfd237dfa..aaac8615b09fd 100644 +--- mozilla-release/intl/locale/tests/gtest/TestLocaleService.cpp ++++ mozilla-release/intl/locale/tests/gtest/TestLocaleService.cpp +@@ -10,6 +10,29 @@ + + using namespace mozilla::intl; + ++TEST(Intl_Locale_LocaleService, CanonicalizeLanguageId) ++{ ++ nsCString locale("en-US.POSIX"); ++ ASSERT_TRUE(LocaleService::CanonicalizeLanguageId(locale)); ++ ASSERT_TRUE(locale.EqualsLiteral("en-US")); ++ ++ locale.AssignLiteral("en-US_POSIX"); ++ ASSERT_TRUE(LocaleService::CanonicalizeLanguageId(locale)); ++ ASSERT_TRUE(locale.EqualsLiteral("en-US-posix")); ++ ++ locale.AssignLiteral("en-US-POSIX"); ++ ASSERT_TRUE(LocaleService::CanonicalizeLanguageId(locale)); ++ ASSERT_TRUE(locale.EqualsLiteral("en-US-posix")); ++ ++ locale.AssignLiteral("C"); ++ ASSERT_FALSE(LocaleService::CanonicalizeLanguageId(locale)); ++ ASSERT_TRUE(locale.EqualsLiteral("und")); ++ ++ locale.AssignLiteral(""); ++ ASSERT_FALSE(LocaleService::CanonicalizeLanguageId(locale)); ++ ASSERT_TRUE(locale.EqualsLiteral("und")); ++} ++ + TEST(Intl_Locale_LocaleService, GetAppLocalesAsBCP47) + { + nsTArray<nsCString> appLocales; +diff --git intl/locale/tests/unit/test_localeService.js intl/locale/tests/unit/test_localeService.js +index 1970ae94b2607..202c2674972a8 100644 +--- mozilla-release/intl/locale/tests/unit/test_localeService.js ++++ mozilla-release/intl/locale/tests/unit/test_localeService.js +@@ -204,8 +204,7 @@ add_test(function test_requestedLocales_sanitize() { + Assert.equal(locales[0], "de"); + Assert.equal(locales[1], "pl"); + Assert.equal(locales[2], "de-AT"); +- Assert.equal(locales[3], "und"); +- Assert.equal(locales.length, 4); ++ Assert.equal(locales.length, 3); + + Services.prefs.clearUserPref(PREF_REQUESTED_LOCALES); + diff --git a/www/cliqz/files/patch-bug1622551 b/www/cliqz/files/patch-bug1622551 new file mode 100644 index 000000000000..2ea8f2318e32 --- /dev/null +++ b/www/cliqz/files/patch-bug1622551 @@ -0,0 +1,30 @@ +Silence Service.profiler errors on Tier3 after bug 1613390 + +Taken from www/firefox. + +diff --git browser/components/BrowserGlue.jsm browser/components/BrowserGlue.jsm +index 8f86bf0584a99..2ce53c6921d15 100644 +--- mozilla-release/browser/components/BrowserGlue.jsm ++++ mozilla-release/browser/components/BrowserGlue.jsm +@@ -2300,7 +2300,9 @@ BrowserGlue.prototype = { + ChromeUtils.idleDispatch( + () => { + if (!Services.startup.shuttingDown) { +- Services.profiler.AddMarker("startupIdleTask"); ++ if (Services.profiler) { ++ Services.profiler.AddMarker("startupIdleTask"); ++ } + try { + task.task(); + } catch (ex) { +@@ -2371,7 +2373,9 @@ BrowserGlue.prototype = { + for (let task of idleTasks) { + ChromeUtils.idleDispatch(() => { + if (!Services.startup.shuttingDown) { +- Services.profiler.AddMarker("startupLateIdleTask"); ++ if (Services.profiler) { ++ Services.profiler.AddMarker("startupLateIdleTask"); ++ } + try { + task(); + } catch (ex) { diff --git a/www/cliqz/files/patch-bug847568 b/www/cliqz/files/patch-bug847568 deleted file mode 100644 index 444dc390951a..000000000000 --- a/www/cliqz/files/patch-bug847568 +++ /dev/null @@ -1,289 +0,0 @@ -# Allow building against system-wide graphite2/harfbuzz. - -Taken from www/firefox - -diff --git config/system-headers.mozbuild config/system-headers.mozbuild -index 7620b4d00623..09d3db5ca8c0 100644 ---- mozilla-release/config/system-headers.mozbuild -+++ mozilla-release/config/system-headers.mozbuild -@@ -1299,6 +1299,19 @@ if CONFIG['MOZ_ENABLE_LIBPROXY']: - 'proxy.h', - ] - -+if CONFIG['MOZ_SYSTEM_GRAPHITE2']: -+ system_headers += [ -+ 'graphite2/Font.h', -+ 'graphite2/Segment.h', -+ ] -+ -+if CONFIG['MOZ_SYSTEM_HARFBUZZ']: -+ system_headers += [ -+ 'harfbuzz/hb-glib.h', -+ 'harfbuzz/hb-ot.h', -+ 'harfbuzz/hb.h', -+ ] -+ - if CONFIG['MOZ_SYSTEM_LIBVPX']: - system_headers += [ - 'vpx_mem/vpx_mem.h', -diff --git dom/base/moz.build dom/base/moz.build -index 8e19020315ae..2fcdbb6f7b42 100644 ---- mozilla-release/dom/base/moz.build -+++ mozilla-release/dom/base/moz.build -@@ -543,6 +543,9 @@ if CONFIG['MOZ_BUILD_APP'] in ['browser', 'mobile/android', 'xulrunner']: - if CONFIG['MOZ_X11']: - CXXFLAGS += CONFIG['TK_CFLAGS'] - -+if CONFIG['MOZ_SYSTEM_HARFBUZZ']: -+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] -+ - GeneratedFile('UseCounterList.h', script='gen-usecounters.py', - entry_point='use_counter_list', inputs=['UseCounters.conf']) - -diff --git gfx/graphite2/geckoextra/moz.build gfx/graphite2/geckoextra/moz.build -new file mode 100644 -index 0000000000000..24e8d7a03274a ---- /dev/null -+++ mozilla-release/gfx/graphite2/geckoextra/moz.build -@@ -0,0 +1,21 @@ -+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -+# vim: set filetype=python: -+# This Source Code Form is subject to the terms of the Mozilla Public -+# License, v. 2.0. If a copy of the MPL was not distributed with this -+# file, You can obtain one at http://mozilla.org/MPL/2.0/. -+ -+EXPORTS.graphite2 += [ -+ 'include/GraphiteExtra.h', -+ 'include/GraphiteStructsForRLBox.h', -+] -+ -+UNIFIED_SOURCES += [ -+ '../geckoextra/src/GraphiteExtra.cpp', -+] -+ -+CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS'] -+ -+# Match bundled graphite2 configuration -+AllowCompilerWarnings() -+ -+FINAL_LIBRARY = 'gkmedias' -diff --git gfx/graphite2/moz-gr-update.sh gfx/graphite2/moz-gr-update.sh -index faaab1b17971..04eff5f09882 100644 ---- mozilla-release/gfx/graphite2/moz-gr-update.sh -+++ mozilla-release/gfx/graphite2/moz-gr-update.sh -@@ -1,6 +1,7 @@ - #!/bin/bash - - # Script used to update the Graphite2 library in the mozilla source tree -+# and bump version for --with-system-graphite2 - - # This script lives in gfx/graphite2, along with the library source, - # but must be run from the top level of the mozilla-central tree. -@@ -37,12 +38,16 @@ echo "See" $0 "for update procedure." >> gfx/graphite2/README.mozilla - #find gfx/graphite2/ -name "*.cpp" -exec perl -p -i -e "s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \; - #find gfx/graphite2/ -name "*.h" -exec perl -p -i -e "s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \; - -+# chase version for --with-system-graphite2 -+perl -p -i -e "s/[0-9]+\,[0-9]+\,[0-9]+/$RELEASE/ and tr/./,/ \ -+ if /GR2_VERSION_REQUIRE/" old-configure.in -+ - # summarize what's been touched - echo Updated to $RELEASE. - echo Here is what changed in the gfx/graphite2 directory: - echo - --hg stat gfx/graphite2 -+hg stat old-configure.in gfx/graphite2 - - echo - echo If gfx/graphite2/src/files.mk has changed, please make corresponding -diff --git gfx/harfbuzz/README-mozilla gfx/harfbuzz/README-mozilla -index 22c76a7df020..a01490bd49ee 100644 ---- mozilla-release/gfx/harfbuzz/README-mozilla -+++ mozilla-release/gfx/harfbuzz/README-mozilla -@@ -15,3 +15,8 @@ from within the gfx/harfbuzz directory. - - If the collection of source files changes, manual updates to moz.build may be - needed as we don't use the upstream makefiles. -+ -+The in-tree copy may be omitted during build by --with-system-harfbuzz. -+Make sure to keep pkg-config version check within toolkit/moz.configure in sync -+with checkout version or increment latest tag by one if it's not based -+on upstream release. -diff --git gfx/moz.build gfx/moz.build -index 771f652e837a..3b358d84e384 100644 ---- mozilla-release/gfx/moz.build -+++ mozilla-release/gfx/moz.build -@@ -13,6 +13,14 @@ with Files('wr/**'): - if CONFIG['MOZ_TREE_CAIRO']: - DIRS += ['cairo'] - -+if CONFIG['MOZ_SYSTEM_GRAPHITE2']: -+ DIRS += ['graphite2/geckoextra'] -+else: -+ DIRS += ['graphite2/src' ] -+ -+if not CONFIG['MOZ_SYSTEM_HARFBUZZ']: -+ DIRS += ['harfbuzz/src'] -+ - DIRS += [ - '2d', - 'ycbcr', -@@ -21,8 +29,6 @@ DIRS += [ - 'qcms', - 'gl', - 'layers', -- 'graphite2/src', -- 'harfbuzz/src', - 'ots/src', - 'thebes', - 'ipc', -diff --git gfx/skia/generate_mozbuild.py gfx/skia/generate_mozbuild.py -index e06ae3457a47..93faa61594a3 100755 ---- mozilla-release/gfx/skia/generate_mozbuild.py -+++ mozilla-release/gfx/skia/generate_mozbuild.py -@@ -117,6 +117,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'): - '-Wno-unused-private-field', - ] - -+if CONFIG['MOZ_SYSTEM_HARFBUZZ']: -+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] -+ - if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk', 'android'): - CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS'] - CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS'] -diff --git gfx/skia/moz.build gfx/skia/moz.build -index 2118677ca3a8..e4978b413784 100644 ---- mozilla-release/gfx/skia/moz.build -+++ mozilla-release/gfx/skia/moz.build -@@ -493,6 +493,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'): - '-Wno-unused-private-field', - ] - -+if CONFIG['MOZ_SYSTEM_HARFBUZZ']: -+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] -+ - if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk', 'android'): - CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS'] - CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS'] -diff --git gfx/thebes/moz.build gfx/thebes/moz.build -index 56f1b9fe3f4b..0ac1100b0df3 100644 ---- mozilla-release/gfx/thebes/moz.build -+++ mozilla-release/gfx/thebes/moz.build -@@ -284,7 +284,13 @@ if CONFIG['MOZ_WAYLAND']: - - LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES'] - --DEFINES['GRAPHITE2_STATIC'] = True -+if CONFIG['MOZ_SYSTEM_GRAPHITE2']: -+ CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS'] -+else: -+ DEFINES['GRAPHITE2_STATIC'] = True -+ -+if CONFIG['MOZ_SYSTEM_HARFBUZZ']: -+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] - - if CONFIG['CC_TYPE'] == 'clang': - # Suppress warnings from Skia header files. -diff --git intl/unicharutil/util/moz.build intl/unicharutil/util/moz.build -index cb1233c56d7e..06fb1f9f174b 100644 ---- mozilla-release/intl/unicharutil/util/moz.build -+++ mozilla-release/intl/unicharutil/util/moz.build -@@ -25,4 +25,7 @@ UNIFIED_SOURCES += [ - 'nsUnicodeProperties.cpp', - ] - -+if CONFIG['MOZ_SYSTEM_HARFBUZZ']: -+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] -+ - FINAL_LIBRARY = 'xul' -diff --git netwerk/dns/moz.build netwerk/dns/moz.build -index 79c26e3e7001..c4d93bc5f7dc 100644 ---- mozilla-release/netwerk/dns/moz.build -+++ mozilla-release/netwerk/dns/moz.build -@@ -86,3 +86,6 @@ USE_LIBS += ['icu'] - - if CONFIG['CC_TYPE'] in ('clang', 'gcc'): - CXXFLAGS += ['-Wno-error=shadow'] -+ -+if CONFIG['MOZ_SYSTEM_HARFBUZZ']: -+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] -diff --git old-configure.in old-configure.in -index 95a58b634593..b614eef85c89 100644 ---- mozilla-release/old-configure.in -+++ mozilla-release/old-configure.in -@@ -2639,6 +2639,27 @@ dnl ======================================================== - - AC_SUBST(MOZ_LINUX_32_SSE2_STARTUP_ERROR) - -+dnl ======================================================== -+dnl Check for graphite2 -+dnl ======================================================== -+if test -n "$MOZ_SYSTEM_GRAPHITE2"; then -+ dnl graphite2.pc has bogus version, check manually -+ _SAVE_CFLAGS=$CFLAGS -+ CFLAGS="$CFLAGS $MOZ_GRAPHITE2_CFLAGS" -+ AC_TRY_COMPILE([ #include <graphite2/Font.h> -+ #define GR2_VERSION_REQUIRE(major,minor,bugfix) \ -+ ( GR2_VERSION_MAJOR * 10000 + GR2_VERSION_MINOR \ -+ * 100 + GR2_VERSION_BUGFIX >= \ -+ (major) * 10000 + (minor) * 100 + (bugfix) ) -+ ], [ -+ #if !GR2_VERSION_REQUIRE(1,3,13) -+ #error "Insufficient graphite2 version." -+ #endif -+ ], [], -+ [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])]) -+ CFLAGS=$_SAVE_CFLAGS -+fi -+ - dnl ======================================================== - dnl Check for pixman and cairo - dnl ======================================================== -diff --git toolkit/library/moz.build toolkit/library/moz.build -index 24f940e1ed7e..079a575adec3 100644 ---- mozilla-release/toolkit/library/moz.build -+++ mozilla-release/toolkit/library/moz.build -@@ -248,6 +248,12 @@ if CONFIG['MOZ_SYSTEM_PNG']: - if CONFIG['MOZ_SYSTEM_WEBP']: - OS_LIBS += CONFIG['MOZ_WEBP_LIBS'] - -+if CONFIG['MOZ_SYSTEM_GRAPHITE2']: -+ OS_LIBS += CONFIG['MOZ_GRAPHITE2_LIBS'] -+ -+if CONFIG['MOZ_SYSTEM_HARFBUZZ']: -+ OS_LIBS += CONFIG['MOZ_HARFBUZZ_LIBS'] -+ - if CONFIG['MOZ_SYSTEM_LIBEVENT']: - OS_LIBS += CONFIG['MOZ_LIBEVENT_LIBS'] - -diff --git toolkit/moz.configure toolkit/moz.configure -index 9297e4d6f501..d8e273887e4b 100644 ---- mozilla-release/toolkit/moz.configure -+++ mozilla-release/toolkit/moz.configure -@@ -937,6 +937,25 @@ add_old_configure_assignment('FT2_LIBS', - add_old_configure_assignment('FT2_CFLAGS', - ft2_info.cflags) - -+# Graphite2 -+# ============================================================== -+option('--with-system-graphite2', -+ help="Use system graphite2 (located with pkgconfig)") -+ -+system_graphite2 = pkg_check_modules('MOZ_GRAPHITE2', 'graphite2', -+ when='--with-system-graphite2') -+ -+set_config('MOZ_SYSTEM_GRAPHITE2', depends_if(system_graphite2)(lambda _: True)) -+ -+# HarfBuzz -+# ============================================================== -+option('--with-system-harfbuzz', -+ help="Use system harfbuzz (located with pkgconfig)") -+ -+system_harfbuzz = pkg_check_modules('MOZ_HARFBUZZ', 'harfbuzz >= 2.6.4', -+ when='--with-system-harfbuzz') -+ -+set_config('MOZ_SYSTEM_HARFBUZZ', depends_if(system_harfbuzz)(lambda _: True)) - - # Remote agent (part of CDP based remote protocol) - # ============================================================== |