From 34923d91a9e2397e596f8119c4943beb02790979 Mon Sep 17 00:00:00 2001 From: Niklas Korz Date: Thu, 9 Jul 2026 10:19:13 +0200 Subject: [PATCH] livekit-libwebrtc: fix compiler warnings --- pkgs/by-name/li/livekit-libwebrtc/package.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/by-name/li/livekit-libwebrtc/package.nix b/pkgs/by-name/li/livekit-libwebrtc/package.nix index 7ea48483a9df..f7e1fd2e88b3 100644 --- a/pkgs/by-name/li/livekit-libwebrtc/package.nix +++ b/pkgs/by-name/li/livekit-libwebrtc/package.nix @@ -139,6 +139,10 @@ stdenv.mkDerivation { --replace-fail "rtc_static_library" "rtc_shared_library" \ --replace-fail "complete_static_lib = true" "" + # Remove the libcxx hardening config to avoid clashes with nixpkgs' own compiler wrapper, + # which already defines the hardening macros. + sed -i '/config("libcxx_hardening") {/,/^}/c\config("libcxx_hardening") {}' build/config/compiler/BUILD.gn + substituteInPlace webrtc.gni \ --replace-fail "!build_with_chromium && is_component_build" "false" @@ -179,6 +183,11 @@ stdenv.mkDerivation { chmod +x build/toolchain/apple/linker_driver.py patchShebangs build/toolchain/apple/linker_driver.py substituteInPlace build/toolchain/apple/toolchain.gni --replace-fail "/bin/cp -Rc" "cp -a" + + # nixpkgs calls the target "darwin" instead of "macos", and passing a different target + # results in warnings by the nixpkgs compiler wrapper + substituteInPlace build/config/mac/BUILD.gn \ + --replace-fail '$clang_arch-apple-macos' '$clang_arch-apple-darwin' ''; outputs = [