diff options
author | kristerw <kristerw> | 2002-01-12 22:53:16 +0000 |
---|---|---|
committer | kristerw <kristerw> | 2002-01-12 22:53:16 +0000 |
commit | 7dcab4643da993a5c0937c4c72986224c75aa1ae (patch) | |
tree | 66d13391f1fd6e1b2549392a6bbfd334450dd153 /emulators/xmess | |
parent | 9a2a50c87887e70189ceaa24375c93590a4ddee4 (diff) | |
download | pkgsrc-7dcab4643da993a5c0937c4c72986224c75aa1ae.tar.gz |
Make xmess compile for new systems that have libusbhid.so instead of libusb.so.
Remove mame.dk as master site, since it is awfully slow.
Diffstat (limited to 'emulators/xmess')
-rw-r--r-- | emulators/xmess/Makefile | 7 | ||||
-rw-r--r-- | emulators/xmess/distinfo | 4 | ||||
-rw-r--r-- | emulators/xmess/patches/patch-ab | 20 | ||||
-rw-r--r-- | emulators/xmess/patches/patch-ac | 60 |
4 files changed, 86 insertions, 5 deletions
diff --git a/emulators/xmess/Makefile b/emulators/xmess/Makefile index 6241cb4e195..40a75f09c16 100644 --- a/emulators/xmess/Makefile +++ b/emulators/xmess/Makefile @@ -1,11 +1,10 @@ -# $NetBSD: Makefile,v 1.17 2002/01/05 18:05:19 kristerw Exp $ +# $NetBSD: Makefile,v 1.18 2002/01/12 22:53:16 kristerw Exp $ # DISTNAME= xmame-0.56.2 PKGNAME= xmess-0.56.2 CATEGORIES= emulators games x11 -MASTER_SITES= http://roms.mame.dk/emu/ \ - http://x.mame.net/download/ +MASTER_SITES= http://x.mame.net/download/ EXTRACT_SUFX= .tar.bz2 MAINTAINER= kristerw@netbsd.org @@ -98,7 +97,7 @@ MAKE_FLAGS+= X11_DGA=1 MAKE_FLAGS+= JOY_I386=1 .endif .if ${OPSYS} == "NetBSD" -. if exists(/usr/lib/libusb.a) +. if exists(/usr/lib/libusb.a) || exists(/usr/lib/libusbhid.a) MAKE_FLAGS+= JOY_USB=1 . endif .endif diff --git a/emulators/xmess/distinfo b/emulators/xmess/distinfo index 4cc1c31978e..c42d1b95f9b 100644 --- a/emulators/xmess/distinfo +++ b/emulators/xmess/distinfo @@ -1,6 +1,8 @@ -$NetBSD: distinfo,v 1.2 2002/01/03 00:19:01 kristerw Exp $ +$NetBSD: distinfo,v 1.3 2002/01/12 22:53:16 kristerw Exp $ SHA1 (xmame-0.56.2.tar.bz2) = a6fa58be23231d919540f5b3c619a1f2565b03e8 Size (xmame-0.56.2.tar.bz2) = 7049295 bytes SHA1 (patch-aa) = be131167296c50e3aea55da46288dfc16bf3ad8e +SHA1 (patch-ab) = b6bb3acba452b91c8b9dd946531e9195d5d196fb +SHA1 (patch-ac) = 08dda8c365c9891e1f54ef622325015a38cb9758 SHA1 (patch-ae) = dfd2f103139dbf1f575cf00d8feda75085db39be diff --git a/emulators/xmess/patches/patch-ab b/emulators/xmess/patches/patch-ab new file mode 100644 index 00000000000..056bba006f9 --- /dev/null +++ b/emulators/xmess/patches/patch-ab @@ -0,0 +1,20 @@ +$NetBSD: patch-ab,v 1.6 2002/01/12 22:53:16 kristerw Exp $ +--- src/unix/unix.mak.orig Sun Jan 6 03:44:58 2002 ++++ src/unix/unix.mak Sun Jan 6 19:01:36 2002 +@@ -214,7 +214,16 @@ + endif + ifdef JOY_USB + CONFIG += -DUSB_JOYSTICK ++ifeq ($(ARCH), netbsd) ++ifeq ($(shell test -f /usr/include/usbhid.h && echo have_usbhid), have_usbhid) ++CONFIG += -DHAVE_USBHID_H ++MY_LIBS += -lusbhid ++else + MY_LIBS += -lusb ++endif ++else ++MY_LIBS += -lusb ++endif + endif + + ifdef EFENCE diff --git a/emulators/xmess/patches/patch-ac b/emulators/xmess/patches/patch-ac new file mode 100644 index 00000000000..2dbcdc1a106 --- /dev/null +++ b/emulators/xmess/patches/patch-ac @@ -0,0 +1,60 @@ +$NetBSD: patch-ac,v 1.1 2002/01/12 22:53:16 kristerw Exp $ +--- src/unix/joystick-drivers/joy_usb.c.orig Wed Jan 2 03:45:55 2002 ++++ src/unix/joystick-drivers/joy_usb.c Sun Jan 6 22:17:55 2002 +@@ -21,7 +21,11 @@ + #endif + + #if defined(__ARCH_netbsd) ++#ifdef HAVE_USBHID_H ++#include <usbhid.h> ++#else + #include <usb.h> ++#endif + #elif defined(__ARCH_freebsd) + #include <libusb.h> + #endif +@@ -69,7 +73,7 @@ + + static int joy_initialize_hid(int i) + { +- int size, is_joystick, report_id; ++ int size, is_joystick, report_id = 0; + struct hid_data *d; + struct hid_item h; + report_desc_t rd; +@@ -82,7 +86,19 @@ + + priv_joy_data[i].hids = NULL; + ++#ifdef HAVE_USBHID_H ++ if (ioctl(joy_data[i].fd, USB_GET_REPORT_ID, &report_id) < 0) ++ { ++ fprintf(stderr_file, "error: /dev/uhid%d: %s", i, strerror(errno)); ++ return FALSE; ++ } ++ ++ size = hid_report_size(rd, hid_input, report_id); ++ priv_joy_data[i].offset = 0; ++#else + size = hid_report_size(rd, hid_input, &report_id); ++ priv_joy_data[i].offset = (report_id != 0); ++#endif + if ((priv_joy_data[i].data_buf = malloc(size)) == NULL) + { + fprintf(stderr_file, "error: couldn't malloc %d bytes\n", size); +@@ -90,10 +106,14 @@ + return FALSE; + } + priv_joy_data[i].dlen = size; +- priv_joy_data[i].offset = (report_id != 0); + + is_joystick = 0; ++#ifdef HAVE_USBHID_H ++ for (d = hid_start_parse(rd, 1 << hid_input, report_id); ++ hid_get_item(d, &h); ) ++#else + for (d = hid_start_parse(rd, 1 << hid_input); hid_get_item(d, &h); ) ++#endif + { + int axis, usage, page, interesting_hid; + |