From 54997ff76b47448ef66211c25c2f2c34f7af7fb1 Mon Sep 17 00:00:00 2001 From: Gilver Date: Sun, 27 Apr 2025 16:56:35 -0500 Subject: [PATCH] fix(zed): License fetching (#4445) (#4467) * fix(zed): License macro shouldn't have brackets around it * fix: Unmacro the command I guess * fix(zed-nightly): Weird merge bug??? --------- (cherry picked from commit 1af19fdf9d31cd4a70a272d8350b85c6db0946a0) Signed-off-by: Gilver Signed-off-by: RockGrub --- anda/devs/zed/nightly/zed-nightly.spec | 31 +++++++++++------------- anda/devs/zed/preview/zed-preview.spec | 29 ++++++++++------------ anda/devs/zed/stable/zed.spec | 33 ++++++++++++-------------- 3 files changed, 42 insertions(+), 51 deletions(-) diff --git a/anda/devs/zed/nightly/zed-nightly.spec b/anda/devs/zed/nightly/zed-nightly.spec index 94711d8f36..0789b0ceb9 100644 --- a/anda/devs/zed/nightly/zed-nightly.spec +++ b/anda/devs/zed/nightly/zed-nightly.spec @@ -13,24 +13,9 @@ %global rustflags_debuginfo 0 -# Zed needs a special approach to fetch the dep licenses -%global zed_license_online %{shrink: \ - %{__cargo} tree \ - -Z avoid-dev-deps \ - --workspace \ - --edges no-build,no-dev,no-proc-macro \ - --target all \ - %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \ - --prefix none \ - --format "{l}: {p}" \ - | sed -e "s: ($(pwd)[^)]*)::g" -e "s: / :/:g" -e "/\/.*:/{s/\// OR /}" \ - | sed -e '/.*(\*).*/d' -e '/^: pet/ s/./MIT&/' \ - | sort -u \ -}\ - Name: zed-nightly Version: %ver^%commit_date.%shortcommit -Release: 1%?dist +Release: 2%?dist Summary: Zed is a high-performance, multiplayer code editor SourceLicense: AGPL-3.0-only AND Apache-2.0 AND GPL-3.0-or-later License: ((Apache-2.0 OR MIT) AND BSD-3-Clause) AND ((MIT OR Apache-2.0) AND Unicode-3.0) AND (0BSD OR MIT OR Apache-2.0) AND (Apache-2.0 AND ISC) AND AGPL.3.0-only AND AGPL-3.0-or-later AND (Apache-2.0 OR BSL-1.0 OR MIT) AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR ISC OR MIT) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception) AND Apache-2.0 AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND (BSD-2-Clause OR MIT OR Apache-2.0) AND BSD-2-Clause AND (CC0-1.0 OR Apache-2.0 OR Apache-2.0 WITH LLVM-exception) AND (CC0-1.0 OR Apache-2.0) AND (CC0-1.0 OR MIT-0 OR Apache-2.0) AND CC0-1.0 AND GPL-3.0-or-later AND (ISC AND (Apache-2.0 OR ISC) AND OpenSSL) AND (ISC AND (Apache-2.0 OR ISC)) AND ISC AND (MIT AND (MIT OR Apache-2.0)) AND (MIT AND BSD-3-Clause) AND (MIT OR Apache-2.0 OR CC0-1.0) AND (MIT OR Apache-2.0 OR NCSA) AND (MIT OR Apache-2.0 OR Zlib) AND (MIT OR Apache-2.0) AND (MIT OR Zlib OR Apache-2.0) AND MIT AND MPL-2.0 AND Unicode-3.0 AND (Unlicense OR MIT) AND (Zlib OR Apache-2.0 OR MIT) AND Zlib @@ -104,7 +89,19 @@ install -Dm644 crates/zed/resources/app-icon-nightly.png %{buildroot}%{_datadir} install -Dm644 %app_id.metainfo.xml %{buildroot}%{_metainfodir}/%app_id.metainfo.xml # The license generation script doesn't generate licenses for ALL compiled dependencies, just direct deps of Zed, and it does not "group" licenses -%{zed_license_online} > LICENSE.dependencies +# Zed also needs a special approach to fetch the dep licenses +%{__cargo} tree \ + -Z avoid-dev-deps \ + --workspace \ + --edges no-build,no-dev,no-proc-macro \ + --target all \ + %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \ + --prefix none \ + --format "{l}: {p}" \ + | sed -e "s: ($(pwd)[^)]*)::g" -e "s: / :/:g" -e "/\/.*:/{s/\// OR /}" \ + | sed -e '/.*(\*).*/d' -e '/^: pet/ s/./MIT&/' \ + | sort -u \ +> LICENSE.dependencies mv assets/icons/LICENSES LICENSE.icons mv assets/themes/LICENSES LICENSE.themes mv assets/fonts/plex-mono/license.txt LICENSE.fonts diff --git a/anda/devs/zed/preview/zed-preview.spec b/anda/devs/zed/preview/zed-preview.spec index 8e8dd0d2df..6696c5cc08 100644 --- a/anda/devs/zed/preview/zed-preview.spec +++ b/anda/devs/zed/preview/zed-preview.spec @@ -9,21 +9,6 @@ %global rustflags_debuginfo 0 -# Zed needs a special approach to fetch the dep licenses -%global zed_license_online %{shrink: \ - %{__cargo} tree \ - -Z avoid-dev-deps \ - --workspace \ - --edges no-build,no-dev,no-proc-macro \ - --target all \ - %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \ - --prefix none \ - --format "{l}: {p}" \ - | sed -e "s: ($(pwd)[^)]*)::g" -e "s: / :/:g" -e "/\/.*:/{s/\// OR /}" \ - | sed -e '/.*(\*).*/d' -e '/^: pet/ s/./MIT&/' \ - | sort -u \ -}\ - Name: zed-preview Version: %(echo %ver | sed 's/-/~/') Release: pre2%?dist @@ -100,7 +85,19 @@ install -Dm644 crates/zed/resources/app-icon-preview.png %{buildroot}%{_datadir} install -Dm644 %app_id.metainfo.xml %{buildroot}%{_metainfodir}/%app_id.metainfo.xml # The license generation script doesn't generate licenses for ALL compiled dependencies, just direct deps of Zed, and it does not "group" licenses -%{zed_license_online} > LICENSE.dependencies +# Zed also needs a special approach to fetch the dep licenses +%{__cargo} tree \ + -Z avoid-dev-deps \ + --workspace \ + --edges no-build,no-dev,no-proc-macro \ + --target all \ + %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \ + --prefix none \ + --format "{l}: {p}" \ + | sed -e "s: ($(pwd)[^)]*)::g" -e "s: / :/:g" -e "/\/.*:/{s/\// OR /}" \ + | sed -e '/.*(\*).*/d' -e '/^: pet/ s/./MIT&/' \ + | sort -u \ +> LICENSE.dependencies mv assets/icons/LICENSES LICENSE.icons mv assets/themes/LICENSES LICENSE.themes mv assets/fonts/plex-mono/license.txt LICENSE.fonts diff --git a/anda/devs/zed/stable/zed.spec b/anda/devs/zed/stable/zed.spec index e0b523cc8b..273019982f 100644 --- a/anda/devs/zed/stable/zed.spec +++ b/anda/devs/zed/stable/zed.spec @@ -8,24 +8,9 @@ %global rustflags_debuginfo 0 -# Zed needs a special approach to fetch the dep licenses -%global zed_license_online %{shrink: \ - %{__cargo} tree \ - -Z avoid-dev-deps \ - --workspace \ - --edges no-build,no-dev,no-proc-macro \ - --target all \ - %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \ - --prefix none \ - --format "{l}: {p}" \ - | sed -e "s: ($(pwd)[^)]*)::g" -e "s: / :/:g" -e "/\/.*:/{s/\// OR /}" \ - | sed -e '/.*(\*).*/d' -e '/^: pet/ s/./MIT&/' \ - | sort -u \ -}\ - Name: zed -Version: 0.182.11 -Release: 1%?dist +Version: 0.183.11 +Release: 2%?dist Summary: Zed is a high-performance, multiplayer code editor SourceLicense: AGPL-3.0-only AND Apache-2.0 AND GPL-3.0-or-later License: ((Apache-2.0 OR MIT) AND BSD-3-Clause) AND ((MIT OR Apache-2.0) AND Unicode-3.0) AND (0BSD OR MIT OR Apache-2.0) AND (Apache-2.0 AND ISC) AND AGPL.3.0-only AND AGPL-3.0-or-later AND (Apache-2.0 OR BSL-1.0 OR MIT) AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR ISC OR MIT) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception) AND Apache-2.0 AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND (BSD-2-Clause OR MIT OR Apache-2.0) AND BSD-2-Clause AND (CC0-1.0 OR Apache-2.0 OR Apache-2.0 WITH LLVM-exception) AND (CC0-1.0 OR Apache-2.0) AND (CC0-1.0 OR MIT-0 OR Apache-2.0) AND CC0-1.0 AND GPL-3.0-or-later AND (ISC AND (Apache-2.0 OR ISC) AND OpenSSL) AND (ISC AND (Apache-2.0 OR ISC)) AND ISC AND (MIT AND (MIT OR Apache-2.0)) AND (MIT AND BSD-3-Clause) AND (MIT OR Apache-2.0 OR CC0-1.0) AND (MIT OR Apache-2.0 OR NCSA) AND (MIT OR Apache-2.0 OR Zlib) AND (MIT OR Apache-2.0) AND (MIT OR Zlib OR Apache-2.0) AND MIT AND MPL-2.0 AND Unicode-3.0 AND (Unlicense OR MIT) AND (Zlib OR Apache-2.0 OR MIT) AND Zlib @@ -100,7 +85,19 @@ install -Dm644 crates/zed/resources/app-icon.png %{buildroot}%{_datadir}/pixmaps install -Dm644 %app_id.metainfo.xml %{buildroot}%{_metainfodir}/%app_id.metainfo.xml # The license generation script doesn't generate licenses for ALL compiled dependencies, just direct deps of Zed, and it does not "group" licenses -%{zed_license_online} > LICENSE.dependencies +# Zed also needs a special approach to fetch the dep licenses +%{__cargo} tree \ + -Z avoid-dev-deps \ + --workspace \ + --edges no-build,no-dev,no-proc-macro \ + --target all \ + %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \ + --prefix none \ + --format "{l}: {p}" \ + | sed -e "s: ($(pwd)[^)]*)::g" -e "s: / :/:g" -e "/\/.*:/{s/\// OR /}" \ + | sed -e '/.*(\*).*/d' -e '/^: pet/ s/./MIT&/' \ + | sort -u \ +> LICENSE.dependencies mv assets/icons/LICENSES LICENSE.icons mv assets/themes/LICENSES LICENSE.themes mv assets/fonts/plex-mono/license.txt LICENSE.fonts