git: d4329efdcdfb - main - devel/android-tools: attempt to fix build on FreeBSD 14
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 12 Jun 2026 15:50:57 UTC
The branch main has been updated by bapt:
URL: https://cgit.FreeBSD.org/ports/commit/?id=d4329efdcdfb755f4bdd62583a1468e25e696391
commit d4329efdcdfb755f4bdd62583a1468e25e696391
Author: Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2026-06-10 16:02:25 +0000
Commit: Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2026-06-12 15:50:33 +0000
devel/android-tools: attempt to fix build on FreeBSD 14
---
.../files/patch-vendor_adb_client_usb_libusb.cpp | 25 ++++++++++++----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/devel/android-tools/files/patch-vendor_adb_client_usb_libusb.cpp b/devel/android-tools/files/patch-vendor_adb_client_usb_libusb.cpp
index eb215f1e08a9..004d7a251eba 100644
--- a/devel/android-tools/files/patch-vendor_adb_client_usb_libusb.cpp
+++ b/devel/android-tools/files/patch-vendor_adb_client_usb_libusb.cpp
@@ -1,5 +1,5 @@
---- vendor/adb/client/usb_libusb.cpp.orig 2024-08-29 19:46:57.000000000 +0200
-+++ vendor/adb/client/usb_libusb.cpp 2026-04-13 19:58:23.616588000 +0200
+--- vendor/adb/client/usb_libusb.cpp.orig 2024-08-29 17:46:57 UTC
++++ vendor/adb/client/usb_libusb.cpp
@@ -38,6 +38,8 @@
#ifdef ANDROID_TOOLS_USE_BUNDLED_LIBUSB
@@ -9,10 +9,14 @@
#else
#include <libusb-1.0/libusb.h>
#endif
-@@ -507,8 +509,10 @@
+@@ -505,10 +507,14 @@ struct LibusbConnection : public Connection {
+ return 480;
+ case LIBUSB_SPEED_SUPER:
return 5000;
++#ifdef LIBUSB_SPEED_SUPER_PLUS
case LIBUSB_SPEED_SUPER_PLUS:
return 10000;
++#endif
+#ifdef LIBUSB_SPEED_SUPER_PLUS_X2
case LIBUSB_SPEED_SUPER_PLUS_X2:
return 20000;
@@ -20,15 +24,14 @@
case LIBUSB_SPEED_UNKNOWN:
default:
return 0;
-@@ -526,20 +530,23 @@
+@@ -526,20 +532,23 @@ struct LibusbConnection : public Connection {
msb++;
}
-- switch (1 << msb) {
-- case LIBUSB_LOW_SPEED_OPERATION:
+ // Use literal values from 'enum libusb_supported_speed' (USB spec defined bits)
+ // to remain portable across libusb implementations that may not expose the enum.
-+ switch (1 << msb) {
+ switch (1 << msb) {
+- case LIBUSB_LOW_SPEED_OPERATION:
+ case (1 << 0): // LIBUSB_LOW_SPEED_OPERATION
return 1;
- case LIBUSB_FULL_SPEED_OPERATION:
@@ -49,7 +52,7 @@
static uint64_t ExtractMaxSuperSpeedPlus(libusb_ssplus_usb_device_capability_descriptor* cap) {
// The exponents is one of {bytes, kB, MB, or GB}. We express speed in MB so we use a 0
// multiplier for value which would result in 0MB anyway.
-@@ -552,6 +559,7 @@
+@@ -552,6 +561,7 @@ struct LibusbConnection : public Connection {
}
return max_speed;
}
@@ -57,7 +60,7 @@
void RetrieveSpeeds() {
negotiated_speed_ = ToConnectionSpeed(libusb_get_device_speed(device_.get()));
-@@ -563,7 +571,9 @@
+@@ -563,7 +573,9 @@ struct LibusbConnection : public Connection {
return;
}
@@ -68,7 +71,7 @@
switch (bos->dev_capability[i]->bDevCapabilityType) {
case LIBUSB_BT_SS_USB_DEVICE_CAPABILITY: {
libusb_ss_usb_device_capability_descriptor* cap = nullptr;
-@@ -574,6 +584,7 @@
+@@ -574,6 +586,7 @@ struct LibusbConnection : public Connection {
libusb_free_ss_usb_device_capability_descriptor(cap);
}
} break;
@@ -76,7 +79,7 @@
case LIBUSB_BT_SUPERSPEED_PLUS_CAPABILITY: {
libusb_ssplus_usb_device_capability_descriptor* cap = nullptr;
if (!libusb_get_ssplus_usb_device_capability_descriptor(
-@@ -582,6 +593,7 @@
+@@ -582,6 +595,7 @@ struct LibusbConnection : public Connection {
libusb_free_ssplus_usb_device_capability_descriptor(cap);
}
} break;