From owner-svn-ports-head@FreeBSD.ORG Wed Jan 29 21:01:52 2014 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BE3584F0; Wed, 29 Jan 2014 21:01:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9E17A15AD; Wed, 29 Jan 2014 21:01:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0TL1q39046605; Wed, 29 Jan 2014 21:01:52 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0TL1pKJ046600; Wed, 29 Jan 2014 21:01:51 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201401292101.s0TL1pKJ046600@svn.freebsd.org> From: Tijl Coosemans Date: Wed, 29 Jan 2014 21:01:51 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r341781 - in head/comms/hidapi: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2014 21:01:52 -0000 Author: tijl Date: Wed Jan 29 21:01:51 2014 New Revision: 341781 URL: http://svnweb.freebsd.org/changeset/ports/341781 QAT: https://qat.redports.org/buildarchive/r341781/ Log: - Remove part of a patch that wasn't entirely correct and let the port use the WCHAR_T iconv extension instead. - Add USES=libtool and let libtoolize copy the necessary files instead of symlinking them such that they can be patched. - Add a configure check for libusb_handle_events_completed. Modified: head/comms/hidapi/Makefile head/comms/hidapi/files/patch-configure.ac head/comms/hidapi/files/patch-libusb-hid.c head/comms/hidapi/pkg-plist Modified: head/comms/hidapi/Makefile ============================================================================== --- head/comms/hidapi/Makefile Wed Jan 29 20:43:01 2014 (r341780) +++ head/comms/hidapi/Makefile Wed Jan 29 21:01:51 2014 (r341781) @@ -2,6 +2,7 @@ PORTNAME= hidapi DISTVERSION= 0.8.0-rc1 +PORTREVISION= 1 CATEGORIES= comms MAINTAINER= tijl@FreeBSD.org @@ -16,9 +17,10 @@ GH_TAGNAME= ${PORTNAME}-${DISTVERSION} GH_COMMIT= 40cf516 USE_AUTOTOOLS= aclocal autoconf autoheader automake libtoolize -AUTOMAKE_ARGS= --add-missing +AUTOMAKE_ARGS= --add-missing --copy +LIBTOOLIZE_ARGS=--copy -USES= iconv +USES= iconv:wchar_t libtool USE_LDCONFIG= yes .include Modified: head/comms/hidapi/files/patch-configure.ac ============================================================================== --- head/comms/hidapi/files/patch-configure.ac Wed Jan 29 20:43:01 2014 (r341780) +++ head/comms/hidapi/files/patch-configure.ac Wed Jan 29 21:01:51 2014 (r341781) @@ -1,12 +1,11 @@ --- configure.ac.orig +++ configure.ac -@@ -93,7 +93,8 @@ - LDFLAGS="$LDFLAGS -L/usr/local/lib" +@@ -94,6 +94,8 @@ LIBS="${LIBS}" AC_CHECK_LIB([usb], [libusb_init], [LIBS_LIBUSB_PRIVATE="${LIBS_LIBUSB_PRIVATE} -lusb"], [hidapi_lib_error libusb]) -- AC_CHECK_LIB([iconv], [iconv_open], [LIBS_LIBUSB_PRIVATE="${LIBS_LIBUSB_PRIVATE} -liconv"], [hidapi_lib_error libiconv]) + 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 ]]) -+ AC_SEARCH_LIBS([iconv_open], [iconv], [], [hidapi_lib_error libiconv]) ++ AC_CHECK_DECLS([libusb_handle_events_completed], [], [], [[#include ]]) echo libs_priv: $LIBS_LIBUSB_PRIVATE ;; *-mingw*) Modified: head/comms/hidapi/files/patch-libusb-hid.c ============================================================================== --- head/comms/hidapi/files/patch-libusb-hid.c Wed Jan 29 20:43:01 2014 (r341780) +++ head/comms/hidapi/files/patch-libusb-hid.c Wed Jan 29 21:01:51 2014 (r341781) @@ -18,55 +18,15 @@ /* 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. -@@ -324,6 +326,7 @@ - static wchar_t *get_usb_string(libusb_device_handle *dev, uint8_t idx) - { - char buf[512]; -+ char buf2[512]; - int len; - wchar_t *str = NULL; - wchar_t wbuf[256]; -@@ -359,7 +362,7 @@ - it is only passed into iconv() which does not need it. */ - - /* Initialize iconv. */ -- ic = iconv_open("WCHAR_T", "UTF-16LE"); -+ ic = iconv_open("char", "UTF-16LE"); - if (ic == (iconv_t)-1) { - LOG("iconv_open() failed\n"); - return NULL; -@@ -369,18 +372,21 @@ - Skip the first character (2-bytes). */ - inptr = buf+2; - inbytes = len-2; -- outptr = (char*) wbuf; -- outbytes = sizeof(wbuf); -+ outptr = buf2; -+ outbytes = sizeof(buf2); - res = iconv(ic, &inptr, &inbytes, &outptr, &outbytes); - if (res == (size_t)-1) { - LOG("iconv() failed\n"); - goto err; - } -+ res = mbstowcs(wbuf, buf2, sizeof(wbuf)/sizeof(wbuf[0])); -+ if (res == (size_t)-1) { -+ LOG("mbstowcs() failed\n"); -+ goto err; -+ } - - /* Write the terminating NULL. */ - wbuf[sizeof(wbuf)/sizeof(wbuf[0])-1] = 0x00000000; -- if (outbytes >= sizeof(wbuf[0])) -- *((wchar_t*)outptr) = 0x00000000; - - /* Allocate and copy the string. */ - str = wcsdup(wbuf); -@@ -757,7 +763,7 @@ +@@ -757,7 +757,11 @@ libusb_cancel_transfer(dev->transfer); while (!dev->cancelled) -- libusb_handle_events_completed(usb_context, &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 Modified: head/comms/hidapi/pkg-plist ============================================================================== --- head/comms/hidapi/pkg-plist Wed Jan 29 20:43:01 2014 (r341780) +++ head/comms/hidapi/pkg-plist Wed Jan 29 21:01:51 2014 (r341781) @@ -3,5 +3,6 @@ lib/libhidapi.a lib/libhidapi.la lib/libhidapi.so lib/libhidapi.so.0 +lib/libhidapi.so.0.0.0 libdata/pkgconfig/hidapi.pc @dirrm include/hidapi