|
| 1 | +%bcond_without check |
| 2 | +%global debug_package %{nil} |
| 3 | +%global ver 0.142.1 |
| 4 | + |
| 5 | +%global crate zed |
| 6 | +%global app_id dev.zed.Zed-Preview |
| 7 | + |
| 8 | +Name: zed-preview |
| 9 | +Version: %ver |
| 10 | +Release: pre1%?dist |
| 11 | +Summary: Zed is a high-performance, multiplayer code editor |
| 12 | + |
| 13 | +License: MIT |
| 14 | +URL: https://zed.dev/ |
| 15 | +Source0: https://github.com/zed-industries/zed/archive/refs/tags/v%{ver}-pre.tar.gz |
| 16 | + |
| 17 | +Conflicts: zed |
| 18 | +Provides: zed |
| 19 | + |
| 20 | +BuildRequires: cargo-rpm-macros >= 24 |
| 21 | +BuildRequires: anda-srpm-macros |
| 22 | +BuildRequires: gcc |
| 23 | +BuildRequires: g++ |
| 24 | +BuildRequires: clang |
| 25 | +BuildRequires: mold |
| 26 | +BuildRequires: alsa-lib-devel |
| 27 | +BuildRequires: fontconfig-devel |
| 28 | +BuildRequires: wayland-devel |
| 29 | +BuildRequires: libxkbcommon-x11-devel |
| 30 | +BuildRequires: openssl-devel |
| 31 | +BuildRequires: libzstd-devel |
| 32 | +BuildRequires: perl-FindBin |
| 33 | +BuildRequires: perl-IPC-Cmd |
| 34 | +BuildRequires: perl-File-Compare |
| 35 | +BuildRequires: perl-File-Copy |
| 36 | +BuildRequires: perl-lib |
| 37 | +BuildRequires: vulkan-loader |
| 38 | + |
| 39 | +%description |
| 40 | +Code at the speed of thought - Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter. |
| 41 | + |
| 42 | +%prep |
| 43 | +%autosetup -n %{crate}-%{ver}-pre -p1 |
| 44 | +%cargo_prep_online |
| 45 | + |
| 46 | +export DO_STARTUP_NOTIFY="true" |
| 47 | +export APP_ID="%app_id" |
| 48 | +export APP_ICON="%app_id" |
| 49 | +export APP_NAME="Zed Preview" |
| 50 | +export APP_CLI="zed" |
| 51 | +export ZED_UPDATE_EXPLANATION="Run dnf up to update Zed Preview from Terra." |
| 52 | +export ZED_RELEASE_CHANNEL=preview |
| 53 | +export BRANDING_LIGHT="#99c1f1" |
| 54 | +export BRANDING_DARK="#1a5fb4" |
| 55 | + |
| 56 | +echo "StartupWMClass=$APP_ID" >> crates/zed/resources/zed.desktop.in |
| 57 | +envsubst < "crates/zed/resources/zed.desktop.in" > $APP_ID.desktop # from https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=zed-git#n52 |
| 58 | + |
| 59 | +envsubst < "crates/zed/resources/flatpak/zed.metainfo.xml.in" > $APP_ID.metainfo.xml |
| 60 | + |
| 61 | +%build |
| 62 | +export ZED_UPDATE_EXPLANATION="Run dnf up to update Zed Preview from Terra." |
| 63 | +echo "preview" > crates/zed/RELEASE_CHANNEL |
| 64 | + |
| 65 | +%cargo_build -- --package zed --package cli |
| 66 | +script/generate-licenses |
| 67 | + |
| 68 | +%install |
| 69 | +install -Dm755 target/rpm/zed %{buildroot}%{_libexecdir}/zed-editor |
| 70 | +install -Dm755 target/rpm/cli %{buildroot}%{_bindir}/zed |
| 71 | + |
| 72 | +install -Dm644 %app_id.desktop %{buildroot}%{_datadir}/applications/%app_id.desktop |
| 73 | +install -Dm644 crates/zed/resources/app-icon-preview.png %{buildroot}%{_datadir}/pixmaps/%app_id.png |
| 74 | + |
| 75 | +install -Dm644 %app_id.metainfo.xml %{buildroot}%{_metainfodir}/%app_id.metainfo.xml |
| 76 | + |
| 77 | +%if %{with check} |
| 78 | +%check |
| 79 | +%cargo_test |
| 80 | +%endif |
| 81 | + |
| 82 | +%files |
| 83 | +%{_libexecdir}/zed-editor |
| 84 | +%{_bindir}/zed |
| 85 | +%{_datadir}/applications/%app_id.desktop |
| 86 | +%{_datadir}/pixmaps/%app_id.png |
| 87 | +%{_metainfodir}/%app_id.metainfo.xml |
| 88 | +%license assets/licenses.md |
| 89 | + |
| 90 | +%changelog |
| 91 | +%autochangelog |
0 commit comments