-
Notifications
You must be signed in to change notification settings - Fork 0
/
zed.spec
98 lines (80 loc) · 2.92 KB
/
zed.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
%bcond_without check
# created from spec file used by Terra Repo
# Exclude input files from mangling
%global __brp_mangle_shebangs_exclude_from ^/usr/src/.*$
%global crate zed
%global app_id dev.zed.Zed
Name: zed
Version: 0.144.3
Release: 1%?dist
Summary: Zed is a high-performance, multiplayer code editor
License: MIT
URL: https://zed.dev/
Source0: https://github.com/zed-industries/zed/archive/refs/tags/v%{version}.tar.gz
Conflicts: zed
Provides: zed
BuildRequires: cargo-rpm-macros >= 24
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: clang
BuildRequires: mold
BuildRequires: alsa-lib-devel
BuildRequires: fontconfig-devel
BuildRequires: wayland-devel
BuildRequires: libxkbcommon-x11-devel
BuildRequires: openssl-devel-engine
BuildRequires: libzstd-devel
# Perl dependencies are needed for openssl-sys crate see https://docs.rs/openssl/latest/openssl/
BuildRequires: perl-FindBin
BuildRequires: perl-IPC-Cmd
BuildRequires: perl-File-Compare
BuildRequires: perl-File-Copy
BuildRequires: perl-lib
BuildRequires: vulkan-loader
BuildRequires: libcurl-devel
BuildRequires: libgit2-devel
BuildRequires: sqlite-devel
%description
Code at the speed of thought - Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
%prep
%autosetup -n %{crate}-%{version} -p1
%cargo_prep
export DO_STARTUP_NOTIFY="true"
export APP_ID="%app_id"
export APP_ICON="%app_id"
export APP_NAME="Zed Editor"
export APP_CLI="zed"
export APP="%{_libexecdir}/zed-editor"
export APP_ARGS="%U"
export ZED_UPDATE_EXPLANATION="Run dnf up to update Zed."
export ZED_RELEASE_CHANNEL=stable
export BRANDING_LIGHT="#e9aa6a"
export BRANDING_DARK="#1a5fb4"
echo "StartupWMClass=$APP_ID" >> crates/zed/resources/zed.desktop.in
envsubst < "crates/zed/resources/zed.desktop.in" > $APP_ID.desktop # from https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=zed-git#n52
envsubst < "crates/zed/resources/flatpak/zed.metainfo.xml.in" > $APP_ID.metainfo.xml
%build
export ZED_UPDATE_EXPLANATION="Run dnf up to update Zed."
echo "stable" > crates/zed/RELEASE_CHANNEL
%cargo_build -- --package zed --package cli
script/generate-licenses
%install
install -Dm755 target/rpm/zed %{buildroot}%{_libexecdir}/zed-editor
install -Dm755 target/rpm/cli %{buildroot}%{_bindir}/zed
install -Dm644 %app_id.desktop %{buildroot}%{_datadir}/applications/%app_id.desktop
install -Dm644 crates/zed/resources/app-icon.png %{buildroot}%{_datadir}/pixmaps/%app_id.png
install -Dm644 %app_id.metainfo.xml %{buildroot}%{_metainfodir}/%app_id.metainfo.xml
%if %{with check}
%check
%cargo_test
%endif
%files
%{_libexecdir}/zed-editor
%{_bindir}/zed
%{_datadir}/applications/%app_id.desktop
%{_datadir}/pixmaps/%app_id.png
%{_metainfodir}/%app_id.metainfo.xml
%license assets/licenses.md
%changelog
* Thu Jul 18 2024 James Flynn <[email protected]> - 0.144.3-1
- Initial package with zed-0.144.3