Bug 174725 - graphics/libGL graphics/libGLU graphics/libGLw: disable-gallium-intel bug
Summary: graphics/libGL graphics/libGLU graphics/libGLw: disable-gallium-intel bug
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Steve Wills
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-26 23:00 UTC by John Marino
Modified: 2013-03-02 21:40 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Marino 2012-12-26 23:00:00 UTC
I believe there are three identical bugs in:
graphics/libGL
graphics/libGLU
graphics/libGLw

Looking at the history, it looks like they were introduced as part of PR#169874 and later PR#171301

Specifically this code was added to all three:
+.if ${ARCH} != "amd64" || ${ARCH} != "i386"
+CONFIGURE_ARGS+=--disable-gallium-intel
+.endif

As ${ARCH} can only be one value, this boolean logic evaluates to "true" in 100% of the cases.  For example, if ${ARCH} == "amd64", then it doesn't equal "i386" and evaluates true.

So ${ARCH} could be "amd64", "i386", or *any other value* and "--disable-gallium-intel" will be added to CONFIGURE_ARGS in every case.

Fix: 

I believe this is likely what the original author was going for:

.if !(${ARCH} == "amd64" || ${ARCH} == "i386")
CONFIGURE_ARGS+=--disable-gallium-intel
.endif


(I am assuming gallium-intel should only be disabled for non-x86)
Comment 1 Edwin Groothuis freebsd_committer 2012-12-26 23:00:07 UTC
Responsible Changed
From-To: freebsd-ports-bugs->freebsd-x11

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 John Marino 2013-01-16 10:43:19 UTC
It appears that graphics/dri is also affected by this bug.
There may be more, I haven't grepped for the pattern.

Is anyone looking into it?
John
Comment 3 Steve Wills freebsd_committer 2013-02-21 01:45:50 UTC
Responsible Changed
From-To: freebsd-x11->swills

I'll take it.
Comment 4 dfilter service freebsd_committer 2013-03-02 21:33:05 UTC
Author: swills
Date: Sat Mar  2 21:32:51 2013
New Revision: 313300
URL: http://svnweb.freebsd.org/changeset/ports/313300

Log:
  - Fix logic error which caused the gallium-intel driver to be always disabled [1]
  - Make it possible to choose which DRI drivers will be built [2]
  
  PR:		ports/174725 [1]
  PR:		ports/154651 [2]
  Submitted by:	John Marino <draco@marino.st> [1]
  Submitted by:	bf [2]
  Reviewed by:	kwm [2]

Modified:
  head/graphics/dri/Makefile
  head/graphics/libGL/Makefile
  head/graphics/libGLU/Makefile
  head/graphics/libGLw/Makefile

Modified: head/graphics/dri/Makefile
==============================================================================
--- head/graphics/dri/Makefile	Sat Mar  2 21:03:11 2013	(r313299)
+++ head/graphics/dri/Makefile	Sat Mar  2 21:32:51 2013	(r313300)
@@ -1,13 +1,9 @@
-# New ports collection makefile for:    dri
-# Date created:		8 Nov 2003
-# Whom:			anholt@FreeBSD.org
-#
+# Created by: anholt@FreeBSD.org
 # $FreeBSD$
-#
 
 PORTNAME=	dri
 PORTVERSION=	${MESAVERSION}
-PORTREVISION=	2
+PORTREVISION=	3
 PORTEPOCH=	2
 CATEGORIES=	graphics
 
@@ -19,6 +15,28 @@ LIB_DEPENDS=	drm:${PORTSDIR}/graphics/li
 USE_PKGCONFIG=	build
 USE_XORG=	glproto x11 xext xxf86vm xdamage xfixes dri2proto
 
+OPTIONS_DEFINE=	I810 I915 I965 MACH64 MGA R128 R200 R300 R600 RADEON \
+		SAVAGE SIS SWRAST TDFX UNICHROME
+
+OPTIONS_DEFAULT=I810 I915 I965 MACH64 MGA R128 R200 R300 R600 RADEON \
+		SAVAGE SIS SWRAST TDFX UNICHROME
+
+I810_DESC=	Include DRI support for Intel i810
+I915_DESC=	Include DRI support for Intel i915
+I965_DESC=	Include DRI support for Intel i965
+MACH64_DESC=	Include DRI support for AMD/ATI Mach64
+MGA_DESC=	Include DRI support for Matrox
+R128_DESC=	Include DRI support for AMD/ATI R128
+R200_DESC=	Include DRI support for AMD/ATI R200
+R300_DESC=	Include DRI support for AMD/ATI R300
+R600_DESC=	Include DRI support for AMD/ATI R600
+RADEON_DESC=	Include DRI support for AMD/ATI R100
+SAVAGE_DESC=	Include DRI support for S3/Via Savage
+SIS_DESC=	Include DRI support for SiS 300 and 6326
+SWRAST_DESC=	Include generic software DRI support
+TDFX_DESC=	Include DRI support for 3dfx Voodoo
+UNICHROME_DESC=	Include DRI support for S3/Via Unichrome
+
 do-install:
 	cd ${WRKSRC}/src/mesa; ${GMAKE} install-dri
 
@@ -30,7 +48,7 @@ do-install:
 BROKEN=		Does not install on ia64
 .endif
 
-.if ${ARCH} != "amd64" || ${ARCH} != "i386"
+.if !(${ARCH} == "amd64" || ${ARCH} == "i386")
 CONFIGURE_ARGS+=--disable-gallium-intel
 .endif
 
@@ -118,4 +136,17 @@ PLIST_SUB+=	TDFX_DRIVER="@comment "
 PLIST_SUB+=	UNICHROME_DRIVER="@comment "
 .endif
 
+ALL_DRI_DRIVERS=	i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon \
+			savage sis swrast tdfx unichrome
+
+.for _d in ${ALL_DRI_DRIVERS}
+.if ${PORT_OPTIONS:M${_d:U}}
+DRI_DRIVERS+=	,${_d}
+PLIST_SUB+=	${_d:U}=""
+. else
+PLIST_SUB+=	${_d:U}="@comment "
+. endif
+.endfor
+CONFIGURE_ARGS+=	--with-dri-drivers="${DRI_DRIVERS:C/,//1}"
+
 .include <bsd.port.post.mk>

Modified: head/graphics/libGL/Makefile
==============================================================================
--- head/graphics/libGL/Makefile	Sat Mar  2 21:03:11 2013	(r313299)
+++ head/graphics/libGL/Makefile	Sat Mar  2 21:32:51 2013	(r313300)
@@ -1,13 +1,9 @@
-# New ports collection makefile for:    xorg-server
-# Date created:		7 May 2004
-# Whom:			anholt@FreeBSD.org
-#
+# Created by: anholt@FreeBSD.org
 # $FreeBSD$
-#
 
 PORTNAME=	libGL
 PORTVERSION=	${MESAVERSION}
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	graphics
 
 COMMENT=	OpenGL library that renders using GLX or DRI
@@ -31,7 +27,7 @@ post-install:
 
 .include <bsd.port.pre.mk>
 
-.if ${ARCH} != "amd64" || ${ARCH} != "i386"
+.if !(${ARCH} == "amd64" || ${ARCH} == "i386")
 CONFIGURE_ARGS+=--disable-gallium-intel
 .endif
 

Modified: head/graphics/libGLU/Makefile
==============================================================================
--- head/graphics/libGLU/Makefile	Sat Mar  2 21:03:11 2013	(r313299)
+++ head/graphics/libGLU/Makefile	Sat Mar  2 21:32:51 2013	(r313300)
@@ -1,12 +1,8 @@
-# New ports collection makefile for:    libGLU
-# Date created:		7 May 2004
-# Whom:			anholt@FreeBSD.org
-#
+# Created by: anholt@FreeBSD.org
 # $FreeBSD$
-#
 
 PORTNAME=	libGLU
-PORTREVISION=	1
+PORTREVISION=	2
 PORTVERSION=	${MESAVERSION}
 CATEGORIES=	graphics
 
@@ -25,7 +21,7 @@ do-install:
 
 .include <bsd.port.pre.mk>
 
-.if ${ARCH} != "amd64" || ${ARCH} != "i386"
+.if !(${ARCH} == "amd64" || ${ARCH} == "i386")
 CONFIGURE_ARGS+=--disable-gallium-intel
 .endif
 

Modified: head/graphics/libGLw/Makefile
==============================================================================
--- head/graphics/libGLw/Makefile	Sat Mar  2 21:03:11 2013	(r313299)
+++ head/graphics/libGLw/Makefile	Sat Mar  2 21:32:51 2013	(r313300)
@@ -1,13 +1,9 @@
-# New ports collection makefile for:    libGLw
-# Date created:		7 May 2004
-# Whom:			anholt@FreeBSD.org
-#
+# Created by: anholt@FreeBSD.org
 # $FreeBSD$
-#
 
 PORTNAME=	libGLw
 PORTVERSION=	${MESAVERSION}
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	graphics
 
 COMMENT=	OpenGL widgets library
@@ -23,7 +19,7 @@ do-install:
 
 .include <bsd.port.pre.mk>
 
-.if ${ARCH} != "amd64" || ${ARCH} != "i386"
+.if !(${ARCH} == "amd64" || ${ARCH} == "i386")
 CONFIGURE_ARGS+=--disable-gallium-intel
 .endif
 
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 5 Steve Wills freebsd_committer 2013-03-02 21:33:26 UTC
State Changed
From-To: open->closed

Committed. Thanks!