From bkoenig@cs.tu-berlin.de  Sun Jun 12 19:33:22 2005
Return-Path: <bkoenig@cs.tu-berlin.de>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 681D716A41C;
	Sun, 12 Jun 2005 19:33:22 +0000 (GMT)
	(envelope-from bkoenig@cs.tu-berlin.de)
Received: from mail.efacilitas.de (efacilitas.de [213.133.110.227])
	by mx1.FreeBSD.org (Postfix) with ESMTP id E78A243D1D;
	Sun, 12 Jun 2005 19:33:21 +0000 (GMT)
	(envelope-from bkoenig@cs.tu-berlin.de)
Received: from hoppel.local (port-212-202-39-126.dynamic.qsc.de [212.202.39.126])
	by mail.efacilitas.de (Postfix) with SMTP id 1D4B8123939;
	Sun, 12 Jun 2005 21:31:47 +0200 (CEST)
Received: by hoppel.local (sSMTP sendmail emulation); Sun, 12 Jun 2005 21:31:50 +0200
Message-Id: <20050612193147.1D4B8123939@mail.efacilitas.de>
Date: Sun, 12 Jun 2005 21:31:50 +0200
From: "Bjrn Knig" <bkoenig@cs.tu-berlin.de>
Reply-To: Bjrn Knig <bkoenig@cs.tu-berlin.de>
To: FreeBSD-gnats-submit@freebsd.org
Cc: krion@FreeBSD.org
Subject: Port devel/sdl12: libSDL-1.1 is broken in a world with NO_USB
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         82171
>Category:       ports
>Synopsis:       Port devel/sdl12: libSDL-1.1 is broken in a world with NO_USB
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    krion
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jun 12 19:40:11 GMT 2005
>Closed-Date:    Tue Jul 19 17:41:30 GMT 2005
>Last-Modified:  Thu Jul 21 02:20:16 GMT 2005
>Originator:     Bjrn Knig
>Release:        FreeBSD 5.4-RELEASE-p1 i386
>Organization:
>Environment:
>Description:
	If you have a world which was built with NO_USB=yes then
	libusbhid.so doesn't exist. The current Makefile of the port
	devel/sdl12 just assumes that the old libusb.so is present and
	trusts in the correctness of the configure script; but it'll screw
	up and won't specify any joystick subsystem in this case; not even
	the dummy. This breaks libSDL-1.1 and causes that all ports that
	depend on this library won't compile. 
	 
	You'll get the following errors if you try to link with libSDL-1.1:
	
	libSDL-1.1.so: undefined reference to `SDL_SYS_JoystickUpdate'
	libSDL-1.1.so: undefined reference to `SDL_SYS_JoystickOpen'
	libSDL-1.1.so: undefined reference to `SDL_SYS_JoystickQuit'
	libSDL-1.1.so: undefined reference to `SDL_SYS_JoystickName'
	libSDL-1.1.so: undefined reference to `SDL_SYS_JoystickInit'
	libSDL-1.1.so: undefined reference to `SDL_SYS_JoystickClose'
	
>How-To-Repeat:
	Rename usbhid.h to pretend that we live in a world with NO_USB.
	
	   cd /usr/include
	   mv usbhid.h usbhid.h.bak
	
	Build and install devel/sdl12.
	  
	   cd /usr/ports/devel/sdl12i
	   make install clean
	
	Try to build a port that depends on devel/sdl12.
	  
	   cd /usr/ports/x11/electricsheep
	   make build
	
	This will fail with the error messages that were mentioned in the
	description section of this PR.
>Fix:
	The devel/sdl12 port should make a more accurate check whether USB
	related libraries are available. If they aren't then disable
	support for joysticks. Another solution would be to use the dummy
	joystick subsystem, but I was too lazy to create a suitable patch
	right now. I'll do this if desired.

--- Makefile.diff begins here ---
--- Makefile.orig	Sun Jun 12 19:51:09 2005
+++ Makefile	Sun Jun 12 19:52:01 2005
@@ -71,8 +71,10 @@
 .if exists(/usr/include/libusbhid.h)
 CONFIGURE_ENV+=	USB_LIBS=-lusbhid
 CFLAGS+=	-DHAVE_LIBUSBHID_H
-.else
+.elif exists(/usr/include/libusb.h)
 CONFIGURE_ENV+=	USB_LIBS=-lusb
+.else
+CONFIGURE_ARGS+=--enable-joystick=no
 .endif
 
 MAN3!=		${CAT} ${FILESDIR}/man3
--- Makefile.diff ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->krion 
Responsible-Changed-By: thierry 
Responsible-Changed-When: Sun Jun 12 19:56:26 GMT 2005 
Responsible-Changed-Why:  

Assign to maintainer. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=82171 
State-Changed-From-To: open->closed 
State-Changed-By: krion 
State-Changed-When: Tue Jul 19 17:41:25 GMT 2005 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=82171 

From: "David J. Haines" <dhaines@gmail.com>
To: bug-followup@FreeBSD.org,
 bkoenig@cs.tu-berlin.de
Cc:  
Subject: Re: ports/82171: Port devel/sdl12: libSDL-1.1 is broken in a world with NO_USB
Date: Wed, 20 Jul 2005 22:12:54 -0400

 The submitted patch now breaks on machines without the NO_USB flag in  
 make.conf.  Apparently, it was broken before (it just wouldn't  
 compile USB HID support), but now it causes similar errors to those  
 listed in the problem report.  The fix is simply changing the line  
 ".if exists(/usr/include/libusbhid.h)" to ".if exists(/usr/include/ 
 usbhid.h)".  If you really need one, I can create a diff file.
 
 Thanks.
 
 David J. Haines
 dhaines@gmail.com
 
>Unformatted:
