aboutsummaryrefslogtreecommitdiffstats
path: root/comms/hidapi
diff options
context:
space:
mode:
authortijl <tijl@FreeBSD.org>2015-10-10 22:03:00 +0800
committertijl <tijl@FreeBSD.org>2015-10-10 22:03:00 +0800
commit922a618b417843c8900f4076fc4d95620eefb493 (patch)
tree4ac25229c12e49e974a92ecd82e01b92eea15c00 /comms/hidapi
parent8e2211c86ac31d36abaf0b6dbaadf26adb36f654 (diff)
downloadfreebsd-ports-gnome-922a618b417843c8900f4076fc4d95620eefb493.tar.gz
freebsd-ports-gnome-922a618b417843c8900f4076fc4d95620eefb493.tar.zst
freebsd-ports-gnome-922a618b417843c8900f4076fc4d95620eefb493.zip
Remove iconv(), iconv_open() and iconv_close() symbols from libiconv.
These were FreeBSD specific aliases for libiconv(), libiconv_open() and libiconv_close() that are now also provided by libc which complicates writing configure tests that work correctly when both libc iconv and libiconv are available. Also, because the libiconv iconv.h header redefines iconv* to libiconv* correct use of the header implies that the aliases aren't used. The following ports needed fixes because there was something wrong with the way they tried to detect or use iconv: audio/deadbeef: Remove LIBICONV_PLUG from a source file. It's a compile-time option and should not be set in source code. comms/hidapi: Use standard AM_ICONV configure macro to look for iconv. deskutils/fbreader: Let ports framework deal with LIBICONV_PLUG. deskutils/ljclive: Override configure test for iconv. deskutils/owncloudclient: Add USES=iconv and patch test for iconv. devel/aegis: Bump PORTREVISION because it no longer uses libiconv. devel/libexplain: Add USES=iconv and override test for iconv. devel/sdl20: Override configure test for iconv. emulators/vmw: Replace OSVERSION checks with ICONV_LIB checks and include <iconv.h> instead of <sys/iconv.h>. irc/scrollz: Override configure test for iconv. japanese/chasen-base: Override configure test for iconv and patch configure so it no longer adds -liconv to linker flags just because it happens to be installed. japanses/eb: Patch configure test for iconv. japanses/eblook: Override configure test for iconv. java/jikes: Override configure test for iconv. multimedia/transcode: Bump PORTREVISION because only one plugin links with libiconv now. net/c3270: Override configure test for iconv. net/samba4*: Bump PORTREVISION because it no longer uses libiconv. The configure script will always add -liconv to the linker flags when it happens to be installed which would be wrong but later on binaries are linked with -Wl,--as-needed and the linker discards -liconv because it finds iconv*() functions in libc now and no longer in libiconv. net-mgmt/icinga-*: Remove dependency on iconv. net-mgmt/netxms: Patch configure so it no longer adds -liconv to linker flags just because it happens to be installed. net/asterisk11: Patch configure so it no longer adds -liconv to linker flags just because it happens to be installed. net-p2p/transmission-*: Override configure test for iconv. www/htmlcxx: Override configure test for iconv. www/httrack: Override configure test for iconv. www/xapian-omega: Override configure test for iconv. x11/mrxvt(-devel): Add USES=iconv and override configure test for iconv. x11/x3270: Override configure test for iconv. x11-wm/jwm: Override configure test for iconv. PR: 202838 Exp-run by: antoine Approved by: portmgr (antoine)
Diffstat (limited to 'comms/hidapi')
-rw-r--r--comms/hidapi/Makefile8
-rw-r--r--comms/hidapi/files/patch-configure.ac15
-rw-r--r--comms/hidapi/files/patch-libusb-hid.c19
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)