about summary refs log tree commit diff
path: root/pkgs/by-name/ze
diff options
context:
space:
mode:
authorLukas Lihotzki <lukas@lihotzki.de>2024-06-21 15:38:36 +0200
committerLukas Lihotzki <lukas@lihotzki.de>2024-06-21 15:38:36 +0200
commit418f08ff12715b5e561b789f023f3754c2412ab6 (patch)
tree33ab0c50a2c01ab17ace1b314a49229ebedb462e /pkgs/by-name/ze
parentd9e50897517e3de79a42f3556dbfac89d2d670b9 (diff)
zed-editor: add withGLES flag
Diffstat (limited to 'pkgs/by-name/ze')
-rw-r--r--pkgs/by-name/ze/zed-editor/package.nix10
1 files changed, 9 insertions, 1 deletions
diff --git a/pkgs/by-name/ze/zed-editor/package.nix b/pkgs/by-name/ze/zed-editor/package.nix
index 71482e5540f23..bded3c04c5e88 100644
--- a/pkgs/by-name/ze/zed-editor/package.nix
+++ b/pkgs/by-name/ze/zed-editor/package.nix
@@ -18,13 +18,18 @@
   alsa-lib,
   libxkbcommon,
   wayland,
+  libglvnd,
   xorg,
   stdenv,
   darwin,
   makeFontsConf,
   vulkan-loader,
+
+  withGLES ? false
 }:
 
+assert withGLES -> stdenv.isLinux;
+
 rustPlatform.buildRustPackage rec {
   pname = "zed";
   version = "0.137.6";
@@ -123,8 +128,11 @@ rustPlatform.buildRustPackage rec {
     };
   };
 
+  RUSTFLAGS = if withGLES then "--cfg gles" else "";
+  gpu-lib = if withGLES then libglvnd else vulkan-loader;
+
   postFixup = lib.optionalString stdenv.isLinux ''
-    patchelf --add-rpath ${vulkan-loader}/lib $out/bin/*
+    patchelf --add-rpath ${gpu-lib}/lib $out/bin/*
     patchelf --add-rpath ${wayland}/lib $out/bin/*
   '';