unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: rennes@openmailbox.org
To: guix-devel@gnu.org
Subject: [PATCH] gnu: Add fontconfig-path-max.
Date: Sat, 18 Jun 2016 14:02:51 -0500	[thread overview]
Message-ID: <7b313a7566d04932f94fb33e7a63c222@openmailbox.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 636 bytes --]

Hello Guix team,

i'm doing tests whith GNU Guix on GNU Hurd, compiling fontconfig and 
there is an error during compilation:

a) fontconfig uses the constant PATH_MAX.

Reviewing the documentation about the treatment of constant for Hurd; 
i've attached a patch for review.

References:
https://www.gnu.org/software/hurd/community/gsoc/project_ideas/maxpath.html
https://www.gnu.org/software/hurd/hurd/porting/guidelines.html

and i've a couple of questions about:

a) How Guix identify if it is a Linux or Hurd system at compile or 
install the package?.
b) i searches in ML an example, but i not found.



Thanks for your time.

Rene

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-fontconfig-path-max.patch --]
[-- Type: text/x-diff; name=0001-gnu-Add-fontconfig-path-max.patch, Size: 2808 bytes --]

From 3195bf1e75493675dc8cbd81a0f83e0b4538263b Mon Sep 17 00:00:00 2001
From: Rene Saavedra <rennes@openmailbox.org>
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


             reply	other threads:[~2016-06-18 19:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-18 19:02 rennes [this message]
2016-07-03 22:24 ` [PATCH] gnu: Add fontconfig-path-max Manolis Ragkousis
2016-07-04  4:02   ` rennes
2016-07-04  7:55     ` Manolis Ragkousis
2016-07-05  1:46       ` rennes
2016-07-04  8:16 ` Ludovic Courtès
2016-07-04  8:21 ` Ludovic Courtès
2016-07-05  1:26   ` rennes
2016-07-05  8:51     ` Ludovic Courtès
2016-07-12 14:08       ` rennes
2016-07-12 14:25         ` rennes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7b313a7566d04932f94fb33e7a63c222@openmailbox.org \
    --to=rennes@openmailbox.org \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).