From 3195bf1e75493675dc8cbd81a0f83e0b4538263b Mon Sep 17 00:00:00 2001 From: Rene Saavedra Date: Sat, 18 Jun 2016 13:37:19 -0500 Subject: [PATCH] gnu: Add fontconfig-path-max. --- gnu/packages/fontutils.scm | 3 +++ gnu/packages/patches/fontconfig-fcdefault.patch | 23 +++++++++++++++++++++++ gnu/packages/patches/fontconfig-fcstat.patch | 23 +++++++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 gnu/packages/patches/fontconfig-fcdefault.patch create mode 100644 gnu/packages/patches/fontconfig-fcstat.patch diff --git a/gnu/packages/fontutils.scm b/gnu/packages/fontutils.scm index 5f6ff15..2b84523 100644 --- a/gnu/packages/fontutils.scm +++ b/gnu/packages/fontutils.scm @@ -231,6 +231,9 @@ fonts to/from the WOFF2 format.") (uri (string-append "https://www.freedesktop.org/software/fontconfig/release/fontconfig-" version ".tar.bz2")) + (patches (list + (search-patch "fontconfig-fcdefault.patch") + (search-patch "fontconfig-fcstat.patch"))) (sha256 (base32 "1psrl4b4gi4wmbvwwh43lk491wsl8lgvqj146prlcha3vwjc0qyp")))) (build-system gnu-build-system) diff --git a/gnu/packages/patches/fontconfig-fcdefault.patch b/gnu/packages/patches/fontconfig-fcdefault.patch new file mode 100644 index 0000000..9c3b383 --- /dev/null +++ b/gnu/packages/patches/fontconfig-fcdefault.patch @@ -0,0 +1,23 @@ +This patch replaces the use of macro PATH_MAX by *buf constant, +which allows dynamic memory allocation. + +--- + src/fcdefault.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/fcdefault.c b/src/fcdefault.c +index 6647a8f..8e2094f 100644 +--- a/src/fcdefault.c ++++ b/src/fcdefault.c +@@ -150,7 +150,7 @@ retry: + # if defined (HAVE_GETEXECNAME) + const char *p = getexecname (); + # elif defined (HAVE_READLINK) +- char buf[PATH_MAX + 1]; ++ char *buf; + int len; + char *p = NULL; + +-- +2.6.3 + diff --git a/gnu/packages/patches/fontconfig-fcstat.patch b/gnu/packages/patches/fontconfig-fcstat.patch new file mode 100644 index 0000000..e075b17 --- /dev/null +++ b/gnu/packages/patches/fontconfig-fcstat.patch @@ -0,0 +1,23 @@ +This patch replaces the use of macro PATH_MAX by *f constant, +which allows dynamic memory allocation. + +--- + src/fcstat.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/fcstat.c b/src/fcstat.c +index 1734fa4..8a438eb 100644 +--- a/src/fcstat.c ++++ b/src/fcstat.c +@@ -278,7 +278,7 @@ FcDirChecksum (const FcChar8 *dir, time_t *checksum) + { + #endif + struct stat statb; +- char f[PATH_MAX + 1]; ++ char *f; + + memcpy (f, dir, len); + f[len] = FC_DIR_SEPARATOR; +-- +2.6.3 + -- 2.6.3