Subject: pkg/36590: [patch] sysutils/gnome-vfs2 sets defines never seen by the compiler
To: None <,,>
From: None <>
List: pkgsrc-bugs
Date: 07/01/2007 21:25:00
>Number:         36590
>Category:       pkg
>Synopsis:       [patch] sysutils/gnome-vfs2 sets defines never seen by the compiler
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jul 01 21:25:00 +0000 2007
>Originator:     Idar Tollefsen
>Release:        gnome-vfs2-2.18.1nb2
Performance Design
Darwin 8.10.0 Darwin Kernel Version 8.10.0: Wed May 23 16:50:59 PDT 2007; root:xnu-792.21.3~1/RELEASE_PPC Power Macintosh powerpc
sysutils/gnome-vfs2 sets several defines and build options in Makefile.common and Makefile that's never seen by the compiler during build. The end result is that the build fails because it doesn't know what PREFIX is;

gcc -DHAVE_CONFIG_H -I. -I.. -D_REENTRANT -DORBIT2=1 -I/usr/pkg/pkgsrc/sysutils/gnome-vfs2/work/.buildlink/include/glib/glib-2.0 -I/usr/pkg/pkgsrc/sysutils/gnome-vfs2/work/.buildlink/lib/glib-2.0/include -I/usr/pkg/pkgsrc/sysutils/gnome-vfs2/work/.buildlink/include/gconf/2 -I/usr/pkg/pkgsrc/sysutils/gnome-vfs2/work/.buildlink/include/orbit-2.0 -I/usr/pkg/pkgsrc/sysutils/gnome-vfs2/work/.buildlink/include/libxml2 -I/usr/pkg/pkgsrc/sysutils/gnome-vfs2/work/.buildlink/include/dbus-1.0 -I/usr/pkg/pkgsrc/sysutils/gnome-vfs2/work/.buildlink/lib/dbus-1.0/include -I/usr/pkg/pkgsrc/sysutils/gnome-vfs2/work/.buildlink/include -DXDG_PREFIX=_gnome_vfs_xdg -DDBUS_API_SUBJECT_TO_CHANGE -D_FILE_OFFSET_BITS=64 -D_BSD_SOURCE -D_LARGEFILE64_SOURCE -D_POSIX_PTHREAD_SEMANTICS -DG_DISABLE_DEPRECATED -DGNOME_VFS_PREFIX=\"/usr/pkg\" -DGNOME_VFS_BINDIR=\"/usr/pkg/bin\" -DGNOME_VFS_DATADIR=\"/usr/pkg/share\" -DGNOME_VFS_LIBDIR=\"/usr/pkg/lib\" -DGNOME_VFS_LOCALEDIR=\"/usr/pkg/share/locale\" -DGNOME_V
 FS_SYSCONFDIR=\"/usr/pkg/etc\" -DG_LOG_DOMAIN=\"libgnomevfs\" -DNDEBUG -O2 -no-cpp-precomp -no-cpp-precomp -O2 -MT xdgmime.lo -MD -MP -MF .deps/xdgmime.Tpo -c xdgmime.c  -fno-common -DPIC -o .libs/xdgmime.o
In file included from xdgmime.c:32:
xdgmime.h:103:1: warning: "_xdg_mime_mime_type_equal" redefined
xdgmime.h:55:1: warning: this is the location of the previous definition
xdgmime.h:108:1: warning: "_xdg_mime_mime_type_subclass" redefined
xdgmime.h:58:1: warning: this is the location of the previous definition
xdgmime.h:111:1: warning: "_xdg_mime_unalias_mime_type" redefined
xdgmime.h:62:1: warning: this is the location of the previous definition
xdgmime.c: In function 'xdg_run_command_on_dirs':
xdgmime.c:239: error: 'PREFIX' undeclared (first use in this function)
xdgmime.c:239: error: (Each undeclared identifier is reported only once
xdgmime.c:239: error: for each function it appears in.)
xdgmime.c:239: error: parse error before string constant
gnumake[3]: *** [xdgmime.lo] Error 1
gnumake[2]: *** [all] Error 2
gnumake[1]: *** [all-recursive] Error 1
gnumake: *** [all] Error 2
*** Error code 2

This is because mk.conf sets CPPFLAGS with "=", not "+=" and sysutils/gnome-vfs2/Makefile.common includes after settings the necessary flags. It's common to use "=" instead of "+=" in mk.conf to override default values.
Use a custom mk.conf where CPPFLAGS is set with "=", not "+="; then try to build sysutils/gnome-vfs2.

Move the inclusion of up in Makefile.common before CPPFLAGS is set. Move the inclusion of Makefile.common up in Makefile before settings any flags. Here are the patches:

--- sysutils/gnome-vfs2/Makefile.common.diff ---

--- Makefile.common	2007-07-01 16:58:35.000000000 +0200
+++ Makefile.common.orig	2007-04-29 15:09:27.000000000 +0200
@@ -22,8 +22,6 @@
 USE_TOOLS+=		gmake intltool msgfmt pkg-config
-.include "../../mk/"
 CONFIGURE_ARGS+=	--disable-cdda
 CONFIGURE_ARGS+=	--disable-gtk
 CONFIGURE_ARGS+=	--disable-howl
@@ -47,6 +45,8 @@
+.include "../../mk/"
 # XXX Work-around for a problem in the configure script which checks for
 # statvfs(2) having SVR4 in mind.  Solving this in the script itself could
 # be the right way to go, but it is out of the scope of a local patch; it

--- sysutils/gnome-vfs2/Makefile.diff ---

--- Makefile	2007-07-01 16:59:58.000000000 +0200
+++ Makefile.orig	2007-07-01 16:57:30.000000000 +0200
@@ -4,8 +4,6 @@
-.include "Makefile.common"
 EGFILES+=		modules/default-modules.conf
@@ -23,6 +21,8 @@
 PKG_DESTDIR_SUPPORT=	user-destdir
+.include "Makefile.common"
 CONFIGURE_ARGS+=	--enable-fam
 .include "../../devel/GConf2/"


This is the same problem and fix as pkg/30029 (devel/glib2), pkg/30030 (databases/shared-mime-info) and pkg/30081 (x11/gtk2).