From nobody@FreeBSD.org  Mon May 14 21:03:45 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id AF99D16A403
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 14 May 2007 21:03:45 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 7158B13C465
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 14 May 2007 21:03:45 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l4EL3icW098690
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 14 May 2007 21:03:44 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l4EKwhe4098075;
	Mon, 14 May 2007 20:58:43 GMT
	(envelope-from nobody)
Message-Id: <200705142058.l4EKwhe4098075@www.freebsd.org>
Date: Mon, 14 May 2007 20:58:43 GMT
From: Dominic Fandrey<lon_kamikaze@gmx.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [ports][Xorg7.2][graphics/mesa-demos] Broken for non-nvidia drivers.
X-Send-Pr-Version: www-3.0

>Number:         112668
>Category:       misc
>Synopsis:       [ports][Xorg7.2][graphics/mesa-demos] Broken for non-nvidia drivers.
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    araujo
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 14 21:10:03 GMT 2007
>Closed-Date:    Tue May 15 12:09:08 GMT 2007
>Last-Modified:  Tue May 15 12:09:08 GMT 2007
>Originator:     Dominic Fandrey
>Release:        Releng_6
>Organization:
private
>Environment:
FreeBSD mobileKamikaze.norad 6.2-STABLE FreeBSD 6.2-STABLE #1: Fri Apr 27 13:45:49 CEST 2007     root@homeKamikaze.norad:/usr/obj/TPR40-6/i386/usr/src/sys/TPR40-6  i386

>Description:
There's a patch in files that introduces an #ifdef for WITH_NVIDIA_GL. Unfortunately the ports Makefile sets WITH_NVIDIA_GL=0 if it is not defined and thus triggers the #ifdef as well.

also the #ifdef is followed by an #elif without parameters, so it's still broken after fixing the makefile. The #elif has to be replaced with #else.
>How-To-Repeat:
Just try to build without NVIDIA and you will see that it attempts to build for NVIDIA anyway (it will miss a function ending with NV, which should end with MESA).
>Fix:
diff -Pur graphics/mesa-demos.orig/Makefile graphics/mesa-demos/Makefile
--- graphics/mesa-demos.orig/Makefile	Mon May 14 08:08:47 2007
+++ graphics/mesa-demos/Makefile	Mon May 14 08:10:43 2007
@@ -97,8 +97,6 @@
 
 .if defined(WITH_NVIDIA_GL)
 CFLAGS+=	-DWITH_NVIDIA_GL=1
-.else
-CFLAGS+=	-DWITH_NVIDIA_GL=0
 .endif
 
 .include <bsd.port.post.mk>
diff -Pur graphics/mesa-demos.orig/files/patch-progs-xdemos-yuvrect_client.c graphics/mesa-demos/files/patch-progs-xdemos-yuvrect_client.c
--- graphics/mesa-demos.orig/files/patch-progs-xdemos-yuvrect_client.c	Mon May 14 08:08:47 2007
+++ graphics/mesa-demos/files/patch-progs-xdemos-yuvrect_client.c	Mon May 14 08:09:29 2007
@@ -7,7 +7,7 @@
 -   glx_memory = glXAllocateMemoryMESA(dpy, screen, ImgWidth * ImgHeight * 2, 0, 0 ,0);
 +   #ifdef WITH_NVIDIA_GL
 +   	glx_memory = glXAllocateMemoryNV(ImgWidth * ImgHeight * 2, 0, 0 ,0);
-+   #elif
++   #else
 +   	glx_memory = glXAllocateMemoryMESA(dpy, screen, ImgWidth * ImgHeight * 2, 0, 0 ,0);
 +   #endif
     if (!glx_memory)
@@ -20,7 +20,7 @@
 -   glXFreeMemoryMESA(dpy, DefaultScreen(dpy), glx_memory);
 +   #ifdef WITH_NVIDIA_GL
 +      glXFreeMemoryNV(glx_memory);
-+   #elif
++   #else
 +      glXFreeMemoryMESA(dpy, DefaultScreen(dpy), glx_memory);
 +   #endif
     glXDestroyContext(dpy, ctx);
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->araujo 
Responsible-Changed-By: araujo 
Responsible-Changed-When: Tue May 15 10:31:07 UTC 2007 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=112668 
State-Changed-From-To: open->closed 
State-Changed-By: araujo 
State-Changed-When: Tue May 15 12:09:07 UTC 2007 
State-Changed-Why:  
Fixed by flz@. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=112668 
>Unformatted:
