Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Mar 2002 06:37:24 +0900 (JST)
From:      KANOU Hiroki <kanou@mil.allnet.ne.jp>
To:        FreeBSD-gnats-submit@freebsd.org
Cc:        kanou@mil.allnet.ne.jp
Subject:   ports/35749: devel/libusb is affected by USB structure rename.
Message-ID:  <200203102137.GAA37438@kappa.allnet.ne.jp>

next in thread | raw e-mail | index | archive | help

>Number:         35749
>Category:       ports
>Synopsis:       devel/libusb is affected by USB structure rename.
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 10 13:40:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     KANOU Hiroki
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
>Environment:
System: FreeBSD tin 4.5-STABLE FreeBSD 4.5-STABLE #0: Sun Mar 10 19:41:05 JST 2002 kanou@tin:/usr/src/sys/compile/TIN i386

/usr/include/dev/usb/usb.h: 1.27.2.7

>Description:

devel/libusb port fails to compile due to rename of structure members.

>How-To-Repeat:

# cd /usr/src ; make update ; make kernel
# cd /usr/ports/devel/libusb
# make build

>Fix:

diff -uNr libusb.orig/Makefile libusb/Makefile
--- libusb.orig/Makefile	Mon Feb 25 11:48:41 2002
+++ libusb/Makefile	Mon Mar 11 06:29:36 2002
@@ -17,4 +17,8 @@
 CONFIGURE_ARGS=	--disable-build-docs
 INSTALLS_SHLIB=	yes
 
+do-patch:
+	${PATCH} -d ${WRKSRC} < ${FILESDIR}/patch-ltmain.sh
+	${GREP} -q udi_devname /usr/include/dev/usb/usb.h && ${PATCH} -d ${WRKSRC} < ${FILESDIR}/patch-bsd.c
+
 .include <bsd.port.mk>
diff -uNr libusb.orig/Makefile.orig libusb/Makefile.orig
--- libusb.orig/Makefile.orig	Thu Jan  1 09:00:00 1970
+++ libusb/Makefile.orig	Mon Feb 25 11:48:41 2002
@@ -0,0 +1,20 @@
+# New ports collection makefile for:	libusb
+# Date created:				27 January 2001
+# Whom:					John Reynolds <johnjen@reynoldsnet.org>
+#
+# $FreeBSD: ports/devel/libusb/Makefile,v 1.4 2002/02/23 14:33:04 vanilla Exp $
+#
+
+PORTNAME=	libusb
+PORTVERSION=	0.1.5
+CATEGORIES=	devel
+MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
+MASTER_SITE_SUBDIR=	${PORTNAME}
+
+MAINTAINER=	johnjen@reynoldsnet.org
+
+GNU_CONFIGURE=	yes
+CONFIGURE_ARGS=	--disable-build-docs
+INSTALLS_SHLIB=	yes
+
+.include <bsd.port.mk>
diff -uNr libusb.orig/files/patch-bsd.c libusb/files/patch-bsd.c
--- libusb.orig/files/patch-bsd.c	Thu Jan  1 09:00:00 1970
+++ libusb/files/patch-bsd.c	Mon Mar 11 06:32:33 2002
@@ -0,0 +1,66 @@
+--- bsd.c.orig	Thu Feb  7 15:43:25 2002
++++ bsd.c	Mon Mar 11 06:31:26 2002
+@@ -151,8 +151,8 @@
+   if (dev->interface < 0)
+     USB_ERROR(-EINVAL);
+ 
+-  intf.interface_index = dev->interface;
+-  intf.alt_no = alternate;
++  intf.uai_interface_index = dev->interface;
++  intf.uai_alt_no = alternate;
+ 
+   ret = ioctl(dev->fd, USB_SET_ALTINTERFACE, &intf);
+   if (ret < 0)
+@@ -284,14 +284,14 @@
+     fprintf(stderr, "usb_control_msg: %d %d %d %d %p %d %d\n",
+             requesttype, request, value, index, bytes, size, timeout);
+ 
+-  req.request.bmRequestType = requesttype;
+-  req.request.bRequest = request;
+-  USETW(req.request.wValue, value);
+-  USETW(req.request.wIndex, index);
+-  USETW(req.request.wLength, size);
++  req.ucr_request.bmRequestType = requesttype;
++  req.ucr_request.bRequest = request;
++  USETW(req.ucr_request.wValue, value);
++  USETW(req.ucr_request.wIndex, index);
++  USETW(req.ucr_request.wLength, size);
+ 
+-  req.data = bytes;
+-  req.flags = 0;
++  req.ucr_data = bytes;
++  req.ucr_flags = 0;
+ 
+   ret = ioctl(dev->fd, USB_SET_TIMEOUT, &timeout);
+   if (ret < 0)
+@@ -303,7 +303,7 @@
+     USB_ERROR_STR(ret, "error sending control message: %s",
+                   strerror(errno));
+ 
+-  return UGETW(req.request.wLength);
++  return UGETW(req.ucr_request.wLength);
+ }
+ 
+ int usb_find_devices_on_bus(struct usb_bus *bus)
+@@ -321,18 +321,18 @@
+     struct usb_device *dev;
+     char buf[20];
+ 
+-    di.addr = device;
++    di.udi_addr = device;
+     if (ioctl(cfd, USB_DEVICEINFO, &di) < 0)
+       continue;
+ 
+     /* There's a device; is it one we should mess with? */
+ 
+-    if (strncmp(di.devnames[0], "ugen", 4) != 0)
++    if (strncmp(di.udi_devnames[0], "ugen", 4) != 0)
+       /* best not to play with things we don't understand */
+       continue;
+ 
+ #if __FreeBSD__
+-    snprintf(buf, sizeof(buf) - 1, "/dev/%s", di.devnames[0]);
++    snprintf(buf, sizeof(buf) - 1, "/dev/%s", di.udi_devnames[0]);
+ #else
+     snprintf(buf, sizeof(buf) - 1, "/dev/%s.00", di.devnames[0]);
+ #endif
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200203102137.GAA37438>