On Thu, Mar 12, 2009 at 08:50:55PM +0100, Sylvestre Gallon wrote:
> Hi ports@,
>
> You can find in attach an update on plib which permits the use
> of plib (and so tuxkart) on other arch than i386.
>
> I have just tried it on amd64 so if someone can try it with
> tuxkart on i386, sparc64 or another ARCH it would be nice.
>
Nice, i noticed the issue already but didn't find a sane way to solve it.
I've modified your patch a bit to get rid of the additional CXXFLAGS
(${MACHTYPE} isn't defined anyways), changed the #ifdef's in the patch
to the same style as other #if's in the code nad bumped the PKGNAME as
the resulting package changes.
The only question left to me is wether we should prefer the solution that
defines the architecture for easier enabling of joystick support on other
arches given that they support joysticks one day.
Other thoughts or comments?
Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/plib/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 Makefile
--- Makefile 10 Nov 2008 22:10:22 -0000 1.1.1.1
+++ Makefile 13 Mar 2009 10:03:46 -0000
@@ -1,11 +1,9 @@
# $OpenBSD: Makefile,v 1.1.1.1 2008/11/10 22:10:22 ajacoutot Exp $
-# needs joystick.h
-ONLY_FOR_ARCHS = i386
-
COMMENT = suite of portable game librairies
DISTNAME = plib-1.8.5
+PKGNAME = ${DISTNAME}p0
CATEGORIES = devel games
HOMEPAGE = http://plib.sourceforge.net/
Index: patches/patch-src_js_jsBSD_cxx
===================================================================
RCS file: patches/patch-src_js_jsBSD_cxx
diff -N patches/patch-src_js_jsBSD_cxx
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_js_jsBSD_cxx 13 Mar 2009 10:03:46 -0000
@@ -0,0 +1,40 @@
+--- src/js/jsBSD.cxx.orig Tue Mar 11 03:06:21 2008
++++ src/js/jsBSD.cxx Thu Mar 12 21:33:03 2009
+@@ -50,8 +50,10 @@
+ #if defined(__FreeBSD__)
+ # include <sys/joystick.h>
+ #else
++#if defined(__i386__)
+ # include <machine/joystick.h> // For analog joysticks
+ #endif
++#endif
+ #ifdef HAVE_USB_JS
+ #if defined(__NetBSD__)
+ #ifdef HAVE_USBHID_H
+@@ -85,7 +87,9 @@ struct os_specific_s {
+ int fd;
+ int is_analog;
+ // The following structure members are specific to analog joysticks
++#if defined(__i386__)
+ struct joystick ajs;
++#endif
+ #ifdef HAVE_USB_JS
+ // The following structure members are specific to USB joysticks
+ struct hid_item *hids;
+@@ -437,7 +441,7 @@ void jsJoystick::rawRead ( int *buttons, float *axes )
+
+ return ;
+ }
+-
++#if defined(__i386__)
+ if ( os->is_analog )
+ {
+ int status = ::read ( os->fd, &os->ajs, sizeof(os->ajs) );
+@@ -462,6 +466,7 @@ void jsJoystick::rawRead ( int *buttons, float *axes )
+
+ return;
+ }
++#endif
+
+ #ifdef HAVE_USB_JS
+ while ((len = ::read(os->fd, os->hid_data_buf, os->hid_dlen)) ==
os->hid_dlen)