gtk/firefox-kde/2000_system_harfbuzz_support.patch

259 lines
7.8 KiB
Diff
Raw Normal View History

2018-05-12 20:35:39 +08:00
From: Jan Beich <jbeich@FreeBSD.org>
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
2018-09-07 22:44:44 +08:00
@@ -1228,16 +1228,23 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'andr
2018-05-12 20:35:39 +08:00
'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
2018-09-07 22:44:44 +08:00
@@ -477,16 +477,19 @@ include('/ipc/chromium/chromium-config.m
2018-05-12 20:35:39 +08:00
FINAL_LIBRARY = 'xul'
if CONFIG['MOZ_BUILD_APP'] in ['browser', 'mobile/android', 'xulrunner']:
DEFINES['HAVE_SIDEBAR'] = True
if CONFIG['MOZ_X11']:
CXXFLAGS += CONFIG['TK_CFLAGS']
+if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
+
GENERATED_FILES += [
'PropertyUseCounterMap.inc',
'UseCounterList.h',
]
countermap = GENERATED_FILES['PropertyUseCounterMap.inc']
countermap.script = 'gen-usecounters.py:property_map'
countermap.inputs = ['UseCounters.conf']
diff --git a/gfx/harfbuzz/README-mozilla b/gfx/harfbuzz/README-mozilla
--- a/gfx/harfbuzz/README-mozilla
+++ b/gfx/harfbuzz/README-mozilla
@@ -14,8 +14,13 @@ this file when updating HarfBuzz, and ch
The normal approach to updating HarfBuzz, therefore, is to pull the latest HB
source into a scratch directory and do a local build; then copy the original
sources AND the generated header mentioned above from the build directory into
the mozilla tree.
If the collection of source files changes, manual updates to moz.build may be
needed, as we don't use the upstream makefiles.
+
+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.
diff --git a/gfx/moz.build b/gfx/moz.build
--- a/gfx/moz.build
+++ b/gfx/moz.build
@@ -5,26 +5,28 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
with Files('**'):
BUG_COMPONENT = ('Core', 'Graphics')
if CONFIG['MOZ_TREE_CAIRO']:
DIRS += ['cairo']
+if not CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+ DIRS += ['harfbuzz/src']
+
DIRS += [
'2d',
'ycbcr',
'angle',
'src',
'qcms',
'gl',
'layers',
'graphite2/src',
- 'harfbuzz/src',
'ots/src',
'thebes',
'ipc',
'vr',
'config',
'webrender_bindings',
]
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
2018-09-07 22:44:44 +08:00
@@ -143,16 +143,19 @@ if CONFIG['CC_TYPE'] == 'gcc':
2018-05-12 20:35:39 +08:00
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 ('gtk3', 'android'):
CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
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
2018-09-07 22:44:44 +08:00
@@ -817,16 +817,19 @@ if CONFIG['CC_TYPE'] == 'gcc':
2018-05-12 20:35:39 +08:00
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 ('gtk3', 'android'):
CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
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
2018-09-07 22:44:44 +08:00
@@ -281,11 +281,14 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('and
2018-05-12 20:35:39 +08:00
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS']
LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES']
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
@@ -20,9 +20,12 @@ UNIFIED_SOURCES += [
'ICUUtils.cpp',
'IrishCasing.cpp',
'nsBidiUtils.cpp',
'nsSpecialCasingData.cpp',
'nsUnicharUtils.cpp',
'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
2018-09-07 22:44:44 +08:00
@@ -67,12 +67,15 @@ etld_data = GENERATED_FILES['etld_data.i
2018-05-12 20:35:39 +08:00
etld_data.script = 'prepare_tlds.py'
etld_data.inputs = ['effective_tld_names.dat']
# need to include etld_data.inc
LOCAL_INCLUDES += [
'/netwerk/base',
]
+if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
+
USE_LIBS += ['icu']
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
2018-09-07 22:44:44 +08:00
@@ -233,16 +233,19 @@ if CONFIG['SERVO_TARGET_DIR']:
2018-05-12 20:35:39 +08:00
OS_LIBS += ['-L%s' % CONFIG['SERVO_TARGET_DIR'], '-lgeckoservo']
if CONFIG['MOZ_SYSTEM_JPEG']:
OS_LIBS += CONFIG['MOZ_JPEG_LIBS']
if CONFIG['MOZ_SYSTEM_PNG']:
OS_LIBS += CONFIG['MOZ_PNG_LIBS']
+if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+ OS_LIBS += CONFIG['MOZ_HARFBUZZ_LIBS']
+
if CONFIG['MOZ_SYSTEM_LIBEVENT']:
OS_LIBS += CONFIG['MOZ_LIBEVENT_LIBS']
if CONFIG['MOZ_SYSTEM_LIBVPX']:
OS_LIBS += CONFIG['MOZ_LIBVPX_LIBS']
2018-09-07 22:44:44 +08:00
if not CONFIG['MOZ_TREE_PIXMAN']:
OS_LIBS += CONFIG['MOZ_PIXMAN_LIBS']
2018-05-12 20:35:39 +08:00
diff --git a/toolkit/moz.configure b/toolkit/moz.configure
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
2018-09-07 22:44:44 +08:00
@@ -331,16 +331,26 @@ def freetype2_combined_info(fontconfig_i
2018-05-12 20:35:39 +08:00
return namespace(
cflags=freetype2_info.cflags + fontconfig_info.cflags,
libs=freetype2_info.libs + fontconfig_info.libs,
)
add_old_configure_assignment('_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 >= 1.4.2',
+ when='--with-system-harfbuzz')
+
+set_config('MOZ_SYSTEM_HARFBUZZ', depends_if(system_harfbuzz)(lambda _: True))
+
# Apple platform decoder support
# ==============================================================
@depends(toolkit)
def applemedia(toolkit):
if toolkit in ('cocoa', 'uikit'):
return True
set_config('MOZ_APPLEMEDIA', applemedia)