aboutsummaryrefslogtreecommitdiff
path: root/www/ungoogled-chromium/files/patch-third__party_libusb_BUILD.gn
blob: 7a8fdd429b8647139e023ec37840e3ae2e26ee43 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
--- third_party/libusb/BUILD.gn.orig	2022-10-01 07:40:07 UTC
+++ third_party/libusb/BUILD.gn
@@ -3,7 +3,7 @@
 # found in the LICENSE file.
 
 # libusb is only used by //services/device/usb on macOS.
-assert(is_mac)
+assert(is_mac || is_bsd)
 
 import("//build/config/chromeos/ui_mode.gni")
 import("//build/config/features.gni")
@@ -116,7 +116,7 @@ static_library("libusb") {
     ]
   }
 
-  if (is_linux || is_chromeos) {
+  if ((is_linux || is_chromeos) && !is_bsd) {
     sources += [
       "src/libusb/os/linux_usbfs.c",
       "src/libusb/os/linux_usbfs.h",
@@ -127,6 +127,16 @@ static_library("libusb") {
     ]
   }
 
+  if (is_openbsd) {
+    sources += [
+      "src/libusb/os/openbsd_usb.c",
+    ]
+    defines += [
+      "OS_OPENBSD=1",
+      "_GNU_SOURCE=1",
+    ]
+  }
+
   if (is_chromeos_ash) {
     defines += [ "USBI_TIMERFD_AVAILABLE" ]
   }
@@ -140,7 +150,7 @@ static_library("libusb") {
     deps += [ "//build/linux/libudev" ]
   }
 
-  if ((is_linux || is_chromeos) && !use_udev) {
+  if ((is_linux || is_chromeos) && !use_udev && !is_bsd) {
     sources += [ "src/libusb/os/linux_netlink.c" ]
     defines += [ "HAVE_LINUX_NETLINK_H" ]
   }