summaryrefslogtreecommitdiff
path: root/www/librewolf/files/patch-bug847568
blob: 6e2cccebff70d1f6c573db5ecab38b4416ab6a68 (plain) (blame)
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
# Allow building against system-wide graphite2/harfbuzz.

--- config/system-headers.mozbuild.orig	2024-07-25 20:34:40 UTC
+++ config/system-headers.mozbuild
@@ -1305,6 +1305,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_ICU"]:
     system_headers += [
         "unicode/calendar.h",
--- dom/base/moz.build.orig	2024-07-25 20:34:40 UTC
+++ dom/base/moz.build
@@ -616,6 +616,9 @@ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
 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",
--- gfx/graphite2/geckoextra/moz.build.orig	2024-08-13 19:48:57 UTC
+++ 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 = 'xul'
--- gfx/harfbuzz/README-mozilla.fbsd.orig	2024-08-13 19:48:57 UTC
+++ gfx/harfbuzz/README-mozilla.fbsd
@@ -0,0 +1,4 @@
+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.
--- gfx/moz.build.orig	2024-07-25 20:34:43 UTC
+++ gfx/moz.build
@@ -10,6 +10,14 @@ with Files("wr/**"):
 with Files("wr/**"):
     BUG_COMPONENT = ("Core", "Graphics: WebRender")
 
+if CONFIG["MOZ_SYSTEM_GRAPHITE2"]:
+    DIRS += ["graphite2/geckoextra"]
+else:
+    DIRS += ["graphite2/src" ]
+
+if not CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
+    DIRS += ["harfbuzz/src"]
+
 DIRS += [
     "cairo",
     "2d",
@@ -19,8 +27,6 @@ DIRS += [
     "qcms",
     "gl",
     "layers",
-    "graphite2/src",
-    "harfbuzz/src",
     "ots/src",
     "thebes",
     "ipc",
--- gfx/skia/generate_mozbuild.py.orig	2024-07-25 20:34:42 UTC
+++ gfx/skia/generate_mozbuild.py
@@ -95,6 +95,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",
--- gfx/skia/moz.build.orig	2024-07-25 20:34:42 UTC
+++ gfx/skia/moz.build
@@ -623,6 +623,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",
--- gfx/thebes/moz.build.orig	2024-07-25 20:34:42 UTC
+++ gfx/thebes/moz.build
@@ -295,7 +295,13 @@ LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
 
 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"]
 
 CXXFLAGS += ["-Werror=switch"]
 
--- intl/unicharutil/util/moz.build.orig	2024-07-25 20:34:43 UTC
+++ 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(
--- netwerk/dns/moz.build.orig	2024-07-25 20:34:48 UTC
+++ netwerk/dns/moz.build
@@ -112,6 +112,9 @@ GeneratedFile(
     "etld_data.inc", script="prepare_tlds.py", inputs=["effective_tld_names.dat"]
 )
 
+if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
+    CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
+
 # need to include etld_data.inc
 LOCAL_INCLUDES += [
     "/netwerk/base",
--- old-configure.in.orig	2024-07-25 20:34:49 UTC
+++ old-configure.in
@@ -704,6 +704,27 @@ dnl ==================================================
 AC_SUBST(MOZ_MACBUNDLE_ID)
 
 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,14)
+                     #error "Insufficient graphite2 version."
+                     #endif
+                   ], [],
+                   [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])])
+    CFLAGS=$_SAVE_CFLAGS
+fi
+
+dnl ========================================================
 dnl = Child Process Name for IPC
 dnl ========================================================
 if test "$MOZ_WIDGET_TOOLKIT" != "android"; then
--- toolkit/library/moz.build.orig	2024-07-25 20:34:58 UTC
+++ toolkit/library/moz.build
@@ -297,6 +297,12 @@ if CONFIG["MOZ_SYSTEM_WEBP"]:
 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"]
 
--- toolkit/moz.configure.orig	2024-08-02 23:23:42 UTC
+++ toolkit/moz.configure
@@ -1279,6 +1279,26 @@ set_config("CAIRO_FT_CFLAGS", ft2_info.cflags, when=en
 set_config("MOZ_ENABLE_CAIRO_FT", True, when=enable_cairo_ft)
 set_config("CAIRO_FT_CFLAGS", ft2_info.cflags, when=enable_cairo_ft)
 
+# 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.7.4",
+                                    when="--with-system-harfbuzz")
+
+set_config("MOZ_SYSTEM_HARFBUZZ", depends_if(system_harfbuzz)(lambda _: True))
+
 
 # WebDriver (HTTP / BiDi)
 # ==============================================================