Unverified Commit 396540d0 authored by Niklas Korz's avatar Niklas Korz Committed by GitHub
Browse files

livekit-libwebrtc: 125-unstable-2025-03-24 -> 125-unstable-2025-07-25, use...

livekit-libwebrtc: 125-unstable-2025-03-24 -> 125-unstable-2025-07-25, use nixpkgs gclient2nix and fix updateScript (#462229)
parents aefb3311 31a950ea
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
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) {
+0 −61
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  flit-core,
  click,
  nurl,
  nix-prefetch-git,
  nix,
  coreutils,
  nixfmt,
  makeWrapper,
}:
# Based on https://github.com/milahu/gclient2nix
# but with libwebrtc-specific changes.
let
  nativeDeps = [
    nurl
    nix-prefetch-git
    nix
    coreutils
    nixfmt
  ];
in
buildPythonPackage {
  pname = "gclient2nix";
  version = "0.2.0-unstable-2025-04-04";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "WeetHet";
    repo = "gclient2nix";
    rev = "ec5fff1082cd4fff352e4c57baf9b1a7dbbcc94b";
    hash = "sha256-BK8GUpuqFOeK5d5wKVFYCfR5f6jCrke/2xxoVlmKpRI=";
  };

  build-system = [
    flit-core
  ];

  dependencies = [
    click
  ];

  nativeBuildInputs = [ makeWrapper ];

  postFixup = ''
    wrapProgram $out/bin/gclient2nix \
      --set PATH ${lib.makeBinPath nativeDeps}
  '';

  meta = {
    description = "Generate Nix expressions for projects based on the Google build tools";
    homepage = "https://github.com/WeetHet/gclient2nix";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [
      WeetHet
    ];
    mainProgram = "gclient2nix";
  };
}
+6 −26
Original line number Diff line number Diff line
{
  stdenv,
  clang,
  callPackage,
  gclient2nix,
  lib,
  gn,
  fetchurl,
@@ -29,11 +29,8 @@
  libxslt,
  minizip,
  ffmpeg_6,
  writeShellScript,
}:
let
  sources = callPackage ./sources.nix { };

  platformMap = {
    "x86_64" = "x64";
    "i686" = "x86";
@@ -69,13 +66,13 @@ let
      ffmpeg_6
      ;
  };
  gclient2nix = python3.pkgs.callPackage ./gclient2nix.nix { };
in
stdenv.mkDerivation {
  pname = "livekit-libwebrtc";
  version = "125-unstable-2025-03-24";
  version = "125-unstable-2025-07-25";

  src = "${sources}/src";
  gclientDeps = gclient2nix.importGclientDeps ./sources.json;
  sourceRoot = "src";

  patches = [
    # Adds missing dependencies to generated LICENSE
@@ -103,20 +100,6 @@ stdenv.mkDerivation {
    })
    # 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
  ]
  ++ lib.optionals stdenv.hostPlatform.isLinux [
    # GCC does not support C11 _Generic in C++ mode. Fixes boringssl build with GCC
    (fetchpatch {
      name = "fix-gcc-c11-generic-boringssl";

      url = "https://github.com/google/boringssl/commit/c70190368c7040c37c1d655f0690bcde2b109a0d.patch";
      hash = "sha256-xkmYulDOw5Ny5LOCl7rsheZSFbSF6md2NkZ3+azjFQk=";
      stripLen = 1;
      extraPrefix = "third_party/boringssl/src/";
    })
  ];

  postPatch = ''
@@ -173,6 +156,7 @@ stdenv.mkDerivation {
      ) gnSystemLibraries
    ))
    ++ [
      gclient2nix.gclientUnpackHook
      gn
      (python3.withPackages (ps: [ ps.setuptools ]))
      ninja
@@ -295,11 +279,7 @@ stdenv.mkDerivation {
    install_name_tool -change @rpath/libthird_party_boringssl.dylib "$boringssl" "$webrtc"
  '';

  passthru.updateScript = writeShellScript "update-livekit-libwebrtc" ''
    set -eou pipefail
    cd pkgs/by-name/li/livekit-libwebrtc
    ${lib.getExe gclient2nix} --main-source-path src https://github.com/webrtc-sdk/webrtc.git m114_release
  '';
  passthru.updateScript = ./update.sh;

  meta = {
    description = "WebRTC library used by livekit";
+356 −0
Original line number Diff line number Diff line
{
    "src": {
        "args": {
            "hash": "sha256-zSWjPxcrvLpi+zaJ+GReG3YsjPKqxBdkKfe8Gj/O0dA=",
            "owner": "webrtc-sdk",
            "repo": "webrtc",
            "rev": "db3ba7af86dd6d48174ed35387d11c0794f1a21b"
        },
        "fetcher": "fetchFromGitHub"
    },
    "src/base": {
        "args": {
            "hash": "sha256-Hw0cXws+0M2UcvcnJZGkUtH28ZEDfxNl0e8ngWlAZnA=",
            "rev": "738cf0c976fd3d07c5f1853f050594c5295300d8",
            "url": "https://chromium.googlesource.com/chromium/src/base"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/build": {
        "args": {
            "hash": "sha256-mPjb7/TTJ7/oatBdIRGhSsacjbyu5ZilUgyplAtji1s=",
            "owner": "webrtc-sdk",
            "repo": "build",
            "rev": "6978bac6466311e4bee4c7a9fd395faa939e0fcd"
        },
        "fetcher": "fetchFromGitHub"
    },
    "src/buildtools": {
        "args": {
            "hash": "sha256-OS9k7sDzAVH+NU9P4ilKJavkiov/1qq1fG5AWq9kH/Y=",
            "rev": "5eb927f0a922dfacf10cfa84ee76f39dcf2a7311",
            "url": "https://chromium.googlesource.com/chromium/src/buildtools"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/testing": {
        "args": {
            "hash": "sha256-VisK7NDR/xDC3OM7LD9Gyo58rs1GE37i7QRYC/Kk12k=",
            "rev": "d6e731571c33f30e5dc46f54c69e6d432566e55c",
            "url": "https://chromium.googlesource.com/chromium/src/testing"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party": {
        "args": {
            "hash": "sha256-TdB8qMcmXO3xgYyJkHHwn/8tVg1pFMlrNABpQQ80bOY=",
            "rev": "f36c4b6e56aaa94606c87fa0c3f7cbdbb5c70546",
            "url": "https://chromium.googlesource.com/chromium/src/third_party"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/boringssl/src": {
        "args": {
            "hash": "sha256-Ln6rnbn2hwszst24E/6EpP2C3Scoppe7wvVKFtxuPjQ=",
            "rev": "12391e648d3c6f04a718721568cc89208b780654",
            "url": "https://boringssl.googlesource.com/boringssl.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/breakpad/breakpad": {
        "args": {
            "hash": "sha256-qAIXZ1jZous0Un0jVkOQ66nA2525NziV3Lbso2/+Z1Y=",
            "rev": "76788faa4ef163081f82273bfca7fae8a734b971",
            "url": "https://chromium.googlesource.com/breakpad/breakpad.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/catapult": {
        "args": {
            "hash": "sha256-uqtyxO7Ge3egBsYmwcRGiV1lqm4iYVHrqYfDz7r6Byo=",
            "rev": "88367fd8c736a2601fc183920c9ffe9ac2ec32ac",
            "url": "https://chromium.googlesource.com/catapult.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/ced/src": {
        "args": {
            "hash": "sha256-ySG74Rj2i2c/PltEgHVEDq+N8yd9gZmxNktc56zIUiY=",
            "rev": "ba412eaaacd3186085babcd901679a48863c7dd5",
            "url": "https://chromium.googlesource.com/external/github.com/google/compact_enc_det.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/clang-format/script": {
        "args": {
            "hash": "sha256-whD8isX2ZhLrFzdxHhFP1S/sZDRgyrzLFaVd7OEFqYo=",
            "rev": "3c0acd2d4e73dd911309d9e970ba09d58bf23a62",
            "url": "https://chromium.googlesource.com/external/github.com/llvm/llvm-project/clang/tools/clang-format.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/colorama/src": {
        "args": {
            "hash": "sha256-6ZTdPYSHdQOLYMSnE+Tp7PgsVTs3U2awGu9Qb4Rg/tk=",
            "rev": "3de9f013df4b470069d03d250224062e8cf15c49",
            "url": "https://chromium.googlesource.com/external/colorama.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/crc32c/src": {
        "args": {
            "hash": "sha256-urg0bmnfMfHagLPELp4WrNCz1gBZ6DFOWpDue1KsMtc=",
            "rev": "fa5ade41ee480003d9c5af6f43567ba22e4e17e6",
            "url": "https://chromium.googlesource.com/external/github.com/google/crc32c.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/dav1d/libdav1d": {
        "args": {
            "hash": "sha256-AA2bcrsW1xFspyl5TqYUJeAwKM06rWTNtXr/uMVIJmw=",
            "rev": "006ca01d387ac6652825d6cce1a57b2de67dbf8d",
            "url": "https://chromium.googlesource.com/external/github.com/videolan/dav1d.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/depot_tools": {
        "args": {
            "hash": "sha256-RguGUaIpxtxrY+LksFmeNbZuitZpB6O9HJc1c4TMXeQ=",
            "rev": "495b23b39aaba2ca3b55dd27cadc523f1cb17ee6",
            "url": "https://chromium.googlesource.com/chromium/tools/depot_tools.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/ffmpeg": {
        "args": {
            "hash": "sha256-6+Sc5DsPaKW68PSUS4jlpzRXjPhEN7LFQATVVL9Xhfo=",
            "rev": "901248a373cbbe7af68fb92faf3be7d4f679150d",
            "url": "https://chromium.googlesource.com/chromium/third_party/ffmpeg.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/flatbuffers/src": {
        "args": {
            "hash": "sha256-LecJwLDG6szZZ/UOCFD+MDqH3NKawn0sdEwgnMt8wMM=",
            "rev": "bcb9ef187628fe07514e57756d05e6a6296f7dc5",
            "url": "https://chromium.googlesource.com/external/github.com/google/flatbuffers.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/fontconfig/src": {
        "args": {
            "hash": "sha256-W5WIgC6A52kY4fNkbsDEa0o+dfd97Rl5NKfgnIRpI00=",
            "rev": "14d466b30a8ab4a9d789977ed94f2c30e7209267",
            "url": "https://chromium.googlesource.com/external/fontconfig.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/freetype/src": {
        "args": {
            "hash": "sha256-XBHWUw28bsCpwUXb+faE36DRdujuKiWoJ+dEmUk07s4=",
            "rev": "b3a6a20a805366e0bc7044d1402d04c53f9c1660",
            "url": "https://chromium.googlesource.com/chromium/src/third_party/freetype2.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/fuzztest/src": {
        "args": {
            "hash": "sha256-8w4yIW15VamdjevMO27NYuf+GFu5AvHSooDZH0PbS6s=",
            "rev": "65354bf09a2479945b4683c42948695d4f2f7c07",
            "url": "https://chromium.googlesource.com/external/github.com/google/fuzztest.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/google_benchmark/src": {
        "args": {
            "hash": "sha256-gztnxui9Fe/FTieMjdvfJjWHjkImtlsHn6fM1FruyME=",
            "rev": "344117638c8ff7e239044fd0fa7085839fc03021",
            "url": "https://chromium.googlesource.com/external/github.com/google/benchmark.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/googletest/src": {
        "args": {
            "hash": "sha256-JCIJrjN/hH6oAgvJRuv3aJA+z6Qe7yefyRbAhP5bZDc=",
            "rev": "5197b1a8e6a1ef9f214f4aa537b0be17cbf91946",
            "url": "https://chromium.googlesource.com/external/github.com/google/googletest.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/grpc/src": {
        "args": {
            "hash": "sha256-64JEVCx/PCM0dvv7kAQvSjLc0QbRAZVBDzwD/FAV6T8=",
            "rev": "822dab21d9995c5cf942476b35ca12a1aa9d2737",
            "url": "https://chromium.googlesource.com/external/github.com/grpc/grpc.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/gtest-parallel": {
        "args": {
            "hash": "sha256-VUuk5tBTh+aU2dxVWUF1FePWlKUJaWSiGSXk/J5zgHw=",
            "rev": "96f4f904922f9bf66689e749c40f314845baaac8",
            "url": "https://chromium.googlesource.com/external/github.com/google/gtest-parallel"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/harfbuzz-ng/src": {
        "args": {
            "hash": "sha256-VAan6P8PHSq8RsGE4YbI/wCfFAhzl3nJMt0cQBYi5Ls=",
            "rev": "155015f4bec434ecc2f94621665844218f05ce51",
            "url": "https://chromium.googlesource.com/external/github.com/harfbuzz/harfbuzz.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/icu": {
        "args": {
            "hash": "sha256-frsmwYMiFixEULsE91x5+p98DvkyC0s0fNupqjoRnvg=",
            "rev": "364118a1d9da24bb5b770ac3d762ac144d6da5a4",
            "url": "https://chromium.googlesource.com/chromium/deps/icu.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/instrumented_libs": {
        "args": {
            "hash": "sha256-SGEB74fK9e0WWT77ZNISE9fVlXGGPvZMBUsQ3XD+DsA=",
            "rev": "0172d67d98df2d30bd2241959d0e9569ada25abe",
            "url": "https://chromium.googlesource.com/chromium/third_party/instrumented_libraries.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/jsoncpp/source": {
        "args": {
            "hash": "sha256-bSLNcoYBz3QCt5VuTR056V9mU2PmBuYBa0W6hFg2m8Q=",
            "rev": "42e892d96e47b1f6e29844cc705e148ec4856448",
            "url": "https://chromium.googlesource.com/external/github.com/open-source-parsers/jsoncpp.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/libFuzzer/src": {
        "args": {
            "hash": "sha256-T0dO+1A0r6kLFoleMkY8heu80biPntCpvA6YfqA7b+E=",
            "rev": "758bd21f103a501b362b1ca46fa8fcb692eaa303",
            "url": "https://chromium.googlesource.com/external/github.com/llvm/llvm-project/compiler-rt/lib/fuzzer.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/libaom/source/libaom": {
        "args": {
            "hash": "sha256-0tLfbfYyCnG89DHNIoYoiitN9pFFcuX/Nymp3Q5xhBg=",
            "rev": "eefd5585a0c4c204fcf7d30065f8c2ca35c38a82",
            "url": "https://aomedia.googlesource.com/aom.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/libc++/src": {
        "args": {
            "hash": "sha256-ocJqlENHw19VpkFxKwHneGw3aNh56nt+/JeopxLj2M8=",
            "rev": "e3b94d0e5b86883fd77696bf10dc33ba250ba99b",
            "url": "https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxx.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/libc++abi/src": {
        "args": {
            "hash": "sha256-qBupfCAnSNpvqcwFycQEi5v6TBAH5LdQI5YcLeQD2y8=",
            "rev": "932d253fedb390a08b17ec3a92469a4553934a6a",
            "url": "https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/libjpeg_turbo": {
        "args": {
            "hash": "sha256-+t75ZAdOXc7Nd1/8zEQLX+enZb8upqIQuR6qzb9z7Cg=",
            "rev": "9b894306ec3b28cea46e84c32b56773a98c483da",
            "url": "https://chromium.googlesource.com/chromium/deps/libjpeg_turbo.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/libsrtp": {
        "args": {
            "hash": "sha256-XOPiDAOHpWyCiXI+fi1CAie0Zaj4v14m9Kc8+jbzpUY=",
            "rev": "7a7e64c8b5a632f55929cb3bb7d3e6fb48c3205a",
            "url": "https://chromium.googlesource.com/chromium/deps/libsrtp.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/libunwind/src": {
        "args": {
            "hash": "sha256-/4/Trextb4F9UMDVrg4uG9QZl6S0H9FiwnL+2S5+ZpE=",
            "rev": "419b03c0b8f20d6da9ddcb0d661a94a97cdd7dad",
            "url": "https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libunwind.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/libvpx/source/libvpx": {
        "args": {
            "hash": "sha256-JbeUgX8Dx8GkQ79ElZHK8gYI3/4o6NrTV+HpblwLvIE=",
            "rev": "8762f5efb2917765316a198e6713f0bc93b07c9b",
            "url": "https://chromium.googlesource.com/webm/libvpx.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/libyuv": {
        "args": {
            "hash": "sha256-hD5B9fPNwf8M98iS/PYeUJgJxtBvvf2BrrlnBNYXSg0=",
            "rev": "a6a2ec654b1be1166b376476a7555c89eca0c275",
            "url": "https://chromium.googlesource.com/libyuv/libyuv.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/lss": {
        "args": {
            "hash": "sha256-hE8uZf9Fst66qJkoVYChiB8G41ie+k9M4X0W+5JUSdw=",
            "rev": "ce877209e11aa69dcfffbd53ef90ea1d07136521",
            "url": "https://chromium.googlesource.com/linux-syscall-support.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/nasm": {
        "args": {
            "hash": "sha256-SiRXHsUlWXtH6dbDjDjqNAm105ibEB3jOfNtQAM4CaY=",
            "rev": "f477acb1049f5e043904b87b825c5915084a9a29",
            "url": "https://chromium.googlesource.com/chromium/deps/nasm.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/openh264/src": {
        "args": {
            "hash": "sha256-J7Eqe2QevZh1xfap19W8AVCcwfRu7ztknnbKFJUAH1c=",
            "rev": "09a4f3ec842a8932341b195c5b01e141c8a16eb7",
            "url": "https://chromium.googlesource.com/external/github.com/cisco/openh264"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/perfetto": {
        "args": {
            "hash": "sha256-fS0P/0Bqn9EreCPRC65Lw7/zcpMquo7RDf6dmbMDa74=",
            "rev": "0e424063dbfd4e7400aa3b77b5c00b84893aee7b",
            "url": "https://android.googlesource.com/platform/external/perfetto.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/protobuf-javascript/src": {
        "args": {
            "hash": "sha256-TmP6xftUVTD7yML7UEM/DB8bcsL5RFlKPyCpcboD86U=",
            "rev": "e34549db516f8712f678fcd4bc411613b5cc5295",
            "url": "https://chromium.googlesource.com/external/github.com/protocolbuffers/protobuf-javascript"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/third_party/re2/src": {
        "args": {
            "hash": "sha256-FA9wAZwqLx7oCPf+qeqZ7hhpJ9J2DSMXZAWllHIX/qY=",
            "rev": "b84e3ff189980a33d4a0c6fa1201aa0b3b8bab4a",
            "url": "https://chromium.googlesource.com/external/github.com/google/re2.git"
        },
        "fetcher": "fetchFromGitiles"
    },
    "src/tools": {
        "args": {
            "hash": "sha256-19oGSveaPv8X+/hsevUe4fFtLASC3HfPtbnw3TWpYQk=",
            "rev": "0d6482e40fe26f738a0acf6ebb0f797358538b48",
            "url": "https://chromium.googlesource.com/chromium/src/tools"
        },
        "fetcher": "fetchFromGitiles"
    }
}
+0 −249

File deleted.

Preview size limit exceeded, changes collapsed.

Loading