Skip to content

Commit

Permalink
livekit-libwebrtc: fix builds on darwin (NixOS#368147)
Browse files Browse the repository at this point in the history
  • Loading branch information
GaetanLepage authored Dec 25, 2024
2 parents 444c1e0 + 3082f67 commit 138326d
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/BUILD.gn b/BUILD.gn
index 598bbbcb72..62c6c5a187 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -138,7 +138,7 @@ config("library_impl_config") {
# target_defaults and direct_dependent_settings.
config("common_inherited_config") {
defines = []
- cflags = [ "-fvisibility=default" ]
+ cflags = [ "-fvisibility=default", "-Wno-error=c++11-narrowing-const-reference" ]
ldflags = [ "-lavutil", "-lavformat", "-lavcodec" ]

if (rtc_dlog_always_on) {
52 changes: 28 additions & 24 deletions pkgs/by-name/li/livekit-libwebrtc/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -78,30 +78,34 @@ stdenv.mkDerivation {

src = "${sources}/src";

patches = [
# Adds missing dependencies to generated LICENSE
(fetchpatch {
url = "https://raw.githubusercontent.com/livekit/rust-sdks/b41861c7b71762d5d85b3de07ae67ffcae7c3fa2/webrtc-sys/libwebrtc/patches/add_licenses.patch";
hash = "sha256-9A4KyRW1K3eoQxsTbPX0vOnj66TCs2Fxjpsu5wO8mGI=";
})
# Fixes the certificate chain, required for Let's Encrypt certs
(fetchpatch {
url = "https://raw.githubusercontent.com/livekit/rust-sdks/b41861c7b71762d5d85b3de07ae67ffcae7c3fa2/webrtc-sys/libwebrtc/patches/ssl_verify_callback_with_native_handle.patch";
hash = "sha256-/gneuCac4VGJCWCjJZlgLKFOTV+x7Lc5KVFnNIKenwM=";
})
# Adds dependencies and features required by livekit
(fetchpatch {
url = "https://raw.githubusercontent.com/livekit/rust-sdks/b41861c7b71762d5d85b3de07ae67ffcae7c3fa2/webrtc-sys/libwebrtc/patches/add_deps.patch";
hash = "sha256-EMNYcTcBYh51Tt96+HP43ND11qGKClfx3xIPQmIBSo0=";
})
# Fixes concurrency and localization issues
(fetchpatch {
url = "https://github.com/zed-industries/webrtc/commit/08f7a701a2eda6407670508fc2154257a3c90308.patch";
hash = "sha256-oWYZLwqjRSHDt92MqsxsoBSMyZKj1ubNbOXZRbPpbEw=";
})
# Required for dynamically linking to ffmpeg libraries and exposing symbols
./0001-shared-libraries.patch
];
patches =
[
# Adds missing dependencies to generated LICENSE
(fetchpatch {
url = "https://raw.githubusercontent.com/livekit/rust-sdks/b41861c7b71762d5d85b3de07ae67ffcae7c3fa2/webrtc-sys/libwebrtc/patches/add_licenses.patch";
hash = "sha256-9A4KyRW1K3eoQxsTbPX0vOnj66TCs2Fxjpsu5wO8mGI=";
})
# Fixes the certificate chain, required for Let's Encrypt certs
(fetchpatch {
url = "https://raw.githubusercontent.com/livekit/rust-sdks/b41861c7b71762d5d85b3de07ae67ffcae7c3fa2/webrtc-sys/libwebrtc/patches/ssl_verify_callback_with_native_handle.patch";
hash = "sha256-/gneuCac4VGJCWCjJZlgLKFOTV+x7Lc5KVFnNIKenwM=";
})
# Adds dependencies and features required by livekit
(fetchpatch {
url = "https://raw.githubusercontent.com/livekit/rust-sdks/b41861c7b71762d5d85b3de07ae67ffcae7c3fa2/webrtc-sys/libwebrtc/patches/add_deps.patch";
hash = "sha256-EMNYcTcBYh51Tt96+HP43ND11qGKClfx3xIPQmIBSo0=";
})
# Fixes concurrency and localization issues
(fetchpatch {
url = "https://github.com/zed-industries/webrtc/commit/08f7a701a2eda6407670508fc2154257a3c90308.patch";
hash = "sha256-oWYZLwqjRSHDt92MqsxsoBSMyZKj1ubNbOXZRbPpbEw=";
})
# Required for dynamically linking to ffmpeg libraries and exposing symbols
./0001-shared-libraries.patch
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
./0002-disable-narrowing-const-reference.patch
];

postPatch =
''
Expand Down

0 comments on commit 138326d

Please sign in to comment.