aboutsummaryrefslogtreecommitdiff
path: root/www/librewolf/files/patch-third__party_libwebrtc_build_config_BUILDCONFIG.gn
blob: 7774855c79411f7ebf8d515ea5c83e5709bceb5c (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
commit e8a3b91abdc00edd7633aabbe5e63bfc0d0825e4
Author: Christoph Moench-Tegeder <cmt@FreeBSD.org>

    enable pipewire on bsd

diff --git third_party/chromium/build/config/BUILDCONFIG.gn third_party/chromium/build/config/BUILDCONFIG.gn
index 4bb38fe31ff2..b10eb19f521a 100644
--- third_party/chromium/build/config/BUILDCONFIG.gn
+++ third_party/chromium/build/config/BUILDCONFIG.gn
@@ -137,6 +137,7 @@ declare_args() {
 
   # Set to true when compiling with the Clang compiler.
   is_clang = current_os != "linux" || current_os == "openbsd" ||
+              current_os == "freebsd" ||
              (current_cpu != "s390x" && current_cpu != "s390" &&
               current_cpu != "ppc64" && current_cpu != "ppc" &&
               current_cpu != "mips" && current_cpu != "mips64" &&
@@ -206,7 +207,7 @@ if (host_toolchain == "") {
   # TODO(dpranke): Add some sort of assert here that verifies that
   # no toolchain omitted host_toolchain from its toolchain_args().
 
-  if (host_os == "linux" || host_os == "openbsd") {
+  if (host_os == "linux" || host_os == "openbsd" || host_os == "freebsd") {
     if (target_os != "linux") {
       host_toolchain = "//chromium/build/toolchain/linux:clang_$host_cpu"
     } else if (is_clang) {
@@ -246,7 +247,7 @@ if (target_os == "android") {
   # Targeting android on Mac is best-effort and not guaranteed to work.
   #assert(host_os == "linux", "Android builds are only supported on Linux.")
   _default_toolchain = "//chromium/build/toolchain/android:android_clang_$target_cpu"
-} else if (target_os == "chromeos" || target_os == "linux" || target_os == "openbsd") {
+} else if (target_os == "chromeos" || target_os == "linux" || target_os == "openbsd" || target_os == "freebsd") {
   # See comments in build/toolchain/cros/BUILD.gn about board compiles.
   if (is_clang) {
     _default_toolchain = "//chromium/build/toolchain/linux:clang_$target_cpu"
@@ -314,7 +315,7 @@ is_chromeos = current_os == "chromeos"
 is_fuchsia = current_os == "fuchsia"
 is_ios = current_os == "ios"
 is_linux = current_os == "linux"
-is_bsd = current_os == "openbsd"
+is_bsd = current_os == "openbsd" || current_os == "freebsd"
 is_mac = current_os == "mac"
 is_nacl = current_os == "nacl"
 is_wasm = current_os == "emscripten"
diff --git third_party/libwebrtc/BUILD.gn third_party/libwebrtc/BUILD.gn
index ac8569efaa40..5d6c5953491c 100644
--- third_party/libwebrtc/BUILD.gn
+++ third_party/libwebrtc/BUILD.gn
@@ -111,7 +111,7 @@ if (!build_with_chromium && !build_with_mozilla) {
           "tools_webrtc/perf:webrtc_dashboard_upload",
         ]
       }
-      if ((is_linux || is_chromeos) && rtc_use_pipewire) {
+      if ((is_linux || is_chromeos || is_bsd) && rtc_use_pipewire) {
         deps += [ "modules/desktop_capture:shared_screencast_stream_test" ]
       }
     }
diff --git third_party/libwebrtc/modules/desktop_capture/BUILD.gn third_party/libwebrtc/modules/desktop_capture/BUILD.gn
index 5c843cfc2b6a..0ed9f98a964f 100644
--- third_party/libwebrtc/modules/desktop_capture/BUILD.gn
+++ third_party/libwebrtc/modules/desktop_capture/BUILD.gn
@@ -76,7 +76,7 @@ if (rtc_include_tests) {
         "window_finder_unittest.cc",
       ]
 
-      if ((is_linux || is_chromeos) && rtc_use_pipewire) {
+      if ((is_linux || is_chromeos || is_bsd) && rtc_use_pipewire) {
         configs += [ "../portal:gio" ]
       }
 
@@ -88,7 +88,7 @@ if (rtc_include_tests) {
     }
   }
 
-  if ((is_linux || is_chromeos) && rtc_use_pipewire) {
+  if ((is_linux || is_chromeos || is_bsd) && rtc_use_pipewire) {
     rtc_test("shared_screencast_stream_test") {
       testonly = true
 
@@ -148,7 +148,7 @@ if (rtc_include_tests) {
       "test_utils_unittest.cc",
     ]
 
-    if ((is_linux || is_chromeos) && rtc_use_pipewire) {
+    if ((is_linux || is_chromeos || is_bsd) && rtc_use_pipewire) {
       configs += [ "../portal:gio" ]
     }
 
@@ -215,7 +215,7 @@ if (rtc_include_tests) {
       "screen_drawer.h",
     ]
 
-    if (is_linux || is_chromeos) {
+    if (is_linux || is_chromeos || is_bsd) {
       sources += [ "screen_drawer_linux.cc" ]
       libs = [ "X11" ]
     }
@@ -254,7 +254,7 @@ if (rtc_include_tests) {
       "mock_desktop_capturer_callback.h",
     ]
 
-    if ((is_linux || is_chromeos) && rtc_use_pipewire) {
+    if ((is_linux || is_chromeos || us_bsd) && rtc_use_pipewire) {
       configs += [ "../portal:gio" ]
     }
 
@@ -267,7 +267,7 @@ if (rtc_include_tests) {
 }
 
 # TODO(bugs.webrtc.org/14187): remove when all users are gone
-if ((is_linux || is_chromeos) && rtc_use_pipewire) {
+if ((is_linux || is_chromeos || is_bsd) && rtc_use_pipewire) {
   config("pipewire_config") {
     configs = [ "../portal:pipewire_config" ]
   }
diff --git third_party/libwebrtc/modules/portal/BUILD.gn third_party/libwebrtc/modules/portal/BUILD.gn
index 70b4739ad0c4..99ab95d441f3 100644
--- third_party/libwebrtc/modules/portal/BUILD.gn
+++ third_party/libwebrtc/modules/portal/BUILD.gn
@@ -10,7 +10,7 @@ import("//chromium/build/config/linux/pkg_config.gni")
 import("//tools/generate_stubs/rules.gni")
 import("../../webrtc.gni")
 
-if ((is_linux || is_chromeos) && rtc_use_pipewire) {
+if ((is_linux || is_chromeos || is_bsd) && rtc_use_pipewire) {
 if (!build_with_mozilla) {
   pkg_config("gio") {
     packages = [
diff --git third_party/libwebrtc/webrtc.gni third_party/libwebrtc/webrtc.gni
index 1e87de20e545..77a8a55d8659 100644
--- third_party/libwebrtc/webrtc.gni
+++ third_party/libwebrtc/webrtc.gni
@@ -151,7 +151,7 @@ declare_args() {
   # By default it's only enabled on desktop Linux (excludes ChromeOS) and
   # only when using the sysroot as PipeWire is not available in older and
   # supported Ubuntu and Debian distributions.
-  rtc_use_pipewire = is_linux && use_sysroot
+  rtc_use_pipewire = (is_linux || is_bsd) && use_sysroot
 
   # Set this to link PipeWire and required libraries directly instead of using the dlopen.
   rtc_link_pipewire = false