Subject: pkg/31138: pkgsrc audio/xmms fails to compile on 2.1 because of an error in patch-aa
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <dhgutteridge@sympatico.ca>
List: pkgsrc-bugs
Date: 09/04/2005 07:54:01
>Number:         31138
>Category:       pkg
>Synopsis:       pkgsrc audio/xmms fails to compile on 2.1 because of an error in patch-aa
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Sep 04 07:54:01 +0000 2005
>Originator:     David H. Gutteridge
>Release:        2.1_RC3/i386
>Organization:
>Environment:
NetBSD arcusiii.nonus-porta.net 2.1_RC3 NetBSD 2.1_RC3 (GENERIC) #0: Thu Sep  1 10:54:48 UTC 2005  riz@faith.netbsd.org:/home/builds/ab/netbsd-2-1-RC3/i386/200508312123Z-obj/home/builds/ab/netbsd-2-1-RC3/src/sys/arch/i386/compile/GENERIC i386

>Description:
When patch-aa was modified to take into account changes in
NetBSD-current which replaced statfs with statvfs, the 
__NetBSD_Version macro was set like so:

__NetBSD_Version__ >= 200040000) /* NetBSD 2.0D */

When the version numbering scheme changed, this patch was not updated,
and as 2.1 is 201000000, it erroneously assumes it should substitute
for features which don't apply to that release (or presumably any
future 2.x releases).

The fix is, of course, trivial, I've attached one below.  (Note that
I've seen other such errors in pkgsrc builds I suspect are related,
haven't gotten to them yet, but I'll grep the whole source tree to
see if I can find other examples of the same issue.)
>How-To-Repeat:
Try compiling xmms on 2.1.
>Fix:
$NetBSD: patch-aa,v 1.8 2004/05/06 14:48:57 drochner Exp $

--- Input/cdaudio/cdaudio.c.orig	2004-05-06 17:52:36.000000000 +0200
+++ Input/cdaudio/cdaudio.c	2004-05-06 17:54:45.000000000 +0200
@@ -305,7 +305,12 @@
  	FILE *mounts;
  	struct mntent *mnt;
 #elif defined(HAVE_GETMNTINFO)
+/* compiling for NetBSD 2.0D-2.0H would be an issue due to incompatible versioning */
+#if (defined(__NetBSD__) && __NetBSD_Version__ >= 299000000)
+	struct statvfs *fsp;
+#else
  	struct statfs *fsp;
+#endif
  	int entries;
 #endif