Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Showing
4 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
sysutils/nut-devel/files/patch-tools_nut-scanner_nutscan-init.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
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) { |