Fix FTBFS (#1423570)
This commit is contained in:
parent
073a4b048f
commit
6742b0b9a6
65
fontconfig-gperf-3.1.patch
Normal file
65
fontconfig-gperf-3.1.patch
Normal file
@ -0,0 +1,65 @@
|
||||
From 9878b306f6c673d3d6cd9db487f67eb426cc03df Mon Sep 17 00:00:00 2001
|
||||
From: Akira TAGOH <akira@tagoh.org>
|
||||
Date: Thu, 23 Feb 2017 21:39:10 +0900
|
||||
Subject: [PATCH] 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.
|
||||
---
|
||||
configure.ac | 20 ++++++++++++++++++++
|
||||
src/fcobjs.c | 4 ++--
|
||||
2 files changed, 22 insertions(+), 2 deletions(-)
|
||||
|
||||
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"
|
||||
|
||||
--
|
||||
2.9.3
|
||||
|
@ -16,6 +16,7 @@ Source1: 25-no-bitmap-fedora.conf
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=140335
|
||||
Patch0: %{name}-sleep-less.patch
|
||||
Patch1: %{name}-glibc-limits.patch
|
||||
Patch2: %{name}-gperf-3.1.patch
|
||||
|
||||
BuildRequires: expat-devel
|
||||
BuildRequires: freetype-devel >= %{freetype_version}
|
||||
@ -61,11 +62,13 @@ which is useful for developing applications that uses fontconfig.
|
||||
%setup -q
|
||||
%patch0 -p1 -b .sleep-less
|
||||
%patch1 -p1 -b .glibc-limits
|
||||
%patch2 -p1 -b .gperf
|
||||
|
||||
%build
|
||||
# We don't want to rebuild the docs, but we want to install the included ones.
|
||||
export HASDOCBOOK=no
|
||||
|
||||
autoreconf
|
||||
%configure --with-add-fonts=/usr/share/X11/fonts/Type1,/usr/share/X11/fonts/TTF,/usr/local/share/fonts \
|
||||
--disable-static
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user