diff options
author | mva <mva@FreeBSD.org> | 2009-03-14 00:32:57 +0800 |
---|---|---|
committer | mva <mva@FreeBSD.org> | 2009-03-14 00:32:57 +0800 |
commit | 58b8fc97082b8425a7681ccf05fb1a85685457ea (patch) | |
tree | ab99cc1df8606eb43f1bee8ab0ab06b7f301f4a0 /devel/sdl12 | |
parent | b7c9f11a112dd6d8eb88a970d7fbd8c0b3ccdeac (diff) | |
download | freebsd-ports-gnome-58b8fc97082b8425a7681ccf05fb1a85685457ea.tar.gz freebsd-ports-gnome-58b8fc97082b8425a7681ccf05fb1a85685457ea.tar.zst freebsd-ports-gnome-58b8fc97082b8425a7681ccf05fb1a85685457ea.zip |
Reactivate USB joystick support on -CURRENT.
PR: ports/132150
Submitted by: hps
Approved by: miwi (mentor)
Diffstat (limited to 'devel/sdl12')
-rw-r--r-- | devel/sdl12/Makefile | 6 | ||||
-rw-r--r-- | devel/sdl12/files/patch-src_joystick_bsd_SDL_sysjoystick.c | 40 |
2 files changed, 41 insertions, 5 deletions
diff --git a/devel/sdl12/Makefile b/devel/sdl12/Makefile index db813019ab68..298b1a72772b 100644 --- a/devel/sdl12/Makefile +++ b/devel/sdl12/Makefile @@ -7,7 +7,7 @@ PORTNAME= sdl PORTVERSION= 1.2.13 -PORTREVISION= 2 +PORTREVISION= 3 PORTEPOCH= 2 CATEGORIES= devel MASTER_SITES= http://www.libsdl.org/release/ @@ -64,10 +64,6 @@ OPTIONS+= XLIB "XLib (xorg) graphics support" On MAN3!= ${CAT} ${FILESDIR}/man3 -.if ${OSVERSION} > 800063 -CONFIGURE_ARGS+=--disable-joystick -.endif - .if defined(WITHOUT_AALIB) CONFIGURE_ARGS+=--disable-video-aalib .else diff --git a/devel/sdl12/files/patch-src_joystick_bsd_SDL_sysjoystick.c b/devel/sdl12/files/patch-src_joystick_bsd_SDL_sysjoystick.c new file mode 100644 index 000000000000..e7e503fad2ab --- /dev/null +++ b/devel/sdl12/files/patch-src_joystick_bsd_SDL_sysjoystick.c @@ -0,0 +1,40 @@ +--- src/joystick/bsd/SDL_sysjoystick.c.orig 2009-03-12 22:54:57.000000000 +0100 ++++ src/joystick/bsd/SDL_sysjoystick.c 2009-03-12 23:04:53.000000000 +0100 +@@ -74,6 +74,13 @@ + #define MAX_JOY_JOYS 2 + #define MAX_JOYS (MAX_UHID_JOYS + MAX_JOY_JOYS) + ++#if defined(__FREEBSD__) && (__FreeBSD_version > 800063) ++struct usb_ctl_report { ++ int ucr_report; ++ u_char ucr_data[1024]; /* filled data size will vary */ ++}; ++#endif ++ + struct report { + struct usb_ctl_report *buf; /* Buffer */ + size_t size; /* Buffer size */ +@@ -137,7 +144,7 @@ + static int report_alloc(struct report *, struct report_desc *, int); + static void report_free(struct report *); + +-#ifdef USBHID_UCR_DATA ++#if defined(USBHID_UCR_DATA) || (defined(__FREEBSD__) && (__FreeBSD_version > 800063)) + #define REP_BUF_DATA(rep) ((rep)->buf->ucr_data) + #else + #define REP_BUF_DATA(rep) ((rep)->buf->data) +@@ -292,9 +299,13 @@ + strerror(errno)); + goto usberr; + } +- ++#if defined(__FREEBSD__) && (__FreeBSD_version > 800063) ++ rep->rid = hid_get_report_id(fd); ++ if (rep->rid < 0) { ++#else + rep = &hw->inreport; + if (ioctl(fd, USB_GET_REPORT_ID, &rep->rid) < 0) { ++#endif + rep->rid = -1; /* XXX */ + } + if (report_alloc(rep, hw->repdesc, REPORT_INPUT) < 0) { |