Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
livekit: Correctly handle runtime deps: libva and libva-drm (#50527)
Jakub Konka9ba65944df02
diff --git a/Cargo.lock b/Cargo.lockindex 9f56a58f68f..c4dcfa054ef 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -9699,7 +9699,7 @@ dependencies = [[[package]]name = "libwebrtc"version = "0.3.26"-source = "git+https://github.com/zed-industries/livekit-rust-sdks?rev=fccf29d1d0d0a139b2e50746b0b9a1bac828fa04#fccf29d1d0d0a139b2e50746b0b9a1bac828fa04"+source = "git+https://github.com/zed-industries/livekit-rust-sdks?rev=37835f840d0070d45ac8b31cce6a6ae7aca3f459#37835f840d0070d45ac8b31cce6a6ae7aca3f459"dependencies = ["cxx","glib",@@ -9797,7 +9797,7 @@ checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092"[[package]]name = "livekit"version = "0.7.32"-source = "git+https://github.com/zed-industries/livekit-rust-sdks?rev=fccf29d1d0d0a139b2e50746b0b9a1bac828fa04#fccf29d1d0d0a139b2e50746b0b9a1bac828fa04"+source = "git+https://github.com/zed-industries/livekit-rust-sdks?rev=37835f840d0070d45ac8b31cce6a6ae7aca3f459#37835f840d0070d45ac8b31cce6a6ae7aca3f459"dependencies = ["base64 0.22.1","bmrng",@@ -9823,7 +9823,7 @@ dependencies = [[[package]]name = "livekit-api"version = "0.4.14"-source = "git+https://github.com/zed-industries/livekit-rust-sdks?rev=fccf29d1d0d0a139b2e50746b0b9a1bac828fa04#fccf29d1d0d0a139b2e50746b0b9a1bac828fa04"+source = "git+https://github.com/zed-industries/livekit-rust-sdks?rev=37835f840d0070d45ac8b31cce6a6ae7aca3f459#37835f840d0070d45ac8b31cce6a6ae7aca3f459"dependencies = ["base64 0.21.7","futures-util",@@ -9850,7 +9850,7 @@ dependencies = [[[package]]name = "livekit-protocol"version = "0.7.1"-source = "git+https://github.com/zed-industries/livekit-rust-sdks?rev=fccf29d1d0d0a139b2e50746b0b9a1bac828fa04#fccf29d1d0d0a139b2e50746b0b9a1bac828fa04"+source = "git+https://github.com/zed-industries/livekit-rust-sdks?rev=37835f840d0070d45ac8b31cce6a6ae7aca3f459#37835f840d0070d45ac8b31cce6a6ae7aca3f459"dependencies = ["futures-util","livekit-runtime",@@ -9866,7 +9866,7 @@ dependencies = [[[package]]name = "livekit-runtime"version = "0.4.0"-source = "git+https://github.com/zed-industries/livekit-rust-sdks?rev=fccf29d1d0d0a139b2e50746b0b9a1bac828fa04#fccf29d1d0d0a139b2e50746b0b9a1bac828fa04"+source = "git+https://github.com/zed-industries/livekit-rust-sdks?rev=37835f840d0070d45ac8b31cce6a6ae7aca3f459#37835f840d0070d45ac8b31cce6a6ae7aca3f459"dependencies = ["tokio","tokio-stream",@@ -19841,7 +19841,7 @@ dependencies = [[[package]]name = "webrtc-sys"version = "0.3.23"-source = "git+https://github.com/zed-industries/livekit-rust-sdks?rev=fccf29d1d0d0a139b2e50746b0b9a1bac828fa04#fccf29d1d0d0a139b2e50746b0b9a1bac828fa04"+source = "git+https://github.com/zed-industries/livekit-rust-sdks?rev=37835f840d0070d45ac8b31cce6a6ae7aca3f459#37835f840d0070d45ac8b31cce6a6ae7aca3f459"dependencies = ["cc","cxx",@@ -19855,7 +19855,7 @@ dependencies = [[[package]]name = "webrtc-sys-build"version = "0.3.13"-source = "git+https://github.com/zed-industries/livekit-rust-sdks?rev=fccf29d1d0d0a139b2e50746b0b9a1bac828fa04#fccf29d1d0d0a139b2e50746b0b9a1bac828fa04"+source = "git+https://github.com/zed-industries/livekit-rust-sdks?rev=37835f840d0070d45ac8b31cce6a6ae7aca3f459#37835f840d0070d45ac8b31cce6a6ae7aca3f459"dependencies = ["anyhow","fs2",@@ -21791,6 +21791,7 @@ dependencies = ["parking_lot","paths","picker",+ "pkg-config","pretty_assertions","profiling","project",diff --git a/Cargo.toml b/Cargo.tomlindex c50b3297726..98fccfaeb21 100644--- a/Cargo.toml+++ b/Cargo.toml@@ -835,8 +835,8 @@ notify = { git = "https://github.com/zed-industries/notify.git", rev = "ce58c24cnotify-types = { git = "https://github.com/zed-industries/notify.git", rev = "ce58c24cad542c28e04ced02e20325a4ec28a31d" }windows-capture = { git = "https://github.com/zed-industries/windows-capture.git", rev = "f0d6c1b6691db75461b732f6d5ff56eed002eeb9" }calloop = { git = "https://github.com/zed-industries/calloop" }-livekit = { git = "https://github.com/zed-industries/livekit-rust-sdks", rev = "fccf29d1d0d0a139b2e50746b0b9a1bac828fa04" }-libwebrtc = { git = "https://github.com/zed-industries/livekit-rust-sdks", rev = "fccf29d1d0d0a139b2e50746b0b9a1bac828fa04" }+livekit = { git = "https://github.com/zed-industries/livekit-rust-sdks", rev = "37835f840d0070d45ac8b31cce6a6ae7aca3f459" }+libwebrtc = { git = "https://github.com/zed-industries/livekit-rust-sdks", rev = "37835f840d0070d45ac8b31cce6a6ae7aca3f459" }[profile.dev]split-debuginfo = "unpacked"diff --git a/crates/zed/Cargo.toml b/crates/zed/Cargo.tomlindex 16385ccf75e..cf8df08c010 100644--- a/crates/zed/Cargo.toml+++ b/crates/zed/Cargo.toml@@ -241,6 +241,9 @@ gpui = { workspace = true, features = [] }ashpd.workspace = true+[target.'cfg(target_os = "linux")'.build-dependencies]+pkg-config = "0.3.22"+[dev-dependencies]call = { workspace = true, features = ["test-support"] }dap = { workspace = true, features = ["test-support"] }diff --git a/crates/zed/build.rs b/crates/zed/build.rsindex 7e22752d35d..e169760acf1 100644--- a/crates/zed/build.rs+++ b/crates/zed/build.rs@@ -2,6 +2,25 @@use std::process::Command;fn main() {+ #[cfg(target_os = "linux")]+ {+ // Add rpaths for libraries that webrtc-sys dlopens at runtime.+ // This is mostly required for hosts with non-standard SO installation+ // locations such as NixOS.+ let dlopened_libs = ["libva", "libva-drm"];++ let mut rpath_dirs = std::collections::BTreeSet::new();+ for lib in &dlopened_libs {+ if let Some(libdir) = pkg_config::get_variable(lib, "libdir").ok() {+ rpath_dirs.insert(libdir);+ }+ }++ for dir in &rpath_dirs {+ println!("cargo:rustc-link-arg=-Wl,-rpath,{dir}");+ }+ }+if cfg!(target_os = "macos") {println!("cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET=10.15.7");diff --git a/nix/build.nix b/nix/build.nixindex 3ae9ca95506..68f8a4acdbe 100644--- a/nix/build.nix+++ b/nix/build.nix@@ -233,6 +233,7 @@ letlib.makeLibraryPath [gpu-libwayland+ libva]}";diff --git a/script/linux b/script/linuxindex b3bd03eacc2..706fa63b037 100755--- a/script/linux+++ b/script/linux@@ -155,6 +155,7 @@ if [[ -n $zyp ]]; thencmakefontconfig-develgcc+ libva-develgcc-c++glib2-develgit@@ -191,6 +192,7 @@ if [[ -n $pacman ]]; thenalsa-libfontconfigglib2+ libvawaylandlibgit2libxcb@@ -222,6 +224,7 @@ if [[ -n $xbps ]]; thenalsa-lib-develfontconfig-develglib-devel+ libva-devellibxcb-devellibxkbcommon-devellibzstd-devel@@ -249,6 +252,7 @@ if [[ -n $emerge ]]; thendev-util/cmakemedia-libs/alsa-libmedia-libs/fontconfig+ media-libs/libvamedia-libs/vulkan-loaderx11-libs/libxcbx11-libs/libxkbcommon