From b3f62a30197332652fe954556c680f1b400d4e44 Mon Sep 17 00:00:00 2001 From: cameron Date: Fri, 20 Mar 2026 13:50:25 +0000 Subject: [PATCH] working :)))) --- crates/zed/build.rs | 4 +++- nix/build.nix | 9 +++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/crates/zed/build.rs b/crates/zed/build.rs index 9b9ed59bf4de65220f36c1fd53421fdf44c1e529..f543183b2b026af33c78f65d75b8a53fa97ff76e 100644 --- a/crates/zed/build.rs +++ b/crates/zed/build.rs @@ -7,12 +7,14 @@ fn main() { // 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 dlopened_libs = ["libva", "libva-drm", "egl"]; 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); + } else { + eprintln!("zed: {lib} not found"); } } diff --git a/nix/build.nix b/nix/build.nix index a5ced61bbbfd145c1e3f9fc9909ae69779ba133a..02ed6235e54daa27a9af9b86da79618a21e3cc7e 100644 --- a/nix/build.nix +++ b/nix/build.nix @@ -77,7 +77,6 @@ let builtins.elem firstComp topLevelIncludes; craneLib = crane.overrideToolchain rustToolchain; - gpu-lib = if withGLES then libglvnd else vulkan-loader; commonArgs = let zedCargoLock = builtins.fromTOML (builtins.readFile ../crates/zed/Cargo.toml); @@ -179,7 +178,8 @@ let libva libxkbcommon wayland - gpu-lib + libglvnd + vulkan-loader xorg.libX11 xorg.libxcb libdrm @@ -236,7 +236,8 @@ let # about them that's special is that they're manually dlopened at runtime NIX_LDFLAGS = lib.optionalString stdenv'.hostPlatform.isLinux "-rpath ${ lib.makeLibraryPath [ - gpu-lib + libglvnd + vulkan-loader wayland libva ] @@ -245,7 +246,7 @@ let NIX_OUTPATH_USED_AS_RANDOM_SEED = "norebuilds"; }; - # prevent nix from removing the "unused" wayland/gpu-lib rpaths + # prevent nix from removing the "unused" wayland rpaths dontPatchELF = stdenv'.hostPlatform.isLinux; # TODO: try craneLib.cargoNextest separate output