Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Apr 2013 18:56:03 -0400
From:      Russell Auld <russauld@gmail.com>
To:        gnome@FreeBSD.org
Subject:   FreeBSD Port: graphics/gegl
Message-ID:  <CADUtPN9Kz%2Bu7e1CD1NGKGgpn52cSjpZs=YpwS6R5X-2SZtBKXg@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi,
I've been having some trouble building the gegl_0.2.0_2 port on my system
(FreeBSD 8.0 i386).
It was seg faulting when it tried to build the graphics files from xml in
"/usr/ports/graphics/gegl/work/gegl-0.2.0/docs/gallery/"
The expected result is "gegl -i OpenRaster-00.xml" should not crash.
I did some digging and it turns out to be a problem with the "realpath"
function call in bin/gegl.c
Around line 119, you should see this:

path_root = g_strdup (tmp = realpath (temp2, NULL));

That works fine on Linux, as the second argument is allowed to be NULL.
However on FreeBSD, the second argument cannot be NULL and is expected to
be a buffer capable of storing the resulting path. [see below]
So, declaring "gchar abs_path[PATH_MAX]" and then changing the call to:
path_root = g_strdup (tmp = realpath (temp2, abs_path));
Fixes the crash problem (as long as you also comment out the g_free(tmp)
line afterwards).

This problem also occurs in gegl/gegl-xml.c

My system is 32-bit FreeBSD 8.0:
FreeBSD xxx 8.0-RELEASE FreeBSD 8.0-RELEASE #0: Sat Nov 21 15:48:17 UTC
2009     root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386

See here for linux manpage:
http://man7.org/linux/man-pages/man3/realpath.3.html

versus:
The [second] argument must refer to a buffer capable of storing at least
     PATH_MAX characters.
from my system, "man 3 realpath".
It looks like that changed in version 8.1 to allow NULL as the second
argument.
http://www.freebsd.org/cgi/man.cgi?query=realpath&apropos=0&sektion=3&manpath=FreeBSD+8.1-RELEASE&arch=default&format=html
vs
http://www.freebsd.org/cgi/man.cgi?query=realpath&apropos=0&sektion=3&manpath=FreeBSD+8.0-RELEASE&arch=default&format=html

Once I fixed the code, it was able to complete the tests and install.
HOWEVER, I never got a "gegl.pc" file dropped into
/usr/local/libdata/pkgconfig" despite the fact that "pkg_info -L
gegl-0.2.0_2" shows that file as part of the manifest.
This missing pkgconfig file is preventing me from building gimp.


Thoughts?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CADUtPN9Kz%2Bu7e1CD1NGKGgpn52cSjpZs=YpwS6R5X-2SZtBKXg>