aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2022-05-09 17:10:33 +0000
committerCy Schubert <cy@FreeBSD.org>2022-05-09 17:49:29 +0000
commit64080a2f32ba282291fec3f9b4c6d37c7594b723 (patch)
tree72d0124fa54934e69fb928896583ecb52825a24f
parentfa59329dc39bf1fd50cea94febc0739704bbf200 (diff)
downloadports-64080a2f32ba282291fec3f9b4c6d37c7594b723.tar.gz
ports-64080a2f32ba282291fec3f9b4c6d37c7594b723.zip
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>
-rw-r--r--sysutils/nut-devel/Makefile2
-rw-r--r--sysutils/nut-devel/files/patch-tools_nut-scanner_nutscan-init.c16
-rw-r--r--sysutils/nut/Makefile2
-rw-r--r--sysutils/nut/files/patch-tools_nut-scanner_nutscan-init.c16
4 files changed, 34 insertions, 2 deletions
diff --git a/sysutils/nut-devel/Makefile b/sysutils/nut-devel/Makefile
index 7aea1a1f7a28..d72db98f03a0 100644
--- a/sysutils/nut-devel/Makefile
+++ b/sysutils/nut-devel/Makefile
@@ -2,7 +2,7 @@
PORTNAME= nut
PORTVERSION= ${NUT_COMMIT_DATE}
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES= sysutils
PKGNAMESUFFIX= -devel
# MASTER_SITES= http://www.networkupstools.org/source/${PORTVERSION:R}/
diff --git a/sysutils/nut-devel/files/patch-tools_nut-scanner_nutscan-init.c b/sysutils/nut-devel/files/patch-tools_nut-scanner_nutscan-init.c
new file mode 100644
index 000000000000..bc341494ce73
--- /dev/null
+++ b/sysutils/nut-devel/files/patch-tools_nut-scanner_nutscan-init.c
@@ -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) {
diff --git a/sysutils/nut/Makefile b/sysutils/nut/Makefile
index fcb96c79ad9d..d91fe5efc9fc 100644
--- a/sysutils/nut/Makefile
+++ b/sysutils/nut/Makefile
@@ -2,7 +2,7 @@
PORTNAME= nut
PORTVERSION= 2.8.0
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= sysutils
MASTER_SITES= http://www.networkupstools.org/source/${PORTVERSION:R}/
diff --git a/sysutils/nut/files/patch-tools_nut-scanner_nutscan-init.c b/sysutils/nut/files/patch-tools_nut-scanner_nutscan-init.c
new file mode 100644
index 000000000000..bc341494ce73
--- /dev/null
+++ b/sysutils/nut/files/patch-tools_nut-scanner_nutscan-init.c
@@ -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) {