working :))))

cameron created

Change summary

crates/zed/build.rs | 4 +++-
nix/build.nix       | 9 +++++----
2 files changed, 8 insertions(+), 5 deletions(-)

Detailed changes

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");
             }
         }
 

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