1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Thomas Deutschmann <whissi@gentoo.org>
Date: Mon, 6 Apr 2020 19:32:39 +0200
Subject: [PATCH] Bug 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 | 8 ++++++++
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 | 8 ++++++++
10 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
index de316e2027dfa8199e6b9d05d256254fb93eaa9c..4af5ccf20d07c73ef97acae493c14340cfa30603 100644
--- a/config/system-headers.mozbuild
+++ b/config/system-headers.mozbuild
@@ -1253,6 +1253,14 @@ 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 e2cf2dfb78c0d8f2ceb1a2ff58fd498a567dee45..fae8c8ff924c418e1d499ab7d508e41ecce3abf9 100644
--- a/dom/base/moz.build
+++ b/dom/base/moz.build
@@ -615,6 +615,9 @@ FINAL_LIBRARY = "xul"
if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
CXXFLAGS += CONFIG["MOZ_GTK3_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 56ea317bedfc68d504248b5d3b79cd36e8bc388a..6cc19f84709bbe3be4ff830e3a6dd29189048c6f 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 c161d24df853934a64ab363658c878e3257a8afb..8c7dd395b371a5a2347ffcd9133db56ecc55df0c 100755
--- a/gfx/skia/generate_mozbuild.py
+++ b/gfx/skia/generate_mozbuild.py
@@ -91,6 +91,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 83aa2957a938e762916fb32c5454fb4791db7c1b..0859316a1f09034e57792fa5505d072bae550acc 100644
--- a/gfx/skia/moz.build
+++ b/gfx/skia/moz.build
@@ -601,6 +601,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 3d99906827c63cfafea5c0cd394732c9414ed730..acb7094e2a39e18681df294b0ac01e7b87a11b30 100644
--- a/gfx/thebes/moz.build
+++ b/gfx/thebes/moz.build
@@ -302,6 +302,9 @@ LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
DEFINES["GRAPHITE2_STATIC"] = True
+if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
+ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
+
CXXFLAGS += ["-Werror=switch"]
include("/tools/fuzzing/libfuzzer-config.mozbuild")
diff --git a/intl/unicharutil/util/moz.build b/intl/unicharutil/util/moz.build
index 2396210428ee11b660fce0cbeba9a119b9f7bcb2..092baac6f79c65aff378a97149daa7844d327a49 100644
--- a/intl/unicharutil/util/moz.build
+++ b/intl/unicharutil/util/moz.build
@@ -24,6 +24,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 c926d14707d15d06e24be4bda7577578904373c4..5082238fbcf9a275066e6878a67e29bbe830f169 100644
--- a/netwerk/dns/moz.build
+++ b/netwerk/dns/moz.build
@@ -119,4 +119,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 9fa86b386b613d3dde8429b2c479763ed435f36c..b0dfb79025db9b35ea00254001658c97c48b4539 100644
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
@@ -288,6 +288,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 26a624ed9948dd6a74173f71859617f808dcab3d..3ecba6340a007d7475cec011ad2a4e35f190fbcf 100644
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -685,6 +685,14 @@ def freetype2_combined_info(fontconfig_info, freetype2_info):
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
# ==============================================================
|