Skip to content

Commit

Permalink
zed-editor: 0.165.4 -> 0.166.1
Browse files Browse the repository at this point in the history
  • Loading branch information
niklaskorz committed Dec 20, 2024
1 parent 8a01c8a commit c5d3900
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 81 deletions.
55 changes: 0 additions & 55 deletions pkgs/by-name/ze/zed-editor/0002-disable-livekit-darwin.patch

This file was deleted.

66 changes: 40 additions & 26 deletions pkgs/by-name/ze/zed-editor/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
darwinMinVersionHook,
makeWrapper,
nodejs_22,
libGL,
libX11,
libXext,
livekit-libwebrtc,

withGLES ? false,
}:
Expand Down Expand Up @@ -89,35 +93,42 @@ let
in
rustPlatform.buildRustPackage rec {
pname = "zed-editor";
version = "0.165.4";
version = "0.166.1";

src = fetchFromGitHub {
owner = "zed-industries";
repo = "zed";
rev = "refs/tags/v${version}";
hash = "sha256-g+ZHchlxeNDkxUM306OK3BsjrvO3snF4vcQQZJSIhLc=";
tag = "v${version}";
hash = "sha256-ss4dz9qPAP6eIYbG3S5QJaSR5zEyEqLBjfacj/eb7AE=";
};

patches =
[
# Zed uses cargo-install to install cargo-about during the script execution.
# We provide cargo-about ourselves and can skip this step.
# Until https://github.com/zed-industries/zed/issues/19971 is fixed,
# we also skip any crate for which the license cannot be determined.
./0001-generate-licenses.patch
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# The Swift variant of livekit currently used inside Zed requires
# Swift 6, which is not available in nixpkgs yet:
# https://github.com/NixOS/nixpkgs/issues/343210
# The Rust variant of livekit for Zed is still pending and there is no
# schedule when it will be finished:
# https://github.com/zed-industries/zed/pull/13343
./0002-disable-livekit-darwin.patch
];
patches = [
# Zed uses cargo-install to install cargo-about during the script execution.
# We provide cargo-about ourselves and can skip this step.
# Until https://github.com/zed-industries/zed/issues/19971 is fixed,
# we also skip any crate for which the license cannot be determined.
./0001-generate-licenses.patch
# See https://github.com/zed-industries/zed/pull/21661#issuecomment-2524161840
"script/patches/use-cross-platform-livekit.patch"
];

postPatch =
lib.optionalString stdenv.hostPlatform.isLinux ''
# Dynamically link WebRTC instead of static
substituteInPlace ../${pname}-${version}-vendor/webrtc-sys-*/build.rs \
--replace-fail "cargo:rustc-link-lib=static=webrtc" "cargo:rustc-link-lib=dylib=webrtc"
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
# On Darwin, linking against the dylib results in Rust linker errors, while
# linking against the framework works fine.
substituteInPlace ../${pname}-${version}-vendor/webrtc-sys-*/build.rs \
--replace-fail "cargo:rustc-link-lib=static=webrtc" "cargo:rustc-link-lib=framework=webrtc" \
--replace-fail 'println!("cargo:rustc-link-search=native={}", webrtc_lib.to_str().unwrap());' \
'println!("cargo:rustc-link-search=framework={}/Library/Frameworks", webrtc_dir.to_str().unwrap());'
'';

useFetchCargoVendor = true;
cargoHash = "sha256-ZNXvuHX9b3T58FUs9TjpfiGYNr9J3IDbz2JE6Vy7Sg0=";
cargoHash = "sha256-HbOdY+6FKGTK5gW2BkWSdciBvTx+oKhCchFvwKEoGNE=";

nativeBuildInputs =
[
Expand Down Expand Up @@ -151,14 +162,16 @@ rustPlatform.buildRustPackage rec {
libxkbcommon
wayland
xorg.libxcb
# required by livekit:
libGL
libX11
libXext
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
apple-sdk_15
# This will need to be increased to 12.3 once
# https://github.com/zed-industries/zed/pull/13343
# is merged and released, as ScreenCaptureKit is only available on 12.3 and up:
# ScreenCaptureKit, required by livekit, is only available on 12.3 and up:
# https://developer.apple.com/documentation/screencapturekit
(darwinMinVersionHook "10.15")
(darwinMinVersionHook "12.3")
];

cargoBuildFlags = [
Expand All @@ -183,6 +196,7 @@ rustPlatform.buildRustPackage rec {
ZED_UPDATE_EXPLANATION = "Zed has been installed using Nix. Auto-updates have thus been disabled.";
# Used by `zed --version`
RELEASE_VERSION = version;
LK_CUSTOM_WEBRTC = livekit-libwebrtc;
};

RUSTFLAGS = if withGLES then "--cfg gles" else "";
Expand Down Expand Up @@ -295,7 +309,7 @@ rustPlatform.buildRustPackage rec {
meta = {
description = "High-performance, multiplayer code editor from the creators of Atom and Tree-sitter";
homepage = "https://zed.dev";
changelog = "https://github.com/zed-industries/zed/releases/tag/v${version}";
changelog = "https://github.com/zed-industries/zed/releases/tag/${src.tag}";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [
GaetanLepage
Expand Down

0 comments on commit c5d3900

Please sign in to comment.