Title: [216184] trunk/Tools
Revision
216184
Author
commit-qu...@webkit.org
Date
2017-05-04 07:30:41 -0700 (Thu, 04 May 2017)

Log Message

[GTK] Fontconfig 2.11.2 in JHBuild does not build with glibc 2.25+ or gperf 3.1+
https://bugs.webkit.org/show_bug.cgi?id=171649

Patch by Adrian Perez de Castro <ape...@igalia.com> on 2017-05-04
Reviewed by Carlos Garcia Campos.

Add two patches picked from the upstream repository to fix building of
the Fontconfig module in JHBuild. Additionally, this needed a patch to
add "autogen.sh" as it is not included in release tarballs. Also:
building the module with srcdir!=builddir prevents "fcobjshash.gperf"
being regenerated (which is needed) so this is disabled for the
Fontconfig module.

* gtk/jhbuild.modules:
* gtk/patches/fontconfig-2.11.1-add-autogen.patch: Added.
* gtk/patches/fontconfig-Avoid-conflicts-with-integer-width-macros-from-TS-18661-1-2014.patch: Added.
* gtk/patches/fontconfig-Fix-the-build-issue-with-gperf-3.1.patch: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/Tools/ChangeLog (216183 => 216184)


--- trunk/Tools/ChangeLog	2017-05-04 12:56:54 UTC (rev 216183)
+++ trunk/Tools/ChangeLog	2017-05-04 14:30:41 UTC (rev 216184)
@@ -1,3 +1,22 @@
+2017-05-04  Adrian Perez de Castro  <ape...@igalia.com>
+
+        [GTK] Fontconfig 2.11.2 in JHBuild does not build with glibc 2.25+ or gperf 3.1+
+        https://bugs.webkit.org/show_bug.cgi?id=171649
+
+        Reviewed by Carlos Garcia Campos.
+
+        Add two patches picked from the upstream repository to fix building of
+        the Fontconfig module in JHBuild. Additionally, this needed a patch to
+        add "autogen.sh" as it is not included in release tarballs. Also:
+        building the module with srcdir!=builddir prevents "fcobjshash.gperf"
+        being regenerated (which is needed) so this is disabled for the
+        Fontconfig module.
+
+        * gtk/jhbuild.modules:
+        * gtk/patches/fontconfig-2.11.1-add-autogen.patch: Added.
+        * gtk/patches/fontconfig-Avoid-conflicts-with-integer-width-macros-from-TS-18661-1-2014.patch: Added.
+        * gtk/patches/fontconfig-Fix-the-build-issue-with-gperf-3.1.patch: Added.
+
 2017-05-04  Commit Queue  <commit-qu...@webkit.org>
 
         Unreviewed, rolling out r216172.

Modified: trunk/Tools/gtk/jhbuild.modules (216183 => 216184)


--- trunk/Tools/gtk/jhbuild.modules	2017-05-04 12:56:54 UTC (rev 216183)
+++ trunk/Tools/gtk/jhbuild.modules	2017-05-04 14:30:41 UTC (rev 216184)
@@ -254,9 +254,9 @@
     </branch>
   </autotools>
 
-  <autotools id="fontconfig" 
-             autogen-sh="configure"
-             autogenargs="--enable-libxml2">
+  <autotools id="fontconfig"
+             autogenargs="--enable-libxml2"
+             supports-non-srcdir-builds="no">
     <if condition-set="macos">
       <autogenargs value="--with-add-fonts=/System/Library/Fonts,/Library/Fonts,~/Library/Fonts"/>
     </if>
@@ -269,6 +269,16 @@
             hash="sha256:b6b066c7dce3f436fdc0dfbae9d36122b38094f4f53bd8dffd45e195b0540d8d"
             md5sum="e75e303b4f7756c2b16203a57ac87eba">
       <patch file="fontconfig-fix-osx-cache.diff" strip="1"/>
+
+      <!-- These will be in the next release after 2.12.1
+           https://cgit.freedesktop.org/fontconfig/commit/?id=1ab5258f7c2abfafcd63a760ca08bf93591912da
+           https://cgit.freedesktop.org/fontconfig/commit/?id=9878b306f6c673d3d6cd9db487f67eb426cc03df -->
+      <patch file="fontconfig-Avoid-conflicts-with-integer-width-macros-from-TS-18661-1-2014.patch" strip="1"/>
+      <patch file="fontconfig-Fix-the-build-issue-with-gperf-3.1.patch" strip="1"/>
+
+      <!-- The previous patch modifies "configure.ac", and tarballs don't
+           include the "autogen.sh" script, so let's re-add it here. -->
+      <patch file="fontconfig-2.11.1-add-autogen.patch" strip="0"/>
     </branch>
   </autotools>
 

Added: trunk/Tools/gtk/patches/fontconfig-2.11.1-add-autogen.patch (0 => 216184)


--- trunk/Tools/gtk/patches/fontconfig-2.11.1-add-autogen.patch	                        (rev 0)
+++ trunk/Tools/gtk/patches/fontconfig-2.11.1-add-autogen.patch	2017-05-04 14:30:41 UTC (rev 216184)
@@ -0,0 +1,158 @@
+--- /dev/null	2017-05-03 11:22:57.496684165 +0300
++++ autogen.sh	2017-05-04 15:13:08.100696670 +0300
+@@ -0,0 +1,155 @@
++#!/bin/sh
++# fontconfig/autogen.sh
++#
++# Copyright © 2000 Keith Packard
++#
++# Permission to use, copy, modify, distribute, and sell this software and its
++# documentation for any purpose is hereby granted without fee, provided that
++# the above copyright notice appear in all copies and that both that
++# copyright notice and this permission notice appear in supporting
++# documentation, and that the name of the author(s) not be used in
++# advertising or publicity pertaining to distribution of the software without
++# specific, written prior permission.  The authors make no
++# representations about the suitability of this software for any purpose.  It
++# is provided "as is" without express or implied warranty.
++#
++# THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
++# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
++# EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
++# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
++# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
++# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
++# PERFORMANCE OF THIS SOFTWARE.
++
++# Run this to generate all the initial makefiles, etc.
++
++set -e
++
++srcdir=`dirname $0`
++test -z "$srcdir" && srcdir=.
++
++case "$1" in
++--noconf*) 
++    	AUTOGEN_SUBDIR_MODE="true"
++	shift
++	;;
++esac
++
++ORIGDIR=`pwd`
++cd $srcdir
++PROJECT=Fontconfig
++TEST_TYPE=-f
++FILE=fontconfig/fontconfig.h
++ACLOCAL=${ACLOCAL-aclocal}
++ACLOCAL_FLAGS="-I m4"
++LIBTOOLIZE=${LIBTOOLIZE-libtoolize}
++AUTOMAKE=${AUTOMAKE-automake}
++AUTOHEADER=${AUTOHEADER-autoheader}
++AUTOCONF=${AUTOCONF-autoconf}
++GPERF=${GPERF-gperf}
++LIBTOOLIZE_FLAGS="--copy --force"
++
++DIE=0
++
++($GPERF --version) < /dev/null > /dev/null 2>&1 || {
++	echo
++	echo "You must have gperf installed to compile $PROJECT."
++	echo "Install the appropriate package for your distribution."
++	echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
++	DIE=1
++}
++
++have_libtool=false
++if $LIBTOOLIZE --version < /dev/null > /dev/null 2>&1 ; then
++	libtool_version=`$LIBTOOLIZE --version | sed 's/^.* \([0-9][.][0-9.]*\)[^ ]*$/\1/'`
++	case $libtool_version in
++	    1.4*|1.5*|1.6*|1.7*|2*)
++		have_libtool=true
++		;;
++	esac
++fi
++if $have_libtool ; then : ; else
++	echo
++	echo "You must have libtool 1.4 installed to compile $PROJECT."
++	echo "Install the appropriate package for your distribution,"
++	echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
++	DIE=1
++fi
++
++($AUTOCONF --version) < /dev/null > /dev/null 2>&1 || {
++	echo
++	echo "You must have autoconf installed to compile $PROJECT."
++	echo "libtool the appropriate package for your distribution,"
++	echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
++	DIE=1
++}
++
++have_automake=false
++need_libtoolize=true
++if $AUTOMAKE --version < /dev/null > /dev/null 2>&1 ; then
++	automake_version=`$AUTOMAKE --version | grep 'automake (GNU automake)' | sed 's/^[^0-9]*\(.*\)/\1/'`
++	case $automake_version in
++	   1.2*|1.3*|1.4) 
++		;;
++	   1.4*)
++	   	have_automake=true
++	        need_libtoolize=false
++		;;
++	   *)
++		have_automake=true
++		;;
++	esac
++fi
++if $have_automake ; then : ; else
++	echo
++	echo "You must have automake 1.4-p1 installed to compile $PROJECT."
++	echo "Get ftp://ftp.gnu.org/pub/gnu/automake/automake-1.4-p1.tar.gz"
++	echo "(or a newer version if it is available)"
++	DIE=1
++fi
++
++if test "$DIE" -eq 1; then
++	exit 1
++fi
++
++test $TEST_TYPE $FILE || {
++	echo "You must run this script in the top-level $PROJECT directory"
++	exit 1
++}
++
++if test -z "$AUTOGEN_SUBDIR_MODE" -a -z "$NOCONFIGURE"; then
++        if test -z "$*"; then
++                echo "I am going to run ./configure with no arguments - if you wish "
++                echo "to pass any to it, please specify them on the $0 command line."
++        fi
++fi
++
++echo Running $ACLOCAL $ACLOCAL_FLAGS
++$ACLOCAL $ACLOCAL_FLAGS
++
++# optionally run autoheader
++if $AUTOHEADER --version  < /dev/null > /dev/null 2>&1; then
++	echo Running $AUTOHEADER
++	$AUTOHEADER
++fi
++
++case $need_libtoolize in
++   true)
++   	echo Running $LIBTOOLIZE $LIBTOOLIZE_FLAGS
++   	$LIBTOOLIZE $LIBTOOLIZE_FLAGS
++	;;
++esac
++
++echo Running $AUTOMAKE -a $am_opt
++$AUTOMAKE -a $am_opt
++echo Running $AUTOCONF
++$AUTOCONF
++cd $ORIGDIR
++
++if test -z "$AUTOGEN_SUBDIR_MODE" -a -z "$NOCONFIGURE"; then
++	echo Running $srcdir/configure "$@"
++        $srcdir/configure "$@"
++
++        echo 
++        echo "Now type 'make' to compile $PROJECT."
++fi

Added: trunk/Tools/gtk/patches/fontconfig-Avoid-conflicts-with-integer-width-macros-from-TS-18661-1-2014.patch (0 => 216184)


--- trunk/Tools/gtk/patches/fontconfig-Avoid-conflicts-with-integer-width-macros-from-TS-18661-1-2014.patch	                        (rev 0)
+++ trunk/Tools/gtk/patches/fontconfig-Avoid-conflicts-with-integer-width-macros-from-TS-18661-1-2014.patch	2017-05-04 14:30:41 UTC (rev 216184)
@@ -0,0 +1,40 @@
+commit 1ab5258f7c2abfafcd63a760ca08bf93591912da
+Author: Khem Raj <raj.k...@gmail.com>
+Date:   Wed Dec 14 16:11:05 2016 -0800
+
+    Avoid conflicts with integer width macros from TS 18661-1:2014
+    
+    glibc 2.25+ has now defined these macros in <limits.h>
+    https://sourceware.org/git/?p=glibc.git;a=commit;h=5b17fd0da62bf923cb61d1bb7b08cf2e1f1f9c1a
+    
+    Create an alias for FC_CHAR_WIDTH for ABI compatibility
+    
+    Signed-off-by: Khem Raj <raj.k...@gmail.com>
+
+diff --git a/fontconfig/fontconfig.h b/fontconfig/fontconfig.h
+index 5c72b22..070a557 100644
+--- a/fontconfig/fontconfig.h
++++ b/fontconfig/fontconfig.h
+@@ -128,7 +128,8 @@ typedef int		FcBool;
+ #define FC_USER_CACHE_FILE	    ".fonts.cache-" FC_CACHE_VERSION
+ 
+ /* Adjust outline rasterizer */
+-#define FC_CHAR_WIDTH	    "charwidth"	/* Int */
++#define FC_CHARWIDTH	    "charwidth"	/* Int */
++#define FC_CHAR_WIDTH	    FC_CHARWIDTH
+ #define FC_CHAR_HEIGHT	    "charheight"/* Int */
+ #define FC_MATRIX	    "matrix"    /* FcMatrix */
+ 
+diff --git a/src/fcobjs.h b/src/fcobjs.h
+index 1fc4f65..d27864b 100644
+--- a/src/fcobjs.h
++++ b/src/fcobjs.h
+@@ -51,7 +51,7 @@ FC_OBJECT (DPI,			FcTypeDouble,	NULL)
+ FC_OBJECT (RGBA,		FcTypeInteger,	NULL)
+ FC_OBJECT (SCALE,		FcTypeDouble,	NULL)
+ FC_OBJECT (MINSPACE,		FcTypeBool,	NULL)
+-FC_OBJECT (CHAR_WIDTH,		FcTypeInteger,	NULL)
++FC_OBJECT (CHARWIDTH,		FcTypeInteger,	NULL)
+ FC_OBJECT (CHAR_HEIGHT,		FcTypeInteger,	NULL)
+ FC_OBJECT (MATRIX,		FcTypeMatrix,	NULL)
+ FC_OBJECT (CHARSET,		FcTypeCharSet,	FcCompareCharSet)

Added: trunk/Tools/gtk/patches/fontconfig-Fix-the-build-issue-with-gperf-3.1.patch (0 => 216184)


--- trunk/Tools/gtk/patches/fontconfig-Fix-the-build-issue-with-gperf-3.1.patch	                        (rev 0)
+++ trunk/Tools/gtk/patches/fontconfig-Fix-the-build-issue-with-gperf-3.1.patch	2017-05-04 14:30:41 UTC (rev 216184)
@@ -0,0 +1,59 @@
+commit 9878b306f6c673d3d6cd9db487f67eb426cc03df
+Author: Akira TAGOH <ak...@tagoh.org>
+Date:   Thu Feb 23 21:39:10 2017 +0900
+
+    Fix the build issue with gperf 3.1
+    
+    To support the one of changes in gperf 3.1:
+    * The 'len' parameter of the hash function and of the lookup function is now
+      of type 'size_t' instead of 'unsigned int'. This makes it safe to call these
+      functions with strings of length > 4 GB, on 64-bit machines.
+
+diff --git a/configure.ac b/configure.ac
+index 4948816..8fbf3d3 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -193,6 +193,26 @@ fi
+ AC_CHECK_MEMBERS([struct dirent.d_type],,,
+ 	[#include <dirent.h>])
+ 
++# Check the argument type of the gperf hash/lookup function
++AC_MSG_CHECKING([The type of len parameter of gperf hash/lookup function])
++fc_gperf_test="$(echo 'foo' | gperf -L ANSI-C)"
++AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
++	#include <string.h>
++
++	const char *in_word_set(register const char *, register size_t);
++	$fc_gperf_test
++	]])], [FC_GPERF_SIZE_T=size_t],
++	[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
++		#include <string.h>
++
++		const char *in_word_set(register const char *, register unsigned int);
++		$fc_gperf_test
++	]])], [FC_GPERF_SIZE_T="unsigned int"],
++	[AC_MSG_ERROR([Unable to determine the type of the len parameter of the gperf hash/lookup function])]
++)])
++AC_DEFINE_UNQUOTED(FC_GPERF_SIZE_T, $FC_GPERF_SIZE_T, [The type of len parameter of the gperf hash/lookup function])
++AC_MSG_RESULT($FC_GPERF_SIZE_T)
++
+ #
+ # Checks for iconv
+ #
+diff --git a/src/fcobjs.c b/src/fcobjs.c
+index 16ff31c..33bba8d 100644
+--- a/src/fcobjs.c
++++ b/src/fcobjs.c
+@@ -25,10 +25,10 @@
+ #include "fcint.h"
+ 
+ static unsigned int
+-FcObjectTypeHash (register const char *str, register unsigned int len);
++FcObjectTypeHash (register const char *str, register FC_GPERF_SIZE_T len);
+ 
+ static const struct FcObjectTypeInfo *
+-FcObjectTypeLookup (register const char *str, register unsigned int len);
++FcObjectTypeLookup (register const char *str, register FC_GPERF_SIZE_T len);
+ 
+ #include "fcobjshash.h"
+ 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to