diff --git a/pkgs/by-name/ze/zed-editor/package.nix b/pkgs/by-name/ze/zed-editor/package.nix index 71482e5540f2..bded3c04c5e8 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/* '';