summarylogtreecommitdiffstats
path: root/2000_system_harfbuzz_support.patch
blob: 37017f9623de95d9b691f035df70251c7ba5453c (plain)
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
179
180
181
182
183
# HG changeset patch
# Parent  ddfced51baf26d84a283f2838dc4cf3a1dbff7ec
Add ability to use system-harfbuzz instead of bundled.

https://bugzilla.mozilla.org/show_bug.cgi?id=847568

diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
--- a/config/system-headers.mozbuild
+++ b/config/system-headers.mozbuild
@@ -1227,16 +1227,23 @@ if CONFIG['OS_TARGET'] == 'Android':
         'utils/TypeHelpers.h',
         'utils/Unicode.h',
         'utils/Vector.h',
         'utils/VectorImpl.h',
         'vr/gvr/capi/include/gvr_controller.h',
         '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',
         'jack/statistics.h',
     ]
 
 if CONFIG['MOZ_SYSTEM_JPEG']:
     system_headers += [
diff --git a/dom/base/moz.build b/dom/base/moz.build
--- a/dom/base/moz.build
+++ b/dom/base/moz.build
@@ -549,6 +549,9 @@
 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
--- a/gfx/moz.build
+++ b/gfx/moz.build
@@ -13,6 +13,9 @@
 if CONFIG["MOZ_TREE_CAIRO"]:
     DIRS += ["cairo"]
 
+if not CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+    DIRS += ['harfbuzz/src']
+
 DIRS += [
     "2d",
     "ycbcr",
@@ -22,7 +25,6 @@
     "gl",
     "layers",
     "graphite2/src",
-    "harfbuzz/src",
     "ots/src",
     "thebes",
     "ipc",
diff --git a/gfx/skia/generate_mozbuild.py b/gfx/skia/generate_mozbuild.py
--- a/gfx/skia/generate_mozbuild.py
+++ b/gfx/skia/generate_mozbuild.py
@@ -93,16 +93,19 @@ if CONFIG['CC_TYPE'] == 'gcc':
 if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
     CXXFLAGS += [
         '-Wno-implicit-fallthrough',
         '-Wno-inconsistent-missing-override',
         '-Wno-macro-redefined',
         '-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']
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS']
 
 if CONFIG['MOZ_ENABLE_SKIA_PDF_SFNTLY']:
diff --git a/gfx/skia/moz.build b/gfx/skia/moz.build
--- a/gfx/skia/moz.build
+++ b/gfx/skia/moz.build
@@ -485,16 +485,19 @@ if CONFIG['CC_TYPE'] == 'gcc':
 if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
     CXXFLAGS += [
         '-Wno-implicit-fallthrough',
         '-Wno-inconsistent-missing-override',
         '-Wno-macro-redefined',
         '-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']
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
     CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS']
 
 if CONFIG['MOZ_ENABLE_SKIA_PDF_SFNTLY']:
diff --git a/gfx/thebes/moz.build b/gfx/thebes/moz.build
--- a/gfx/thebes/moz.build
+++ b/gfx/thebes/moz.build
@@ -289,6 +289,9 @@
 
 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.
     SOURCES["gfxPlatform.cpp"].flags += ["-Wno-implicit-fallthrough"]
diff --git a/intl/unicharutil/util/moz.build b/intl/unicharutil/util/moz.build
--- a/intl/unicharutil/util/moz.build
+++ b/intl/unicharutil/util/moz.build
@@ -25,4 +25,7 @@
     "nsUnicodeProperties.cpp",
 ]
 
+if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+    CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
+
 FINAL_LIBRARY = "xul"
diff --git a/netwerk/dns/moz.build b/netwerk/dns/moz.build
--- a/netwerk/dns/moz.build
+++ b/netwerk/dns/moz.build
@@ -102,5 +102,8 @@
 
 USE_LIBS += ["icu"]
 
+if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+    CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
+
 if CONFIG["CC_TYPE"] in ("clang", "gcc"):
     CXXFLAGS += ["-Wno-error=shadow"]
diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
@@ -238,6 +238,9 @@
 OS_LIBS += CONFIG["MOZ_CAIRO_OSLIBS"]
 OS_LIBS += CONFIG["MOZ_WEBRTC_X11_LIBS"]
 
+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
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -475,6 +475,16 @@
     "_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.3.1',
+                                    when='--with-system-harfbuzz')
+
+set_config('MOZ_SYSTEM_HARFBUZZ', depends_if(system_harfbuzz)(lambda _: True))
+
 # Apple platform decoder support
 # ==============================================================
 @depends(toolkit)