# This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # usbredir/ # usbredir/Makefile # usbredir/distinfo # usbredir/pkg-descr # usbredir/pkg-plist # usbredir/files/ # usbredir/files/libusb-1.0.pc # usbredir/files/patch-usbredirhost-usbredirhost.c # usbredir/files/patch-usbredirserver-usbredirserver.c # usbredir/files/patch-usbredirtestclient-usbredirtestclient.c # echo c - usbredir/ mkdir -p usbredir/ > /dev/null 2>&1 echo x - usbredir/Makefile sed 's/^X//' >usbredir/Makefile << '5a7fbcb01bd72222689f303d0c9b19c8' X# Ports collection makefile for: usbredir X# Date created: Mon Aug 15 18:16:38 CEST 2011 X# Whom: Juergen Lock X# X# $FreeBSD: $ X# X XPORTNAME= usbredir XPORTVERSION= 0.3 XCATEGORIES= net devel XMASTER_SITES= http://people.fedoraproject.org/~jwrdegoede/ X XMAINTAINER= nox@FreeBSD.org XCOMMENT= A protocol for redirection of USB traffic X XUSE_BZIP2= yes XMAKE_JOBS_SAFE= yes XUSE_GMAKE= yes XUSE_GNOME= pkgconfig XPATCH_STRIP= -p1 XMAKE_ARGS+= PREFIX=${PREFIX} X X.include X X.if ${OSVERSION} < 800069 XIGNORE= needs libusb 1.0 X.else XMAKE_ENV+= PKG_CONFIG_PATH=${FILESDIR} X.endif X Xpost-patch: X @${REINPLACE_CMD} "s|\\\$$(LIBDIR)/pkgconfig|${PREFIX}/libdata/pkgconfig|" ${WRKSRC}/*/Makefile X X.include 5a7fbcb01bd72222689f303d0c9b19c8 echo x - usbredir/distinfo sed 's/^X//' >usbredir/distinfo << '316bb2554e7d7c912588a493f549ea37' XSHA256 (usbredir-0.3.tar.bz2) = 385ae4511e2f3d39ab9f1b68d1668ca70ff4c52ddf8274c603cf5b3de7aca6a6 XSIZE (usbredir-0.3.tar.bz2) = 37295 316bb2554e7d7c912588a493f549ea37 echo x - usbredir/pkg-descr sed 's/^X//' >usbredir/pkg-descr << 'e61d7a6f1f13e773ecf3d060e9f0ddd9' Xusbredir is a protocol for redirection USB traffic from a single USB device, Xto a different (virtual) machine then the one to which the USB device is Xattached. See usb-redirection-protocol.txt for the description / definition Xof this protocol. X XWith the official 0.3 release the protocol is now frozen (only extensions Xadvertised through capabilities can be added from now on). X XWWW: http://cgit.freedesktop.org/~jwrdegoede/usbredir/ e61d7a6f1f13e773ecf3d060e9f0ddd9 echo x - usbredir/pkg-plist sed 's/^X//' >usbredir/pkg-plist << '3bd323844486840079865da58a31ff63' Xinclude/usbredirhost.h Xinclude/usbredirproto.h Xinclude/usbredirparser.h Xlib/libusbredirparser.so Xlib/libusbredirparser.so.0 Xlib/libusbredirhost.so Xlib/libusbredirhost.so.0 Xlibdata/pkgconfig/libusbredirparser.pc Xlibdata/pkgconfig/libusbredirhost.pc Xsbin/usbredirserver 3bd323844486840079865da58a31ff63 echo c - usbredir/files/ mkdir -p usbredir/files/ > /dev/null 2>&1 echo x - usbredir/files/libusb-1.0.pc sed 's/^X//' >usbredir/files/libusb-1.0.pc << '89236fc72dce1536ec92ac6a2e93d41f' Xprefix=/usr Xexec_prefix=${prefix} Xlibdir=${exec_prefix}/lib Xincludedir=${prefix}/include X XName: libusb XDescription: USB access library XVersion: 1.0.1 XLibs: -L${libdir} -lusb XCflags: -I${includedir} 89236fc72dce1536ec92ac6a2e93d41f echo x - usbredir/files/patch-usbredirhost-usbredirhost.c sed 's/^X//' >usbredir/files/patch-usbredirhost-usbredirhost.c << '50f7ffa59699cdac6d295a24055df038' X--- a/usbredirhost/usbredirhost.c X+++ b/usbredirhost/usbredirhost.c X@@ -27,6 +27,71 @@ X #include X #include "usbredirhost.h" X X+/* X+ * passing actual enum libusb_speed libusb_get_device_speed() return X+ * values other than LIBUSB_SPEED_UNKNOWN causes qemu 0.15.0 to X+ * complain when redirecting usb 2.0 devices when ehci isn't enabled X+ * (-readconfig docs/ich9-ehci-uhci.cfg, which breaks at least X+ * FreeBSD 8 guests and hangs at boot in seabios(?) when redirecting X+ * an usb 2.0 flashkey) - it says: X+ * X+ * qemu: Warning: speed mismatch trying to attach usb device USB Redirection Device to bus usb.0 X+ * X+ * and ignores the redirected device. Thus, for now always assume X+ * speed unknown: X+ */ X+#define IGNORE_LIBUSB_GET_DEVICE_SPEED X+ X+/* The following is only interesting once the above is fixed: */ X+#ifndef IGNORE_LIBUSB_GET_DEVICE_SPEED X+#define HAVE_LIBUSB_GET_DEVICE_SPEED X+ X+#ifdef __FreeBSD__ X+/* #undef this if libusb_get_device_speed() is missing in your X+ * version of FreeBSD (not relevant if IGNORE_LIBUSB_GET_DEVICE_SPEED X+ * is defined) */ X+/* #undef HAVE_LIBUSB_GET_DEVICE_SPEED */ X+ X+#ifndef HAVE_LIBUSB_GET_DEVICE_SPEED X+#include X+#define HAVE_SRC /* this only works if system sources are available */ X+#ifdef HAVE_SRC X+#include "/usr/src/lib/libusb/libusb10.h" X+#endif X+ X+enum libusb_speed { X+ LIBUSB_SPEED_UNKNOWN = 0, X+ LIBUSB_SPEED_LOW = 1, X+ LIBUSB_SPEED_FULL = 2, X+ LIBUSB_SPEED_HIGH = 3, X+ LIBUSB_SPEED_SUPER = 4, X+}; X+ X+enum libusb_speed libusb_get_device_speed(libusb_device *dev) X+{ X+#ifdef HAVE_SRC X+ if (dev == NULL) X+ return (LIBUSB_SPEED_UNKNOWN); /* should not happen */ X+ X+ switch (libusb20_dev_get_speed(dev->os_priv)) { X+ case LIBUSB20_SPEED_LOW: X+ return (LIBUSB_SPEED_LOW); X+ case LIBUSB20_SPEED_FULL: X+ return (LIBUSB_SPEED_FULL); X+ case LIBUSB20_SPEED_HIGH: X+ return (LIBUSB_SPEED_HIGH); X+ case LIBUSB20_SPEED_SUPER: X+ return (LIBUSB_SPEED_SUPER); X+ default: X+ break; X+ } X+#endif X+ return (LIBUSB_SPEED_UNKNOWN); X+} X+#endif X+#endif X+#endif X+ X #define MAX_ENDPOINTS 32 X #define MAX_INTERFACES 32 /* Max 32 endpoints and thus interfaces */ X #define CTRL_TIMEOUT 5000 /* USB specifies a 5 second max timeout */ X@@ -487,6 +552,9 @@ struct usbredirhost *usbredirhost_open( X return NULL; X } X X+#ifdef IGNORE_LIBUSB_GET_DEVICE_SPEED X+ device_connect.speed = usb_redir_speed_unknown; X+#else X speed = libusb_get_device_speed(host->dev); X switch (speed) { X case LIBUSB_SPEED_LOW: X@@ -500,6 +568,7 @@ struct usbredirhost *usbredirhost_open( X default: X device_connect.speed = usb_redir_speed_unknown; X } X+#endif X device_connect.device_class = desc.bDeviceClass; X device_connect.device_subclass = desc.bDeviceSubClass; X device_connect.device_protocol = desc.bDeviceProtocol; 50f7ffa59699cdac6d295a24055df038 echo x - usbredir/files/patch-usbredirserver-usbredirserver.c sed 's/^X//' >usbredir/files/patch-usbredirserver-usbredirserver.c << 'ec1729072d397a72762602f600a422ef' X--- a/usbredirserver/usbredirserver.c X+++ b/usbredirserver/usbredirserver.c X@@ -33,6 +33,9 @@ X #include X #include X #include X+#ifdef __FreeBSD__ X+#include X+#endif X #include "usbredirhost.h" X X #define VERSION "usbredirserver " USBREDIR_VERSION ec1729072d397a72762602f600a422ef echo x - usbredir/files/patch-usbredirtestclient-usbredirtestclient.c sed 's/^X//' >usbredir/files/patch-usbredirtestclient-usbredirtestclient.c << 'f2137784629ff4bf45ed789d6fef45bc' X--- a/usbredirtestclient/usbredirtestclient.c X+++ b/usbredirtestclient/usbredirtestclient.c X@@ -33,6 +33,9 @@ X #include X #include X #include X+#ifdef __FreeBSD__ X+#include X+#endif X #include "usbredirparser.h" X X /* Macros to go from an endpoint address to an index for our ep array */ f2137784629ff4bf45ed789d6fef45bc exit