[Bug 294624] devel/android-tools: fix libusb support support for android-tools ("super plus x2" speed disabled on FreeBSD 15 even though it is supported)

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 18 Apr 2026 21:04:43 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294624

            Bug ID: 294624
           Summary: devel/android-tools: fix libusb support support for
                    android-tools ("super plus x2" speed disabled on
                    FreeBSD 15 even though it is supported)
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: bapt@FreeBSD.org
          Reporter: jcfyecrayz@liamekaens.com
             Flags: maintainer-feedback?(bapt@FreeBSD.org)
          Assignee: bapt@FreeBSD.org

Created attachment 269911
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=269911&action=edit
[patch] properly detect libusb speeds

There is an existing patch for devel/android-tools that tries to prevent
compile failures when the LIBUSB_SPEED_SUPER_PLUS_X2 C preprocessor macro is
not defined.  But it is not defined as a C preprocessor macro, but rather it
comes from 'enum libusb_speed' in libusb.h.  So the macro is never #define'd
even when the enum name is present.

For instance, on FreeBSD 15, currently LIBUSB_SPEED_SUPER_PLUS_X2 ISdefined in
libusb.h, but it is effectively #ifdef'd out by the patch
(files/patch-vendor_adb_client_usb_libusb.cpp) even though it is supported.

Attached is a patch that uses cmake's check_symbol_exists() to detect the
presence or absence of the enum values and define a HAVE_* C preprocessor macro
if present.

Now on all supported FreeBSD versions, it builds and properly supports the
higher speeds if available in libusb.

-- 
You are receiving this mail because:
You are the assignee for the bug.