Bug 169042

Summary: Joystick support in devel/sdl12 is broken
Product: Ports & Packages Reporter: jeffrey
Component: Individual Port(s)Assignee: Marcus von Appen <mva>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description jeffrey 2012-06-13 22:10:11 UTC
Joystick support in SDL 1.2 is broken on FreeBSD. Joysticks are detected but input is not functioning.

Fix: Patch attached

Patch attached with submission follows:
How-To-Repeat: Downloading and compiling http://lastlog.de/wiki/index.php/SDL-joystick will show that there are joysticks plugged in, but it will never read output.
Comment 1 Michael Scheidell freebsd_committer freebsd_triage 2012-06-14 13:19:14 UTC
is this x11-drivers/xf86-input-joystick ?

-- 
Michael Scheidell, CTO
 >*| * SECNAP Network Security Corporation
d: +1.561.948.2259
w: http://people.freebsd.org/~scheidell
Comment 2 jeffrey 2012-06-14 23:04:27 UTC
Ah, sorry I didn't say what the patch was for. It's a patch on top of =
libSDL-1.2.15 (devel/sdl12).=
Comment 3 Edwin Groothuis freebsd_committer freebsd_triage 2012-06-15 04:20:49 UTC
Responsible Changed
From-To: freebsd-ports-bugs->mva

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 4 Mark Linimon 2012-06-15 04:21:07 UTC
On Thu, Jun 14, 2012 at 10:20:08PM +0000, Jeffrey Pfau wrote:
>  Ah, sorry I didn't say what the patch was for. It's a patch on top of =
>  libSDL-1.2.15 (devel/sdl12).=

Synopsis fixed, thanks.
Comment 5 Marcus von Appen freebsd_committer freebsd_triage 2012-07-04 17:27:52 UTC
Confirmed, thanks. Your patch is a bit too invasive, since it breaks the
joystick support on RELENG_7 and RELENG_8. A fix for all those platforms
will follow the next days.

Cheers
Marcus
Comment 6 dfilter service freebsd_committer freebsd_triage 2012-07-21 11:04:03 UTC
Author: mva
Date: Sat Jul 21 10:03:51 2012
New Revision: 301271
URL: http://svn.freebsd.org/changeset/ports/301271

Log:
  - Fix joystick input support for RELENG_9
  - while here, convert to optionsng framework
  
  PR:		ports/169042
  Submitted by:	Jeffrey Pfau <jeffrey@endrift.com>

Modified:
  head/Mk/bsd.options.desc.mk
  head/devel/sdl12/Makefile   (contents, props changed)
  head/devel/sdl12/files/patch-src_joystick_bsd_SDL_sysjoystick.c   (contents, props changed)

Modified: head/Mk/bsd.options.desc.mk
==============================================================================
--- head/Mk/bsd.options.desc.mk	Sat Jul 21 09:51:21 2012	(r301270)
+++ head/Mk/bsd.options.desc.mk	Sat Jul 21 10:03:51 2012	(r301271)
@@ -79,6 +79,7 @@ GDM_DESC?=		Build GDM login manager
 GEOIP_DESC?=		GeoIP support
 GEOS_DESC?=		GEOS support
 GEOTIFF_DESC?=		GeoTIFF support
+GGI_DESC?=		General Graphics Interface support
 GIF_DESC?=		GIF support
 GLADE_DESC?=		Glade interface support
 GMP_DESC?=		GMP support
@@ -242,6 +243,7 @@ SSH_DESC?=		SSH support
 SSL_DESC?=		SSL support
 STATIC_DESC?=		Build static executable/libraries
 SVG_DESC?=		SVG image support
+SVGALIB_DESC?=		SVGA graphics support
 SVN_DESC?=		Subversion support
 SZIP_DESC?=		Szip support
 TCL_DESC?=		Tcl scripting language support

Modified: head/devel/sdl12/Makefile
==============================================================================
--- head/devel/sdl12/Makefile	Sat Jul 21 09:51:21 2012	(r301270)
+++ head/devel/sdl12/Makefile	Sat Jul 21 10:03:51 2012	(r301271)
@@ -7,8 +7,8 @@
 
 PORTNAME=	sdl
 PORTVERSION=	1.2.15
+PORTREVISION=	2
 PORTEPOCH=	2
-PORTREVISION=	1
 CATEGORIES=	devel
 MASTER_SITES=	http://www.libsdl.org/release/
 DISTNAME=	SDL-${PORTVERSION}
@@ -38,106 +38,93 @@ CONFIGURE_ARGS+=--disable-video-directfb
 EXAMPLES=	test/*.c test/*.bmp test/*.dat test/*.xbm test/*.wav
 DOCS=		BUGS COPYING CREDITS README README-SDL.txt WhatsNew docs.html
 
-OPTIONS=	AALIB		"ASCII art support"			On  \
-		ARTS		"ARts sound system support"		Off \
-		ESD		"Enlightenment sound system support"	Off \
-		GGI		"General Graphics Interface support"	Off \
-		NAS		"Network Audio System support"		Off \
-		OPENGL		"OpenGL 2D/3D graphics support"		On  \
-		OSS		"Open Sound System support"		On  \
-		PULSEAUDIO	"PulseAudio sound system support"       Off \
-		SVGALIB		"SVGA graphics support (i386 only)"	Off
+OPTIONS_DEFINE=		AALIB ARTS ESOUND GGI NAS OPENGL OSS PULSEAUDIO SVGALIB X11
+OPTIONS_DEFAULT=	AALIB OPENGL OSS X11
 
 .if exists(/usr/lib/libvgl.so)
-OPTIONS+=	VGL		"Video Graphics Lib support"		On
-.else
-WITHOUT_VGL=	true
-.endif
-
-.if defined(WITHOUT_X11)
-WITHOUT_XLIB=	true
-.else
-OPTIONS+=	XLIB		"XLib (xorg) graphics support"		On
+OPTIONS_DEFINE+=	VGL
+VGL_DESC=		Video Graphics Lib support
+OPTIONS_DEFAULT+=	VGL
 .endif
 
 .include <bsd.port.pre.mk>
 
 MAN3!=		${CAT} ${FILESDIR}/man3
 
-.if defined(WITHOUT_AALIB)
-CONFIGURE_ARGS+=--disable-video-aalib
+.if ${PORT_OPTIONS:MAALIB}
+CONFIGURE_ARGS+=	--enable-video-aalib
+LIB_DEPENDS+=		aa:${PORTSDIR}/graphics/aalib
 .else
-LIB_DEPENDS+=	aa.1:${PORTSDIR}/graphics/aalib
-CONFIGURE_ARGS+=--enable-video-aalib
+CONFIGURE_ARGS+=	--disable-video-aalib
 .endif
 
-.if defined(WITH_ARTS)
-LIB_DEPENDS+=	artsc.0:${PORTSDIR}/audio/arts
-CONFIGURE_ARGS+=--enable-arts
+.if ${PORT_OPTIONS:MARTS}
+LIB_DEPENDS+=		artsc:${PORTSDIR}/audio/arts
+CONFIGURE_ARGS+=	--enable-arts
 .else
-CONFIGURE_ARGS+=--disable-arts
+CONFIGURE_ARGS+=	--disable-arts
 .endif
 
-.if defined(WITH_ESD)
-USE_GNOME+=	esound
-CONFIGURE_ARGS+=--enable-esd
+.if ${PORT_OPTIONS:MESOUND}
+USE_GNOME+=		esound
+CONFIGURE_ARGS+=	--enable-esd
 .else
-CONFIGURE_ARGS+=--disable-esd --disable-esdtest
+CONFIGURE_ARGS+=	--disable-esd --disable-esdtest
 .endif
 
-.if defined(WITH_GGI)
-LIB_DEPENDS+=	ggi.2:${PORTSDIR}/graphics/libggi
-CONFIGURE_ARGS+=--enable-video-ggi
+.if ${PORT_OPTIONS:MGGI}
+LIB_DEPENDS+=		ggi:${PORTSDIR}/graphics/libggi
+CONFIGURE_ARGS+=	--enable-video-ggi
 .else
-CONFIGURE_ARGS+=--disable-video-ggi
+CONFIGURE_ARGS+=	--disable-video-ggi
 .endif
 
-.if defined(WITH_NAS)
-LIB_DEPENDS+=	audio.2:${PORTSDIR}/audio/nas
+.if ${PORT_OPTIONS:MNAS}
+LIB_DEPENDS+=		audio:${PORTSDIR}/audio/nas
 .else
-CONFIGURE_ARGS+=--disable-nas
+CONFIGURE_ARGS+=	--disable-nas
 .endif
 
-.if defined(WITHOUT_OPENGL)
-CONFIGURE_ARGS+=--disable-video-opengl
+.if ${PORT_OPTIONS:MOPENGL}
+CONFIGURE_ARGS+=	--enable-video-opengl
+USE_GL=			yes
 .else
-USE_GL=		yes
-CONFIGURE_ARGS+=--enable-video-opengl
+CONFIGURE_ARGS+=	--disable-video-opengl
 .endif
 
-.if defined(WITHOUT_OSS)
-CONFIGURE_ARGS+=--disable-oss
+.if ${PORT_OPTIONS:MOSS}
+CONFIGURE_ARGS+=	--enable-oss
 .else
-CONFIGURE_ARGS+=--enable-oss
+CONFIGURE_ARGS+=	--disable-oss
 .endif
 
-.if defined(WITH_PULSEAUDIO)
-LIB_DEPENDS+=	pulse-simple.0:${PORTSDIR}/audio/pulseaudio
+.if ${PORT_OPTIONS:MPULSEAUDIO}
+LIB_DEPENDS+=		pulse-simple:${PORTSDIR}/audio/pulseaudio
 .else
-CONFIGURE_ARGS+=--disable-pulseaudio
+CONFIGURE_ARGS+=	--disable-pulseaudio
 .endif
 
-.if (defined(WITHOUT_SVGALIB) || ${ARCH} != "i386")
-CONFIGURE_ARGS+=--disable-video-svga
+.if ${PORT_OPTIONS:MSVGALIB}
+LIB_DEPENDS+=		vga:${PORTSDIR}/graphics/svgalib
+CONFIGURE_ARGS+=	--enable-video-svga
 .else
-LIB_DEPENDS+=	vga.1:${PORTSDIR}/graphics/svgalib
-CONFIGURE_ARGS+=--enable-video-svga
+CONFIGURE_ARGS+=	--disable-video-svga
 .endif
 
-.if defined(WITHOUT_VGL)
-CONFIGURE_ARGS+=--disable-video-vgl
-PKGMESSAGE=	none
-DISPLAY_MSG=	${DO_NADA}
+.if ${PORT_OPTIONS:MVGL}
+CONFIGURE_ARGS+=	--enable-video-vgl
+DISPLAY_MSG=		${CAT} ${PKGMESSAGE}
 .else
-CONFIGURE_ARGS+=--enable-video-vgl
-DISPLAY_MSG=	${CAT} ${PKGMESSAGE}
+CONFIGURE_ARGS+=	--disable-video-vgl
+PKGMESSAGE=		none
+DISPLAY_MSG=		${DO_NADA}
 .endif
 
-.if defined(WITHOUT_XLIB)
-PKGNAMESUFFIX=	-nox11
-CONFIGURE_ARGS+=--disable-video-x11
+.if ${PORT_OPTIONS:MX11}
+USE_XORG=		x11 xrender xrandr xextproto
 .else
-USE_XORG=	x11 xrender xrandr xextproto
+PKGNAMESUFFIX=		-nox11
+CONFIGURE_ARGS+=	--disable-video-x11
 .endif
 
 post-install:

Modified: head/devel/sdl12/files/patch-src_joystick_bsd_SDL_sysjoystick.c
==============================================================================
--- head/devel/sdl12/files/patch-src_joystick_bsd_SDL_sysjoystick.c	Sat Jul 21 09:51:21 2012	(r301270)
+++ head/devel/sdl12/files/patch-src_joystick_bsd_SDL_sysjoystick.c	Sat Jul 21 10:03:51 2012	(r301271)
@@ -1,11 +1,38 @@
---- src/joystick/bsd/SDL_sysjoystick.c.orig	2012-01-28 12:07:18.000000000 +0100
-+++ src/joystick/bsd/SDL_sysjoystick.c	2012-01-28 12:08:44.000000000 +0100
-@@ -148,7 +148,7 @@
+--- src/joystick/bsd/SDL_sysjoystick.c.orig	2012-01-19 07:30:06.000000000 +0100
++++ src/joystick/bsd/SDL_sysjoystick.c	2012-07-21 10:09:16.000000000 +0200
+@@ -82,7 +82,9 @@
+ #define MAX_JOYS	(MAX_UHID_JOYS + MAX_JOY_JOYS)
+ 
+ struct report {
+-#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063)
++#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 900000)
++	void *buf;			/* Buffer */
++#elif defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063)
+ 	struct	usb_gen_descriptor *buf;	/* Buffer */
+ #else
+ 	struct	usb_ctl_report *buf;	/* Buffer */
+@@ -148,8 +150,10 @@
  static int	report_alloc(struct report *, struct report_desc *, int);
  static void	report_free(struct report *);
  
 -#if defined(USBHID_UCR_DATA) || defined(__FreeBSD_kernel__)
 +#if defined(USBHID_UCR_DATA) || (defined(__FreeBSD_kernel__) && __FreeBSD_kernel_version <= 800063)
  #define REP_BUF_DATA(rep) ((rep)->buf->ucr_data)
++#elif (defined(__FREEBSD__) && (__FreeBSD_kernel_version > 900000))
++#define REP_BUF_DATA(rep) ((rep)->buf)
  #elif (defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063))
  #define REP_BUF_DATA(rep) ((rep)->buf->ugd_data)
+ #else
+@@ -582,8 +586,12 @@
+ 	r->size = len;
+ 
+ 	if (r->size > 0) {
++#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 900000)
++		r->buf = SDL_malloc(r->size);
++#else
+ 		r->buf = SDL_malloc(sizeof(*r->buf) - sizeof(REP_BUF_DATA(r)) +
+ 		    r->size);
++#endif
+ 		if (r->buf == NULL) {
+ 			SDL_OutOfMemory();
+ 			return (-1);
_______________________________________________
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 7 Marcus von Appen freebsd_committer freebsd_triage 2012-07-21 11:04:28 UTC
State Changed
From-To: open->closed

Committed, with minor changes. Thanks!