Line 0
Link Here
|
|
|
1 |
# Allow building against system-wide graphite2/harfbuzz. |
2 |
|
3 |
--- config/Makefile.in.orig 2017-11-05 12:13:54 UTC |
4 |
+++ config/Makefile.in |
5 |
@@ -78,6 +78,8 @@ export:: $(export-preqs) |
6 |
-DMOZ_NATIVE_LIBVPX=$(MOZ_NATIVE_LIBVPX) \ |
7 |
-DMOZ_NATIVE_LIBWEBP=$(MOZ_NATIVE_LIBWEBP) \ |
8 |
-DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \ |
9 |
+ -DMOZ_NATIVE_GRAPHITE2=$(MOZ_NATIVE_GRAPHITE2) \ |
10 |
+ -DMOZ_NATIVE_HARFBUZZ=$(MOZ_NATIVE_HARFBUZZ) \ |
11 |
$(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers |
12 |
$(INSTALL) system_wrappers $(DIST) |
13 |
|
14 |
--- config/system-headers.orig 2017-11-05 12:13:54 UTC |
15 |
+++ config/system-headers |
16 |
@@ -1359,3 +1359,11 @@ unicode/utypes.h |
17 |
#endif |
18 |
libutil.h |
19 |
unwind.h |
20 |
+#if MOZ_NATIVE_GRAPHITE2==1 |
21 |
+graphite2/Font.h |
22 |
+graphite2/Segment.h |
23 |
+#endif |
24 |
+#if MOZ_NATIVE_HARFBUZZ==1 |
25 |
+harfbuzz/hb-ot.h |
26 |
+harfbuzz/hb.h |
27 |
+#endif |
28 |
--- configure.in.orig 2017-11-05 12:13:54 UTC |
29 |
+++ configure.in |
30 |
@@ -7746,6 +7746,49 @@ if test "$USE_FC_FREETYPE"; then |
31 |
fi |
32 |
|
33 |
dnl ======================================================== |
34 |
+dnl Check for harfbuzz |
35 |
+dnl ======================================================== |
36 |
+ |
37 |
+MOZ_ARG_WITH_BOOL(system-harfbuzz, |
38 |
+[ --with-system-harfbuzz Use system harfbuzz (located with pkgconfig)], |
39 |
+MOZ_NATIVE_HARFBUZZ=1, |
40 |
+MOZ_NATIVE_HARFBUZZ=) |
41 |
+ |
42 |
+if test -n "$MOZ_NATIVE_HARFBUZZ"; then |
43 |
+ PKG_CHECK_MODULES(MOZ_HARFBUZZ, harfbuzz >= 0.9.34) |
44 |
+fi |
45 |
+ |
46 |
+AC_SUBST(MOZ_NATIVE_HARFBUZZ) |
47 |
+ |
48 |
+dnl ======================================================== |
49 |
+dnl Check for graphite2 |
50 |
+dnl ======================================================== |
51 |
+ |
52 |
+MOZ_ARG_WITH_BOOL(system-graphite2, |
53 |
+[ --with-system-graphite2 Use system graphite2 (located with pkgconfig)], |
54 |
+MOZ_NATIVE_GRAPHITE2=1, |
55 |
+MOZ_NATIVE_GRAPHITE2=) |
56 |
+ |
57 |
+if test -n "$MOZ_NATIVE_GRAPHITE2"; then |
58 |
+ PKG_CHECK_MODULES(MOZ_GRAPHITE2, graphite2) |
59 |
+ |
60 |
+ dnl graphite2.pc has bogus version, check manually |
61 |
+ AC_TRY_COMPILE([ #include <graphite2/Font.h> |
62 |
+ #define GR2_VERSION_REQUIRE(major,minor,bugfix) \ |
63 |
+ ( GR2_VERSION_MAJOR * 10000 + GR2_VERSION_MINOR \ |
64 |
+ * 100 + GR2_VERSION_BUGFIX >= \ |
65 |
+ (major) * 10000 + (minor) * 100 + (bugfix) ) |
66 |
+ ], [ |
67 |
+ #if !GR2_VERSION_REQUIRE(1,2,4) |
68 |
+ #error "Insufficient graphite2 version." |
69 |
+ #endif |
70 |
+ ], [], |
71 |
+ [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])]) |
72 |
+fi |
73 |
+ |
74 |
+AC_SUBST(MOZ_NATIVE_GRAPHITE2) |
75 |
+ |
76 |
+dnl ======================================================== |
77 |
dnl Check for pixman and cairo |
78 |
dnl ======================================================== |
79 |
|
80 |
--- dom/base/moz.build.orig 2017-11-05 12:13:54 UTC |
81 |
+++ dom/base/moz.build |
82 |
@@ -366,6 +366,9 @@ if CONFIG['INTEL_ARCHITECTURE']: |
83 |
SOURCES += ['nsTextFragmentSSE2.cpp'] |
84 |
SOURCES['nsTextFragmentSSE2.cpp'].flags += CONFIG['SSE2_FLAGS'] |
85 |
|
86 |
+if CONFIG['MOZ_NATIVE_HARFBUZZ']: |
87 |
+ SOURCES['nsContentUtils.cpp'].flags += CONFIG['MOZ_HARFBUZZ_CFLAGS'] |
88 |
+ |
89 |
EXTRA_COMPONENTS += [ |
90 |
'ConsoleAPI.manifest', |
91 |
'ConsoleAPIStorage.js', |
92 |
--- gfx/graphite2/moz-gr-update.sh.orig 2017-11-05 12:13:54 UTC |
93 |
+++ gfx/graphite2/moz-gr-update.sh |
94 |
@@ -37,6 +37,9 @@ echo "See" $0 "for update procedure." >> |
95 |
#find gfx/graphite2/ -name "*.cpp" -exec perl -p -i -e "s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \; |
96 |
#find gfx/graphite2/ -name "*.h" -exec perl -p -i -e "s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \; |
97 |
|
98 |
+perl -p -i -e "s/[0-9]+\,[0-9]+\,[0-9]+/$RELEASE/ and tr/./,/ \ |
99 |
+ if /GR2_VERSION_REQUIRE/" configure.in |
100 |
+ |
101 |
# summarize what's been touched |
102 |
echo Updated to $RELEASE. |
103 |
echo Here is what changed in the gfx/graphite2 directory: |
104 |
--- gfx/harfbuzz/README-mozilla.orig 2017-11-05 12:13:54 UTC |
105 |
+++ gfx/harfbuzz/README-mozilla |
106 |
@@ -19,3 +19,8 @@ the mozilla tree. |
107 |
|
108 |
If the collection of source files changes, manual updates to moz.build may be |
109 |
needed, as we don't use the upstream makefiles. |
110 |
+ |
111 |
+The in-tree copy may be omitted during build by --with-system-harfbuzz. |
112 |
+Make sure to keep pkg-config version check within configure.in in sync |
113 |
+with checkout version or increment latest tag by one if it's not based |
114 |
+on upstream release. |
115 |
--- gfx/moz.build.orig 2017-11-05 12:13:54 UTC |
116 |
+++ gfx/moz.build |
117 |
@@ -7,6 +7,12 @@ |
118 |
if CONFIG['MOZ_TREE_CAIRO']: |
119 |
DIRS += ['cairo'] |
120 |
|
121 |
+if not CONFIG['MOZ_NATIVE_GRAPHITE2']: |
122 |
+ DIRS += ['graphite2/src' ] |
123 |
+ |
124 |
+if not CONFIG['MOZ_NATIVE_HARFBUZZ']: |
125 |
+ DIRS += ['harfbuzz/src'] |
126 |
+ |
127 |
DIRS += [ |
128 |
'2d', |
129 |
'ycbcr', |
130 |
@@ -15,8 +21,6 @@ DIRS += [ |
131 |
'qcms', |
132 |
'gl', |
133 |
'layers', |
134 |
- 'graphite2/src', |
135 |
- 'harfbuzz/src', |
136 |
'ots/src', |
137 |
'thebes', |
138 |
'ipc', |
139 |
--- gfx/skia/generate_mozbuild.py.orig 2017-11-05 12:13:54 UTC |
140 |
+++ gfx/skia/generate_mozbuild.py |
141 |
@@ -157,6 +157,9 @@ if CONFIG['CLANG_CXX']: |
142 |
'-Wno-unused-private-field', |
143 |
] |
144 |
|
145 |
+if CONFIG['MOZ_NATIVE_HARFBUZZ']: |
146 |
+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] |
147 |
+ |
148 |
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3', 'android', 'gonk', 'qt'): |
149 |
CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS'] |
150 |
CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS'] |
151 |
--- gfx/skia/moz.build.orig 2017-11-05 12:13:54 UTC |
152 |
+++ gfx/skia/moz.build |
153 |
@@ -987,6 +987,9 @@ if CONFIG['CLANG_CXX']: |
154 |
'-Wno-unused-private-field', |
155 |
] |
156 |
|
157 |
+if CONFIG['MOZ_NATIVE_HARFBUZZ']: |
158 |
+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] |
159 |
+ |
160 |
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3', 'android', 'gonk', 'qt'): |
161 |
CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS'] |
162 |
CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS'] |
163 |
--- gfx/thebes/moz.build.orig 2017-11-05 12:13:54 UTC |
164 |
+++ gfx/thebes/moz.build |
165 |
@@ -298,7 +298,13 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'andr |
166 |
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3', 'qt'): |
167 |
CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS'] |
168 |
|
169 |
-DEFINES['GRAPHITE2_STATIC'] = True |
170 |
+if CONFIG['MOZ_NATIVE_HARFBUZZ']: |
171 |
+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] |
172 |
+ |
173 |
+if CONFIG['MOZ_NATIVE_GRAPHITE2']: |
174 |
+ CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS'] |
175 |
+else: |
176 |
+ DEFINES['GRAPHITE2_STATIC'] = True |
177 |
|
178 |
if CONFIG['GKMEDIAS_SHARED_LIBRARY']: |
179 |
DEFINES['OTS_DLL'] = True |
180 |
--- intl/unicharutil/util/moz.build.orig 2017-11-05 12:13:54 UTC |
181 |
+++ intl/unicharutil/util/moz.build |
182 |
@@ -38,5 +38,8 @@ if CONFIG['_MSC_VER']: |
183 |
if CONFIG['ENABLE_INTL_API']: |
184 |
CXXFLAGS += CONFIG['MOZ_ICU_CFLAGS'] |
185 |
|
186 |
+if CONFIG['MOZ_NATIVE_HARFBUZZ']: |
187 |
+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] |
188 |
+ |
189 |
if CONFIG['GNU_CXX']: |
190 |
FAIL_ON_WARNINGS = True |
191 |
--- netwerk/dns/moz.build.orig 2017-11-05 12:13:54 UTC |
192 |
+++ netwerk/dns/moz.build |
193 |
@@ -68,5 +68,8 @@ LOCAL_INCLUDES += [ |
194 |
'/netwerk/base', |
195 |
] |
196 |
|
197 |
+if CONFIG['MOZ_NATIVE_HARFBUZZ']: |
198 |
+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] |
199 |
+ |
200 |
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' and CONFIG['ANDROID_VERSION'] > '19': |
201 |
CXXFLAGS += ['-I%s/bionic/libc/dns/include' % CONFIG['ANDROID_SOURCE']] |
202 |
--- toolkit/library/moz.build.orig 2017-11-05 12:13:54 UTC |
203 |
+++ toolkit/library/moz.build |
204 |
@@ -230,6 +230,12 @@ if CONFIG['MOZ_NATIVE_LIBVPX']: |
205 |
if not CONFIG['MOZ_TREE_PIXMAN']: |
206 |
OS_LIBS += CONFIG['MOZ_PIXMAN_LIBS'] |
207 |
|
208 |
+if CONFIG['MOZ_NATIVE_GRAPHITE2']: |
209 |
+ OS_LIBS += CONFIG['MOZ_GRAPHITE2_LIBS'] |
210 |
+ |
211 |
+if CONFIG['MOZ_NATIVE_HARFBUZZ']: |
212 |
+ OS_LIBS += CONFIG['MOZ_HARFBUZZ_LIBS'] |
213 |
+ |
214 |
if CONFIG['MOZ_ALSA']: |
215 |
OS_LIBS += CONFIG['MOZ_ALSA_LIBS'] |
216 |
|