build error for net/usbredir after recent update to 0.9.0 ... usbredirect.c:531:19: error: call to undeclared function 'libusb_set_option'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] 531 | int ret = libusb_set_option(NULL, LIBUSB_OPTION_LOG_LEVEL, LIBUSB_LOG_LEVEL_NONE); | ^ usbredirect.c:531:19: note: did you mean 'libusb_get_version'? /usr/include/libusb.h:478:30: note: 'libusb_get_version' declared here 478 | const struct libusb_version *libusb_get_version(void); This was on stable/13, but I don't see libusb_set_option in libusb on freebsd-current either. It looks like having devel/glib20 installed triggers usbredir to build "tools". So a workaround is to explicitly add --without-tools to CONFIGURE_ARGS.
Created attachment 268514 [details] [patch] add CLIENT option and fix build of usbredirect client tool on FreeBSD Fix potential build error of tools/ (when glib20 is installed). If not told otherwise, configure will detect presence of glib20 and, if found, enable the build of "tools" (usbredirect client). Currently building this throws an error because libusb_set_options is not in FreeBSD's libusb currently. To get past that, patch usbredirect.c to skip the code that calls libusb_set_options - it is not necessary. It adjusts libusb log level based on usbredirect log level, but the user can use the LIBUSB_DEBUG environment variable to control the libusb log level. Add a CLIENT option which will install the usbredirect client tool if enabled (or explicitly disable "tools" if not to avoid failure in case glib20 is installed). usbredirect depends on devel/glib20. Make CLIENT off by default to favor a lighter package by default. This could be set to be enabled by default in the future if it proves popular. While here, pet portclippy and sort plist. Bump PORTREVISION due to new CLIENT option.