Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zed-editor: fix license generation #352654

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this line supposed to be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, see the patch before this commit. I didn't change this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(as to why this line is removed at all: it disables checking for a precise version of cargo-about so we can use the one provided in nixpkgs)


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