diff options
Diffstat (limited to 'www/chromium-uc/patches/patch-third_party_libusb_BUILD_gn')
| -rw-r--r-- | www/chromium-uc/patches/patch-third_party_libusb_BUILD_gn | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/www/chromium-uc/patches/patch-third_party_libusb_BUILD_gn b/www/chromium-uc/patches/patch-third_party_libusb_BUILD_gn new file mode 100644 index 0000000..605161d --- /dev/null +++ b/www/chromium-uc/patches/patch-third_party_libusb_BUILD_gn | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | $OpenBSD: patch-third_party_libusb_BUILD_gn,v 1.14 2021/11/16 11:28:47 robert Exp $ | ||
| 2 | |||
| 3 | Index: third_party/libusb/BUILD.gn | ||
| 4 | --- third_party/libusb/BUILD.gn.orig | ||
| 5 | +++ third_party/libusb/BUILD.gn | ||
| 6 | @@ -3,7 +3,7 @@ | ||
| 7 | # found in the LICENSE file. | ||
| 8 | |||
| 9 | # libusb is only used by //services/device/usb on macOS. | ||
| 10 | -assert(is_mac) | ||
| 11 | +assert(is_mac || is_openbsd) | ||
| 12 | |||
| 13 | import("//build/config/chromeos/ui_mode.gni") | ||
| 14 | import("//build/config/features.gni") | ||
| 15 | @@ -116,7 +116,7 @@ static_library("libusb") { | ||
| 16 | ] | ||
| 17 | } | ||
| 18 | |||
| 19 | - if (is_linux || is_chromeos) { | ||
| 20 | + if ((is_linux || is_chromeos) && !is_openbsd) { | ||
| 21 | sources += [ | ||
| 22 | "src/libusb/os/linux_usbfs.c", | ||
| 23 | "src/libusb/os/linux_usbfs.h", | ||
| 24 | @@ -127,6 +127,16 @@ static_library("libusb") { | ||
| 25 | ] | ||
| 26 | } | ||
| 27 | |||
| 28 | + if (is_openbsd) { | ||
| 29 | + sources += [ | ||
| 30 | + "src/libusb/os/openbsd_usb.c", | ||
| 31 | + ] | ||
| 32 | + defines += [ | ||
| 33 | + "OS_OPENBSD=1", | ||
| 34 | + "_GNU_SOURCE=1", | ||
| 35 | + ] | ||
| 36 | + } | ||
| 37 | + | ||
| 38 | if (is_chromeos_ash) { | ||
| 39 | defines += [ "USBI_TIMERFD_AVAILABLE" ] | ||
| 40 | } | ||
| 41 | @@ -140,7 +150,7 @@ static_library("libusb") { | ||
| 42 | deps += [ "//build/linux/libudev" ] | ||
| 43 | } | ||
| 44 | |||
| 45 | - if ((is_linux || is_chromeos) && !use_udev) { | ||
| 46 | + if ((is_linux || is_chromeos) && !use_udev && !is_openbsd) { | ||
| 47 | sources += [ "src/libusb/os/linux_netlink.c" ] | ||
| 48 | defines += [ "HAVE_LINUX_NETLINK_H" ] | ||
| 49 | } | ||
