diff options
Diffstat (limited to 'comms')
-rw-r--r-- | comms/hidapi/Makefile | 8 | ||||
-rw-r--r-- | comms/hidapi/files/patch-configure.ac | 15 | ||||
-rw-r--r-- | comms/hidapi/files/patch-libusb-hid.c | 19 |
3 files changed, 34 insertions, 8 deletions
diff --git a/comms/hidapi/Makefile b/comms/hidapi/Makefile index b02f8141712e..29012fee3c82 100644 --- a/comms/hidapi/Makefile +++ b/comms/hidapi/Makefile @@ -15,10 +15,16 @@ LICENSE_COMB= dual USE_GITHUB= yes GH_ACCOUNT= signal11 -USES= autoreconf iconv:wchar_t libtool +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 + +pre-configure: + @${CP} ${LOCALBASE}/share/gettext/config.rpath ${WRKSRC} + .include <bsd.port.mk> diff --git a/comms/hidapi/files/patch-configure.ac b/comms/hidapi/files/patch-configure.ac index 23416d36d6cc..6137573b4ca6 100644 --- a/comms/hidapi/files/patch-configure.ac +++ b/comms/hidapi/files/patch-configure.ac @@ -1,11 +1,18 @@ ---- configure.ac.orig +--- configure.ac.orig 2013-10-06 22:43:37 UTC +++ configure.ac -@@ -94,6 +94,8 @@ - LIBS="${LIBS}" +@@ -89,11 +89,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]) - 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 <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*) diff --git a/comms/hidapi/files/patch-libusb-hid.c b/comms/hidapi/files/patch-libusb-hid.c index 96d0cd651584..446a1f34a649 100644 --- a/comms/hidapi/files/patch-libusb-hid.c +++ b/comms/hidapi/files/patch-libusb-hid.c @@ -1,4 +1,4 @@ ---- libusb/hid.c.orig +--- libusb/hid.c.orig 2013-10-06 22:43:37 UTC +++ libusb/hid.c @@ -25,6 +25,8 @@ @@ -9,7 +9,7 @@ /* C */ #include <stdio.h> #include <string.h> -@@ -250,7 +252,7 @@ +@@ -250,7 +252,7 @@ static int get_usage(uint8_t *report_des } #endif /* INVASIVE_GET_USAGE */ @@ -18,7 +18,20 @@ /* 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. -@@ -757,7 +757,11 @@ +@@ -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) |