From b9d2def69e47917159d1d98fd59525144b19741f Mon Sep 17 00:00:00 2001 From: Pavel Vinogradov Date: Tue, 7 Mar 2017 15:29:22 -0500 Subject: x11-libs/fontconfig: applied upstream fixes for building with glibc 2.25 and gperf 3.1 --- x11-libs/fontconfig/DEPENDS | 2 + x11-libs/fontconfig/HISTORY | 5 +++ x11-libs/fontconfig/PRE_BUILD | 5 +++ x11-libs/fontconfig/patches/glibc-2.25.patch | 42 +++++++++++++++++++ x11-libs/fontconfig/patches/gperf.patch | 61 ++++++++++++++++++++++++++++ 5 files changed, 115 insertions(+) create mode 100755 x11-libs/fontconfig/PRE_BUILD create mode 100644 x11-libs/fontconfig/patches/glibc-2.25.patch create mode 100644 x11-libs/fontconfig/patches/gperf.patch (limited to 'x11-libs') diff --git a/x11-libs/fontconfig/DEPENDS b/x11-libs/fontconfig/DEPENDS index 8d680c0470..df3de4a730 100755 --- a/x11-libs/fontconfig/DEPENDS +++ b/x11-libs/fontconfig/DEPENDS @@ -1,3 +1,5 @@ +depends autoconf && +depends gperf && depends pkgconfig && depends freetype2 && depends automake && diff --git a/x11-libs/fontconfig/HISTORY b/x11-libs/fontconfig/HISTORY index 58004fa68c..a5290e2490 100644 --- a/x11-libs/fontconfig/HISTORY +++ b/x11-libs/fontconfig/HISTORY @@ -1,3 +1,8 @@ +2017-03-07 Pavel Vinogradov + * DEPENDS: added autoconf and gperf + * PRE_BUILD, patches/glibc-2.25.patch, patches/gperf.patch: added + upstream patches to fix building with glibc 2.25 and gperf 3.1 + 2017-01-15 Vlad Glagolev * DEPENDS: added external optional from freetype2 diff --git a/x11-libs/fontconfig/PRE_BUILD b/x11-libs/fontconfig/PRE_BUILD new file mode 100755 index 0000000000..3d5637bb04 --- /dev/null +++ b/x11-libs/fontconfig/PRE_BUILD @@ -0,0 +1,5 @@ +default_pre_build && +cd ${SOURCE_DIRECTORY} && + +apply_patch_dir patches && +autoreconf -f -i --symlink diff --git a/x11-libs/fontconfig/patches/glibc-2.25.patch b/x11-libs/fontconfig/patches/glibc-2.25.patch new file mode 100644 index 0000000000..639c292878 --- /dev/null +++ b/x11-libs/fontconfig/patches/glibc-2.25.patch @@ -0,0 +1,42 @@ +From 1ab5258f7c2abfafcd63a760ca08bf93591912da Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 14 Dec 2016 16:11:05 -0800 +Subject: Avoid conflicts with integer width macros from TS 18661-1:2014 + +glibc 2.25+ has now defined these macros in +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 + +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) +-- +cgit v0.10.2 + diff --git a/x11-libs/fontconfig/patches/gperf.patch b/x11-libs/fontconfig/patches/gperf.patch new file mode 100644 index 0000000000..ce90c450b3 --- /dev/null +++ b/x11-libs/fontconfig/patches/gperf.patch @@ -0,0 +1,61 @@ +From 9878b306f6c673d3d6cd9db487f67eb426cc03df Mon Sep 17 00:00:00 2001 +From: Akira TAGOH +Date: Thu, 23 Feb 2017 21:39:10 +0900 +Subject: 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 ]) + ++# 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 ++ ++ 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 ++ ++ 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" + +-- +cgit v0.10.2 + -- cgit v1.2.3