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
|
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 | 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 | 8 ++++++++
10 files changed, 39 insertions(+), 1 deletion(-)
diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
index 4b61063cf92a2adabb7b552328420aefbfc93242..f35c684e9ef6693804d8e026d8ff3fa8236f6444 100644
--- a/config/system-headers.mozbuild
+++ b/config/system-headers.mozbuild
@@ -1238,6 +1238,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 f5dfc1b1ae258491c635a0f7f767d67ec6574826..d158b81012bc5fabd5f2668d7674b3a2d1c60d88 100644
--- a/dom/base/moz.build
+++ b/dom/base/moz.build
@@ -608,6 +608,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 39675ea9c2e939580f7e11fe17c10b0b49f4ed4c..6262eec29395c873bd1d10377a54b99ca16e92e5 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 1d92936263a091eac0dc90fdb0038982e711d5c3..afef373e62af4273aa2b21f3fd3103dc5670ea00 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 97f02d59f51a7e9b06a852963cf03a8463df09f0..3067b49c8d3d069e74acd2baa04eaaf2c95094f9 100644
--- a/gfx/thebes/moz.build
+++ b/gfx/thebes/moz.build
@@ -292,6 +292,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 2bbd00415cae9d6a27b66d9eef50add3ada9ba96..f66bd37695d41eea709abea1239dfcd2cbb503d1 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 17612ff1b396891c8942f53d3f39fbca8bdca6cb..d6d51948da54c7fbca53662050d33019e7e0dea6 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 da1d8c47f83e2f23cd802615ab8fff822f6e05c8..7ee842def285a9a7fc805758e9f73494c0a59224 100644
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
@@ -286,6 +286,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 eb7ae84b5d65df80e23b8ab503ffe0576c2a30a0..5c461d746a7718befe988d48364ea5d74c0b6d48 100644
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -678,6 +678,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
# ==============================================================
|