Commit 6b852ff7 authored by tijl's avatar tijl
Browse files

The libusb project has adopted hidapi. Update to their latest release,

0.10.1.  Bump py-hidapi so it gets rebuilt to use new functions.
Hand over to maintainer of py-hidapi so the two can be maintained together.

Reported by:	Corey Stephan (marquette.edu)
Tested by:	ehaupt
parent 2c92a676
......@@ -2,27 +2,24 @@
PORTNAME= hidapi
DISTVERSIONPREFIX= ${PORTNAME}-
DISTVERSION= 0.8.0-rc1
PORTREVISION= 3
DISTVERSION= 0.10.1
CATEGORIES= comms
MAINTAINER= tijl@FreeBSD.org
MAINTAINER= ehaupt@FreeBSD.org
COMMENT= Library to access USB HID-class devices
LICENSE= BSD3CLAUSE GPLv3
LICENSE_COMB= dual
USES= autoreconf gettext-tools iconv:wchar_t libtool localbase \
pkgconfig
USE_GITHUB= yes
GH_ACCOUNT= signal11
GH_ACCOUNT= libusb
USES= autoreconf gettext-tools iconv:wchar_t libtool
GNU_CONFIGURE= yes
USE_LDCONFIG= yes
INSTALL_TARGET= install-strip
PORTDOCS= *
CPPFLAGS+= -I${LOCALBASE}/include
LIBS+= -L${LOCALBASE}/lib
USE_LDCONFIG= yes
OPTIONS_DEFINE= DOCS
......
SHA256 (signal11-hidapi-hidapi-0.8.0-rc1_GH0.tar.gz) = 3c147200bf48a04c1e927cd81589c5ddceff61e6dac137a605f6ac9793f4af61
SIZE (signal11-hidapi-hidapi-0.8.0-rc1_GH0.tar.gz) = 101833
TIMESTAMP = 1615890404
SHA256 (libusb-hidapi-hidapi-0.10.1_GH0.tar.gz) = f71dd8a1f46979c17ee521bc2117573872bbf040f8a4750e492271fc141f2644
SIZE (libusb-hidapi-hidapi-0.10.1_GH0.tar.gz) = 119581
--- configure.ac.orig 2013-10-06 22:43:37 UTC
--- configure.ac.orig 2020-11-24 11:39:27 UTC
+++ configure.ac
@@ -89,11 +89,11 @@ case $host in
@@ -82,13 +82,11 @@ case $host in
os="freebsd"
threads="pthreads"
- CFLAGS="$CFLAGS -I/usr/local/include"
- LDFLAGS="$LDFLAGS -L/usr/local/lib"
- LIBS="${LIBS}"
AC_CHECK_LIB([usb], [libusb_init], [LIBS_LIBUSB_PRIVATE="${LIBS_LIBUSB_PRIVATE} -lusb"], [hidapi_lib_error libusb])
PKG_CHECK_MODULES([libusb], [libusb-1.0 >= 1.0.9], true, [hidapi_lib_error libusb-1.0])
LIBS_LIBUSB_PRIVATE="${LIBS_LIBUSB_PRIVATE} $libusb_LIBS"
CFLAGS_LIBUSB="${CFLAGS_LIBUSB} $libusb_CFLAGS"
- AC_CHECK_LIB([iconv], [iconv_open], [LIBS_LIBUSB_PRIVATE="${LIBS_LIBUSB_PRIVATE} -liconv"], [hidapi_lib_error libiconv])
+ AC_CHECK_DECLS([libusb_get_string_descriptor], [], [], [[#include <libusb.h>]])
+ AC_CHECK_DECLS([libusb_handle_events_completed], [], [], [[#include <libusb.h>]])
+ AM_ICONV
+ LIBS_LIBUSB_PRIVATE="${LIBS_LIBUSB_PRIVATE} ${LTLIBICONV}"
echo libs_priv: $LIBS_LIBUSB_PRIVATE
;;
*-mingw*)
*-kfreebsd*)
AC_MSG_RESULT([ (kFreeBSD back-end)])
--- libusb/hid.c.orig 2013-10-06 22:43:37 UTC
+++ libusb/hid.c
@@ -25,6 +25,8 @@
#define _GNU_SOURCE /* needed for wcsdup() before glibc 2.10 */
+#include <config.h>
+
/* C */
#include <stdio.h>
#include <string.h>
@@ -250,7 +252,7 @@ static int get_usage(uint8_t *report_des
}
#endif /* INVASIVE_GET_USAGE */
-#ifdef __FreeBSD__
+#if ! HAVE_DECL_LIBUSB_GET_STRING_DESCRIPTOR
/* The FreeBSD version of libusb doesn't have this funciton. In mainline
libusb, it's inlined in libusb.h. This function will bear a striking
resemblence to that one, because there's about one way to code it.
@@ -333,11 +335,7 @@ static wchar_t *get_usb_string(libusb_de
size_t inbytes;
size_t outbytes;
size_t res;
-#ifdef __FreeBSD__
- const char *inptr;
-#else
- char *inptr;
-#endif
+ ICONV_CONST char *inptr;
char *outptr;
/* Determine which language to use. */
@@ -757,7 +755,11 @@ static void *read_thread(void *param)
libusb_cancel_transfer(dev->transfer);
while (!dev->cancelled)
+#if HAVE_DECL_LIBUSB_HANDLE_EVENTS_COMPLETED
libusb_handle_events_completed(usb_context, &dev->cancelled);
+#else
+ libusb_handle_events(usb_context);
+#endif
/* Now that the read thread is stopping, Wake any threads which are
waiting on data (in hid_read_timeout()). Do this under a mutex to
......@@ -3,4 +3,4 @@ work with USB HID-Class devices. While it can be used to communicate
with standard HID devices like keyboards, mice, and joysticks, it is
most useful when used with custom (Vendor-Defined) HID devices.
WWW: http://www.signal11.us/oss/hidapi/
WWW: https://github.com/libusb/hidapi
......@@ -4,3 +4,9 @@ lib/libhidapi.so
lib/libhidapi.so.0
lib/libhidapi.so.0.0.0
libdata/pkgconfig/hidapi.pc
%%PORTDOCS%%%%DOCSDIR%%/AUTHORS.txt
%%PORTDOCS%%%%DOCSDIR%%/LICENSE-bsd.txt
%%PORTDOCS%%%%DOCSDIR%%/LICENSE-gpl3.txt
%%PORTDOCS%%%%DOCSDIR%%/LICENSE-orig.txt
%%PORTDOCS%%%%DOCSDIR%%/LICENSE.txt
%%PORTDOCS%%%%DOCSDIR%%/README.md
......@@ -3,6 +3,7 @@
PORTNAME= hidapi
PORTVERSION= 0.10.1
PORTREVISION= 1
CATEGORIES= comms python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment