182 lines
5.5 KiB
Diff
182 lines
5.5 KiB
Diff
![]() |
From 61e8f03c526a40dda89b57aad6aec3f37d7125cd Mon Sep 17 00:00:00 2001
|
||
|
From: Thomas Deutschmann <whissi@gentoo.org>
|
||
|
Date: Mon, 6 Apr 2020 19:32:39 +0200
|
||
|
Subject: [PATCH 04/30] bmo#847568: Support system harfbuzz
|
||
|
|
||
|
Allow building against system-wide harfbuzz.
|
||
|
|
||
|
Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=847568
|
||
|
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
|
||
|
---
|
||
|
config/system-headers.mozbuild | 7 +++++++
|
||
|
dom/base/moz.build | 3 +++
|
||
|
gfx/moz.build | 4 +++-
|
||
|
gfx/skia/generate_mozbuild.py | 3 +++
|
||
|
gfx/skia/moz.build | 3 +++
|
||
|
gfx/thebes/moz.build | 3 +++
|
||
|
intl/unicharutil/util/moz.build | 3 +++
|
||
|
netwerk/dns/moz.build | 3 +++
|
||
|
toolkit/library/moz.build | 3 +++
|
||
|
toolkit/moz.configure | 9 +++++++++
|
||
|
10 files changed, 40 insertions(+), 1 deletion(-)
|
||
|
|
||
|
diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
|
||
|
index ae0c9d6d7c..44d08cf06b 100644
|
||
|
--- a/config/system-headers.mozbuild
|
||
|
+++ b/config/system-headers.mozbuild
|
||
|
@@ -1237,6 +1237,13 @@ if CONFIG['OS_TARGET'] == 'Android':
|
||
|
'vr/gvr/capi/include/gvr.h',
|
||
|
]
|
||
|
|
||
|
+if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
|
||
|
+ system_headers += [
|
||
|
+ 'harfbuzz/hb-glib.h',
|
||
|
+ 'harfbuzz/hb-ot.h',
|
||
|
+ 'harfbuzz/hb.h',
|
||
|
+ ]
|
||
|
+
|
||
|
if CONFIG['MOZ_JACK']:
|
||
|
system_headers += [
|
||
|
'jack/jack.h',
|
||
|
diff --git a/dom/base/moz.build b/dom/base/moz.build
|
||
|
index d390adfc49..4508f19cb6 100644
|
||
|
--- a/dom/base/moz.build
|
||
|
+++ b/dom/base/moz.build
|
||
|
@@ -567,6 +567,9 @@ FINAL_LIBRARY = "xul"
|
||
|
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",
|
||
|
diff --git a/gfx/moz.build b/gfx/moz.build
|
||
|
index 4d6d63da9d..8222b72333 100644
|
||
|
--- a/gfx/moz.build
|
||
|
+++ b/gfx/moz.build
|
||
|
@@ -10,6 +10,9 @@ with Files("**"):
|
||
|
with Files("wr/**"):
|
||
|
BUG_COMPONENT = ("Core", "Graphics: WebRender")
|
||
|
|
||
|
+if not CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
|
||
|
+ DIRS += ["harfbuzz/src"]
|
||
|
+
|
||
|
DIRS += [
|
||
|
"cairo",
|
||
|
"2d",
|
||
|
@@ -20,7 +23,6 @@ DIRS += [
|
||
|
"gl",
|
||
|
"layers",
|
||
|
"graphite2/src",
|
||
|
- "harfbuzz/src",
|
||
|
"ots/src",
|
||
|
"thebes",
|
||
|
"ipc",
|
||
|
diff --git a/gfx/skia/generate_mozbuild.py b/gfx/skia/generate_mozbuild.py
|
||
|
index 5e0fd17d79..860b80af4f 100755
|
||
|
--- a/gfx/skia/generate_mozbuild.py
|
||
|
+++ b/gfx/skia/generate_mozbuild.py
|
||
|
@@ -96,6 +96,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'):
|
||
|
LOCAL_INCLUDES += [
|
||
|
"/gfx/cairo/cairo/src",
|
||
|
diff --git a/gfx/skia/moz.build b/gfx/skia/moz.build
|
||
|
index 524bd28dac..615c93b266 100755
|
||
|
--- a/gfx/skia/moz.build
|
||
|
+++ b/gfx/skia/moz.build
|
||
|
@@ -488,6 +488,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'):
|
||
|
LOCAL_INCLUDES += [
|
||
|
"/gfx/cairo/cairo/src",
|
||
|
diff --git a/gfx/thebes/moz.build b/gfx/thebes/moz.build
|
||
|
index baa6f090a9..c51c36e2b4 100644
|
||
|
--- a/gfx/thebes/moz.build
|
||
|
+++ b/gfx/thebes/moz.build
|
||
|
@@ -288,6 +288,9 @@ LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
|
||
|
|
||
|
DEFINES["GRAPHITE2_STATIC"] = True
|
||
|
|
||
|
+if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
|
||
|
+ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
|
||
|
+
|
||
|
if CONFIG["CC_TYPE"] in ("clang", "clang-cl"):
|
||
|
# Suppress warnings from Skia header files.
|
||
|
SOURCES["gfxPlatform.cpp"].flags += ["-Wno-implicit-fallthrough"]
|
||
|
diff --git a/intl/unicharutil/util/moz.build b/intl/unicharutil/util/moz.build
|
||
|
index 301eb9a854..7cece5e06c 100644
|
||
|
--- a/intl/unicharutil/util/moz.build
|
||
|
+++ b/intl/unicharutil/util/moz.build
|
||
|
@@ -25,6 +25,9 @@ UNIFIED_SOURCES += [
|
||
|
"nsUnicodeProperties.cpp",
|
||
|
]
|
||
|
|
||
|
+if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
|
||
|
+ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
|
||
|
+
|
||
|
include("/ipc/chromium/chromium-config.mozbuild")
|
||
|
|
||
|
GeneratedFile(
|
||
|
diff --git a/netwerk/dns/moz.build b/netwerk/dns/moz.build
|
||
|
index f769e270fa..8f64710257 100644
|
||
|
--- a/netwerk/dns/moz.build
|
||
|
+++ b/netwerk/dns/moz.build
|
||
|
@@ -109,4 +109,7 @@ LOCAL_INCLUDES += [
|
||
|
"/netwerk/protocol/http",
|
||
|
]
|
||
|
|
||
|
+if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
|
||
|
+ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
|
||
|
+
|
||
|
USE_LIBS += ["icu"]
|
||
|
diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build
|
||
|
index 2c3f86948e..dd6901ba9a 100644
|
||
|
--- a/toolkit/library/moz.build
|
||
|
+++ b/toolkit/library/moz.build
|
||
|
@@ -260,6 +260,9 @@ if CONFIG["MOZ_ANDROID_GOOGLE_VR"]:
|
||
|
"-lgvr",
|
||
|
]
|
||
|
|
||
|
+if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
|
||
|
+ OS_LIBS += CONFIG["MOZ_HARFBUZZ_LIBS"]
|
||
|
+
|
||
|
if CONFIG["MOZ_SYSTEM_JPEG"]:
|
||
|
OS_LIBS += CONFIG["MOZ_JPEG_LIBS"]
|
||
|
|
||
|
diff --git a/toolkit/moz.configure b/toolkit/moz.configure
|
||
|
index 00698656f6..1843188d11 100644
|
||
|
--- a/toolkit/moz.configure
|
||
|
+++ b/toolkit/moz.configure
|
||
|
@@ -460,6 +460,15 @@ add_old_configure_assignment(
|
||
|
)
|
||
|
set_define("MOZ_HAVE_FREETYPE2", depends_if(freetype2_info)(lambda _: True))
|
||
|
|
||
|
+# HarfBuzz
|
||
|
+# ==============================================================
|
||
|
+option('--with-system-harfbuzz', help="Use system harfbuzz (located with pkgconfig)")
|
||
|
+
|
||
|
+system_harfbuzz = pkg_check_modules('MOZ_HARFBUZZ', 'harfbuzz >= 2.7.4',
|
||
|
+ when='--with-system-harfbuzz')
|
||
|
+
|
||
|
+set_config('MOZ_SYSTEM_HARFBUZZ', depends_if(system_harfbuzz)(lambda _: True))
|
||
|
+
|
||
|
# Apple platform decoder support
|
||
|
# ==============================================================
|
||
|
@depends(toolkit)
|
||
|
--
|
||
|
2.34.1
|
||
|
|