src_prepare-overlay/www-client/waterfox/files/2002_system_graphite2.patch

151 lines
5.0 KiB
Diff
Raw Normal View History

--- Waterfox-56.2.4/config/Makefile.in
+++ Waterfox-56.2.4/config/Makefile.in
@@ -41,6 +41,7 @@
$(PYTHON) -m mozbuild.action.preprocessor $(DEFINES) $(ACDEFINES) \
-DMOZ_TREE_CAIRO=$(MOZ_TREE_CAIRO) \
-DMOZ_TREE_PIXMAN=$(MOZ_TREE_PIXMAN) \
+ -DMOZ_SYSTEM_GRAPHITE2=$(MOZ_SYSTEM_GRAPHITE2) \
-DMOZ_SYSTEM_HARFBUZZ=$(MOZ_SYSTEM_HARFBUZZ) \
-DMOZ_SYSTEM_HUNSPELL=$(MOZ_SYSTEM_HUNSPELL) \
-DMOZ_SYSTEM_BZ2=$(MOZ_SYSTEM_BZ2) \
--- Waterfox-56.2.4/config/system-headers
+++ Waterfox-56.2.4/config/system-headers
@@ -1274,6 +1274,10 @@
libsn/sn-monitor.h
libsn/sn-util.h
#endif
+#if MOZ_SYSTEM_GRAPHITE2==1
+graphite2/Font.h
+graphite2/Segment.h
+#endif
#if MOZ_SYSTEM_HARFBUZZ==1
harfbuzz/hb-glib.h
harfbuzz/hb-ot.h
--- Waterfox-56.2.4/gfx/graphite2/moz-gr-update.sh
+++ Waterfox-56.2.4/gfx/graphite2/moz-gr-update.sh
@@ -1,6 +1,7 @@
#!/bin/bash
# Script used to update the Graphite2 library in the mozilla source tree
+# and bump version for --with-system-graphite2
# This script lives in gfx/graphite2, along with the library source,
# but must be run from the top level of the mozilla-central tree.
@@ -37,12 +38,16 @@
#find gfx/graphite2/ -name "*.cpp" -exec perl -p -i -e "s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
#find gfx/graphite2/ -name "*.h" -exec perl -p -i -e "s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
+# chase version for --with-system-graphite2
+perl -p -i -e "s/[0-9]+\,[0-9]+\,[0-9]+/$RELEASE/ and tr/./,/ \
+ if /GR2_VERSION_REQUIRE/" old-configure.in
+
# summarize what's been touched
echo Updated to $RELEASE.
echo Here is what changed in the gfx/graphite2 directory:
echo
-hg stat gfx/graphite2
+hg stat old-configure.in gfx/graphite2
echo
echo If gfx/graphite2/src/files.mk has changed, please make corresponding
--- Waterfox-56.2.4/gfx/moz.build
+++ Waterfox-56.2.4/gfx/moz.build
@@ -10,6 +10,9 @@
if CONFIG['MOZ_TREE_CAIRO']:
DIRS += ['cairo']
+if not CONFIG['MOZ_SYSTEM_GRAPHITE2']:
+ DIRS += ['graphite2/src' ]
+
if not CONFIG['MOZ_SYSTEM_HARFBUZZ']:
DIRS += ['harfbuzz/src']
@@ -21,7 +24,6 @@
'qcms',
'gl',
'layers',
- 'graphite2/src',
'ots/src',
'thebes',
'ipc',
--- Waterfox-56.2.4/gfx/thebes/moz.build
+++ Waterfox-56.2.4/gfx/thebes/moz.build
@@ -271,7 +271,10 @@
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']
--- Waterfox-56.2.4/old-configure.in
+++ Waterfox-56.2.4/old-configure.in
@@ -4376,6 +4376,27 @@
fi
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,8)
+ #error "Insufficient graphite2 version."
+ #endif
+ ], [],
+ [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])])
+ CFLAGS=$_SAVE_CFLAGS
+fi
+
+dnl ========================================================
dnl Check if we need the 32-bit Linux SSE2 error dialog
dnl ========================================================
--- Waterfox-56.2.4/toolkit/library/moz.build
+++ Waterfox-56.2.4/toolkit/library/moz.build
@@ -212,6 +212,9 @@
if CONFIG['MOZ_SYSTEM_PNG']:
OS_LIBS += CONFIG['MOZ_PNG_LIBS']
+if CONFIG['MOZ_SYSTEM_GRAPHITE2']:
+ OS_LIBS += CONFIG['MOZ_GRAPHITE2_LIBS']
+
if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
OS_LIBS += CONFIG['MOZ_HARFBUZZ_LIBS']
--- Waterfox-56.2.4/toolkit/moz.configure
+++ Waterfox-56.2.4/toolkit/moz.configure
@@ -314,6 +314,20 @@
add_old_configure_assignment('_HAVE_FREETYPE2',
depends_if(freetype2_info)(lambda _: True))
+# Graphite2
+# ==============================================================
+option('--with-system-graphite2',
+ help="Use system graphite2 (located with pkgconfig)")
+
+@depends('--with-system-graphite2')
+def check_for_graphite2(value):
+ return bool(value)
+
+system_graphite2 = pkg_check_modules('MOZ_GRAPHITE2', 'graphite2',
+ when=check_for_graphite2)
+
+set_config('MOZ_SYSTEM_GRAPHITE2', depends_if(system_graphite2)(lambda _: True))
+
# HarfBuzz
# ==============================================================
option('--with-system-harfbuzz',