aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Urankar <mikael@FreeBSD.org>2023-06-07 05:55:21 +0000
committerMikael Urankar <mikael@FreeBSD.org>2023-06-07 05:55:57 +0000
commit2135341051ba56b5395e1b800dc11865465bd19e (patch)
tree86e872a4c2c7b7028238a3890d488eae23176150
parentfaee0d9160fbd136cb4fc4c0c0883cb8f44b8682 (diff)
multimedia/ringrtc: Fix build.
Add missing patches.
-rw-r--r--multimedia/ringrtc/files/patch-src_webrtc_src_build_toolchain_freebsd_BUILD.gn69
-rw-r--r--multimedia/ringrtc/files/patch-src_webrtc_src_ringrtc_opus_BUILD.gn18
-rw-r--r--multimedia/ringrtc/files/patch-src_webrtc_src_third__nasm_BUILD.gn16
3 files changed, 103 insertions, 0 deletions
diff --git a/multimedia/ringrtc/files/patch-src_webrtc_src_build_toolchain_freebsd_BUILD.gn b/multimedia/ringrtc/files/patch-src_webrtc_src_build_toolchain_freebsd_BUILD.gn
new file mode 100644
index 000000000000..90410ef74eb3
--- /dev/null
+++ b/multimedia/ringrtc/files/patch-src_webrtc_src_build_toolchain_freebsd_BUILD.gn
@@ -0,0 +1,69 @@
+--- ../../src/webrtc/src/build/toolchain/freebsd/BUILD.gn.orig 2022-02-07 13:39:41 UTC
++++ ../../src/webrtc/src/build/toolchain/freebsd/BUILD.gn
+@@ -0,0 +1,66 @@
++# Copyright 2013 The Chromium Authors. All rights reserved.
++# Use of this source code is governed by a BSD-style license that can be
++# found in the LICENSE file.
++
++import("//build/config/sysroot.gni")
++import("//build/toolchain/gcc_toolchain.gni")
++
++clang_toolchain("clang_x86") {
++ toolchain_args = {
++ current_cpu = "x86"
++ current_os = "freebsd"
++ }
++}
++
++gcc_toolchain("x86") {
++ cc = "gcc"
++ cxx = "g++"
++
++ readelf = "readelf"
++ nm = "nm"
++ ar = "ar"
++ ld = cxx
++
++ toolchain_args = {
++ current_cpu = "x86"
++ current_os = "freebsd"
++ is_clang = false
++ }
++}
++
++clang_toolchain("clang_x64") {
++ toolchain_args = {
++ current_cpu = "x64"
++ current_os = "freebsd"
++ }
++}
++
++gcc_toolchain("x64") {
++ cc = "gcc"
++ cxx = "g++"
++
++ readelf = "readelf"
++ nm = "nm"
++ ar = "ar"
++ ld = cxx
++
++ toolchain_args = {
++ current_cpu = "x64"
++ current_os = "freebsd"
++ is_clang = false
++ }
++}
++
++clang_toolchain("clang_arm") {
++ toolchain_args = {
++ current_cpu = "arm64"
++ current_os = "freebsd"
++ }
++}
++
++clang_toolchain("clang_arm64") {
++ toolchain_args = {
++ current_cpu = "arm64"
++ current_os = "freebsd"
++ }
++}
diff --git a/multimedia/ringrtc/files/patch-src_webrtc_src_ringrtc_opus_BUILD.gn b/multimedia/ringrtc/files/patch-src_webrtc_src_ringrtc_opus_BUILD.gn
new file mode 100644
index 000000000000..1a4cd1ccb33a
--- /dev/null
+++ b/multimedia/ringrtc/files/patch-src_webrtc_src_ringrtc_opus_BUILD.gn
@@ -0,0 +1,18 @@
+Use VAR_ARRAYS on FreeBSD (same as audio/opus)
+
+--- ../../src/webrtc/src/ringrtc/opus/BUILD.gn 2021-03-15 17:51:55 UTC
++++ ../../src/webrtc/src/ringrtc/opus/BUILD.gn
+@@ -37,10 +37,11 @@ config("opus_private_config") {
+ "OPUS_EXPORT=",
+ "ENABLE_HARDENING",
+
++ "VAR_ARRAYS",
+ # Prefer alloca() over variable length arrays which are often inefficient;
+ # the opus code will automatically handle this correctly per-platform.
+- "USE_ALLOCA",
+- "HAVE_ALLOCA_H",
++# "USE_ALLOCA",
++# "HAVE_ALLOCA_H",
+ ]
+
+ include_dirs = [
diff --git a/multimedia/ringrtc/files/patch-src_webrtc_src_third__nasm_BUILD.gn b/multimedia/ringrtc/files/patch-src_webrtc_src_third__nasm_BUILD.gn
new file mode 100644
index 000000000000..83521ea47d84
--- /dev/null
+++ b/multimedia/ringrtc/files/patch-src_webrtc_src_third__nasm_BUILD.gn
@@ -0,0 +1,16 @@
+--- ../../src/webrtc/src/third_party/nasm/BUILD.gn.orig 2023-02-01 18:45:20 UTC
++++ ../../src/webrtc/src/third_party/nasm/BUILD.gn
+@@ -63,6 +63,13 @@ config("nasm_config") {
+
+ defines = [ "HAVE_CONFIG_H" ]
+
++ _string_h_lines =
++ read_file("/usr/include/string.h", "list lines")
++ _mempcpy = filter_include(_string_h_lines, [ "*\*mempcpy*" ])
++ if (_mempcpy != []) {
++ defines += [ "HAVE_MEMPCPY=1" ]
++ }
++
+ if (is_clang) {
+ cflags = [
+ # The inline functions in NASM's headers flag this.