freebsd-ports/sysutils/nut/files/patch-tools_nut-scanner_nutscan-init.c
Cy Schubert 64080a2f32 sysutils/nut*: Correctly use libusb.so
FreeBSD has no libusb-1.0.so, even though pkgconf identifies it as such.
The ABI is the same but the name is different.

Reported by:    Paul Arakelyan <paul.arakelyan@gmail.com>
2022-05-09 10:49:29 -07:00

16 lines
488 B
C

diff --git tools/nut-scanner/nutscan-init.c.orig tools/nut-scanner/nutscan-init.c
index 9ea3f5d..13f4e78 100644
--- tools/nut-scanner/nutscan-init.c.orig
+++ tools/nut-scanner/nutscan-init.c
@@ -133,7 +133,11 @@ void nutscan_init(void)
char *libname = NULL;
#ifdef WITH_USB
#if WITH_LIBUSB_1_0
+ #ifdef __FreeBSD__
+ libname = get_libname("libusb.so");
+ #else
libname = get_libname("libusb-1.0.so");
+ #endif
#else
libname = get_libname("libusb-0.1.so");
if (!libname) {