After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 635038 - Fails to build on GNU/Hurd
Fails to build on GNU/Hurd
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
2.6.11
Other GNU Hurd
: Normal normal
: 2.8
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2010-11-17 02:12 UTC by Ari Pollak
Modified: 2011-03-21 22:41 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ari Pollak 2010-11-17 02:12:05 UTC
From http://bugs.debian.org/601906:


gimp FTBFS on Debian GNU/Hurd, because one of its plugins uses the PATH_MAX constant unconditionnally. PATH_MAX is optional in POSIX and undefined on GNU/Hurd, as there is no global limit to path sizes.

Here is a very simple patch to fix the problem. A better solution would be to use dynamic allocation instead of fixed-size buffers, but that would require a much larger patch.


diff -Nurp gimp-2.6.11.orig/plug-ins/common/qbist.c gimp-2.6.11/plug-ins/common/qbist.c
--- gimp-2.6.11.orig/plug-ins/common/qbist.c	2010-07-03 00:51:56.000000000 +0200
+++ gimp-2.6.11/plug-ins/common/qbist.c	2010-10-31 01:08:03.764667339 +0200
@@ -41,8 +41,14 @@
 
 #include "libgimp/stdplugins-intl.h"
 
-#if ! defined PATH_MAX && defined _MAX_PATH
-#  define PATH_MAX _MAX_PATH
+#if ! defined PATH_MAX
+#  if defined _MAX_PATH
+#    define PATH_MAX _MAX_PATH
+#  elif defined MAXPATHLEN
+#    define PATH_MAX MAXPATHLEN
+#  else
+#    define PATH_MAX 1024
+#  endif
 #endif
 
 /** qbist renderer ***********************************************************/
Comment 1 Martin Nordholts 2010-11-17 07:06:04 UTC
Ew. I would much rather see this fixed by handling any path size using GLib stuff like GString.
Comment 2 Michael Natterer 2010-11-24 23:00:59 UTC
Ari, you can simply push whatever it takes (and is correct of course)
to fix the build for 2.6. What Martin said applies to master of course.
Comment 3 Martin Nordholts 2011-03-15 06:15:13 UTC
No point in having this on the 2.6 milestone without a patch attached
Comment 4 Michael Natterer 2011-03-18 00:28:16 UTC
But it's a real build failure that should be fixed at least in 2.8,
and I have no problem to take the quick fix from the initial comment.
Comment 5 Michael Natterer 2011-03-21 22:41:55 UTC
What the heck, it's just a plugin, applied the proposed patch:

commit 28aa26fb281d3d4c0bb5b674fb10ca901bf81071
Author: Michael Natterer <mitch@gimp.org>
Date:   Mon Mar 21 23:40:05 2011 +0100

    Bug 635038 - Fails to build on GNU/Hurd
    
    Apply patch from Ari Pollak that tries harder to get a value for
    PATH_MAX.

 plug-ins/common/qbist.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)