From nobody@FreeBSD.org  Thu Feb 22 16:05:17 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 E836616A400
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 22 Feb 2007 16:05:17 +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 C0F2A13C441
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 22 Feb 2007 16:05:17 +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 l1MG5H4v027496
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 22 Feb 2007 16:05:17 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l1MG5H6E027472;
	Thu, 22 Feb 2007 16:05:17 GMT
	(envelope-from nobody)
Message-Id: <200702221605.l1MG5H6E027472@www.freebsd.org>
Date: Thu, 22 Feb 2007 16:05:17 GMT
From: Dwayne MacKinnon<dwaynemk@hotmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] emulators/vice  Add support for joysticks.
X-Send-Pr-Version: www-3.0

>Number:         109438
>Category:       ports
>Synopsis:       [patch] emulators/vice  Add support for joysticks.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dinoex
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 22 16:10:05 GMT 2007
>Closed-Date:    Sun Mar 04 10:11:29 CET 2007
>Last-Modified:  Sun Mar  4 09:20:05 GMT 2007
>Originator:     Dwayne MacKinnon
>Release:        6.2-RELEASE
>Organization:
>Environment:
FreeBSD chiron 6.2-RELEASE FreeBSD 6.2-RELEASE #1: Fri Jan 26 08:20:47 EST 2007     root@chiron:/usr/obj/usr/src/sys/CHIRON  i386

>Description:
The VICE port does not configure itself to use FreeBSD's joystick support (/dev/joy*). It looks for machine/joystick.h, when in FreeBSD the include file is actually sys/joystick.h.

>How-To-Repeat:
Compile the VICE port from src, and examine the configure output.
>Fix:
I've included four files with this PR:

1) A patch to the port Makefile, which uses a post-patch sed command to change all instances of machine/joystick.h in the configure script to sys/joystick.h.

2) A patch to src/arch/unix/joy.c, which changes machine/joystick.h to sys/joystick.h.

3) A patch to src/arch/unix/joy_usb.c. Enabling joystick support via the changes to the configure script reveals a secondary problem: the compilation of joy_usb.c fails. The compile failure is due to _IOWR not being defined. The patch adds the header file sys/ioccom.h to the .c file. This solves the compile problem, but I have not been able to test to see if a USB joystick would actually work with VICE due to lack of equipment.

4) A pkg-message file to help steer people installing VICE on how to load the joy kernel module and set the permissions for /dev/joy* properly so that VICE can use the devices.

Patch attached with submission follows:

--- Makefile.orig	Tue Feb 20 10:36:50 2007
+++ Makefile	Tue Feb 20 10:07:22 2007
@@ -101,6 +101,8 @@
 post-patch:
 	${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|g" \
 		${WRKSRC}/man/vice.1
+	${REINPLACE_CMD} -e "s|machine/joystick.h|sys/joystick.h|g" \
+		${WRKSRC}/configure
 .if defined(NOPORTDOCS)
 	${REINPLACE_CMD} -e 's| doc||' ${WRKSRC}/Makefile.in
 .endif

--- src/arch/unix/joy.c.orig	Tue Feb 20 10:11:02 2007
+++ src/arch/unix/joy.c	Tue Feb 20 10:11:13 2007
@@ -117,7 +117,7 @@
 #endif
 
 #elif defined(BSD_JOYSTICK)
-#include <machine/joystick.h>
+#include <sys/joystick.h>
 #define JS_DATA_TYPE joystick
 #define JS_RETURN    sizeof(struct joystick)
 int     use_old_api=1;

--- src/arch/unix/joy_usb.c.orig	Tue Feb 20 10:11:57 2007
+++ src/arch/unix/joy_usb.c	Tue Feb 20 10:12:37 2007
@@ -50,6 +50,7 @@
 
 extern log_t joystick_log;
 
+#include <sys/ioccom.h>
 #include <dev/usb/usb.h>
 #include <dev/usb/usbhid.h>
 #include <errno.h>


The VICE port can use /dev/joy* for joystick support for video games. To enable
the joystick port, add 

joy_load="YES" to /boot/loader.conf 

and the following lines to /etc/devfs.conf (for additional joysticks use
/dev/joy1, /dev/joy2 etc.) :

own	/dev/joy0 root:wheel
perm 	/dev/joy0 0666

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->dinoex 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Thu Feb 22 16:10:19 UTC 2007 
Responsible-Changed-Why:  
Over to maintainer 

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

 Date: Thu, 22 Feb 2007 11:49:44 -0500
 From: Dwayne MacKinnon <dwaynemk@hotmail.com>

 [later addition caught in spamtrap:]

 I meant to mention that the joy_usb.c patch may help fix ports/108504.
State-Changed-From-To: open->closed 
State-Changed-By: dinoex 
State-Changed-When: Sun Mar 4 10:10:28 CET 2007 
State-Changed-Why:  
committed, thanks. 

It is prefered to send unified diff, see porters-handbook. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/109438: commit references a PR
Date: Sun,  4 Mar 2007 09:10:12 +0000 (UTC)

 dinoex      2007-03-04 09:09:59 UTC
 
   FreeBSD ports repository
 
   Modified files:
     emulators/vice       Makefile 
   Added files:
     emulators/vice       pkg-message 
     emulators/vice/files patch-joy.c patch-joy_usb.c 
   Log:
   - Add support for joysticks
   PR:             109438, 108504
   Submitted by:   Dwayne MacKinnon
   
   Revision  Changes    Path
   1.49      +3 -1      ports/emulators/vice/Makefile
   1.1       +11 -0     ports/emulators/vice/files/patch-joy.c (new)
   1.1       +10 -0     ports/emulators/vice/files/patch-joy_usb.c (new)
   1.1       +10 -0     ports/emulators/vice/pkg-message (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
