Skip to content

Commit

Permalink
zed-editor: fix license generation
Browse files Browse the repository at this point in the history
  • Loading branch information
niklaskorz committed Oct 31, 2024
1 parent 91790fc commit c69d708
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
10 changes: 7 additions & 3 deletions pkgs/by-name/ze/zed-editor/0001-generate-licenses.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/script/generate-licenses b/script/generate-licenses
index 43b2f5c458..c740a3afa2 100755
index 9602813f0c..d16d11c203 100755
--- a/script/generate-licenses
+++ b/script/generate-licenses
@@ -15,12 +15,6 @@ cat assets/icons/LICENSES >> $OUTPUT_FILE
@@ -16,16 +16,9 @@ cat assets/icons/LICENSES >> $OUTPUT_FILE

echo -e "# ###### CODE LICENSES ######\n" >> $OUTPUT_FILE

Expand All @@ -14,4 +14,8 @@ index 43b2f5c458..c740a3afa2 100755
-fi

echo "Generating cargo licenses"
cargo about generate --fail -c script/licenses/zed-licenses.toml script/licenses/template.hbs.md >> $OUTPUT_FILE
cargo about generate \
- --fail \
-c script/licenses/zed-licenses.toml \
"${TEMPLATE_FILE}" >> $OUTPUT_FILE

9 changes: 5 additions & 4 deletions pkgs/by-name/ze/zed-editor/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ rustPlatform.buildRustPackage rec {
[
# 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 [
Expand Down Expand Up @@ -206,10 +208,9 @@ rustPlatform.buildRustPackage rec {
RUSTFLAGS = if withGLES then "--cfg gles" else "";
gpu-lib = if withGLES then libglvnd else vulkan-loader;

# Enable back when https://github.com/zed-industries/zed/issues/19971 is fixed
# preBuild = ''
# bash script/generate-licenses
# '';
preBuild = ''
bash script/generate-licenses
'';

postFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
patchelf --add-rpath ${gpu-lib}/lib $out/libexec/*
Expand Down

0 comments on commit c69d708

Please sign in to comment.