gpui_linux: Fix headless build (#49652)

Piotr Osiewicz created

Closes #ISSUE

Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [ ] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A

Change summary

crates/gpui/Cargo.toml                  | 1 -
crates/gpui_linux/src/linux.rs          | 2 +-
crates/gpui_linux/src/linux/platform.rs | 6 +++---
crates/gpui_platform/Cargo.toml         | 1 +
nix/build.nix                           | 2 +-
5 files changed, 6 insertions(+), 6 deletions(-)

Detailed changes

crates/gpui/Cargo.toml 🔗

@@ -28,7 +28,6 @@ test-support = [
 ]
 inspector = ["gpui_macros/inspector"]
 leak-detection = ["backtrace"]
-runtime_shaders = []
 wayland = [
     "bitflags",
 ]

crates/gpui_linux/src/linux.rs 🔗

@@ -15,7 +15,7 @@ mod xdg_desktop_portal;
 pub use dispatcher::*;
 pub(crate) use headless::*;
 pub(crate) use keyboard::*;
-pub use platform::*;
+pub(crate) use platform::*;
 #[cfg(any(feature = "wayland", feature = "x11"))]
 pub(crate) use text_system::*;
 #[cfg(feature = "wayland")]

crates/gpui_linux/src/linux/platform.rs 🔗

@@ -98,11 +98,11 @@ pub(crate) trait LinuxClient {
     #[allow(unused)]
     fn display(&self, id: DisplayId) -> Option<Rc<dyn PlatformDisplay>>;
     fn primary_display(&self) -> Option<Rc<dyn PlatformDisplay>>;
-    #[cfg(feature = "screen-capture")]
+
     fn is_screen_capture_supported(&self) -> bool {
         false
     }
-    #[cfg(feature = "screen-capture")]
+
     fn screen_capture_sources(
         &self,
     ) -> oneshot::Receiver<Result<Vec<Rc<dyn gpui::ScreenCaptureSource>>>> {
@@ -168,7 +168,7 @@ impl LinuxCommon {
         #[cfg(any(feature = "wayland", feature = "x11"))]
         let text_system = Arc::new(crate::linux::CosmicTextSystem::new());
         #[cfg(not(any(feature = "wayland", feature = "x11")))]
-        let text_system = Arc::new(crate::NoopTextSystem::new());
+        let text_system = Arc::new(gpui::NoopTextSystem::new());
 
         let callbacks = PlatformHandlers::default();
 

crates/gpui_platform/Cargo.toml 🔗

@@ -16,6 +16,7 @@ default = []
 font-kit = ["gpui_macos/font-kit"]
 test-support = ["gpui/test-support"]
 screen-capture = ["gpui/screen-capture", "gpui_macos/screen-capture", "gpui_windows/screen-capture", "gpui_linux/screen-capture"]
+runtime_shaders = ["gpui_macos/runtime_shaders"]
 wayland = ["gpui_linux/wayland"]
 x11 = ["gpui_linux/x11"]
 

nix/build.nix 🔗

@@ -172,7 +172,7 @@ let
         (darwinMinVersionHook "10.15")
       ];
 
-      cargoExtraArgs = "-p zed -p cli --locked --features=gpui/runtime_shaders";
+      cargoExtraArgs = "-p zed -p cli --locked --features=gpui_platform/runtime_shaders";
 
       stdenv =
         pkgs: