%global debug_package %{nil} %global rustflags_debuginfo 0 #%%global source_date_epoch_from_changelog 0 #%%global __brp_mangle_shebangs_exclude_from ^/usr/src/.*$ %global toolchain clang %global crate zed %global app_id dev.zed.Zed %global version 1.18.0 %global release 1 # set this to "1" if building a pre release %global pre 0 Name: zed Version: %{version} %if %{pre} Release: 0.%{release}.pre%{?dist} %else Release: %{release}%{?dist} %endif Summary: a high-performance multiplayer code editor License: AGPL-3.0-or-later AND Apache-2.0 AND GPL-3.0-or-later URL: https://github.com/zed-industries/zed %if %{pre} Source0: https://github.com/zed-industries/zed/archive/refs/tags/v%{version}-pre.tar.gz %else Source0: https://github.com/zed-industries/zed/archive/refs/tags/v%{version}.tar.gz %endif BuildRequires: cargo BuildRequires: cargo-rpm-macros BuildRequires: clang BuildRequires: cmake BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: mold BuildRequires: alsa-lib-devel BuildRequires: fontconfig-devel BuildRequires: gettext-envsubst BuildRequires: glib2-devel BuildRequires: git BuildRequires: jq BuildRequires: libcurl-devel BuildRequires: libva-devel BuildRequires: libxcb-devel BuildRequires: libxkbcommon-x11-devel BuildRequires: libzstd-devel BuildRequires: openssl-devel # perl is needed for building the openssl crate BuildRequires: perl-FindBin BuildRequires: perl-IPC-Cmd BuildRequires: perl-File-Compare BuildRequires: perl-File-Copy BuildRequires: perl-lib BuildRequires: pipewire-devel BuildRequires: sqlite-devel BuildRequires: tar BuildRequires: vulkan-loader BuildRequires: wayland-devel # for the desktop file BuildRequires: desktop-file-utils %ifarch x86_64 BuildRequires: libedit(x86-64) %endif BuildRequires: chrpath Requires: hicolor-icon-theme %description Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter. It's also open source. %prep %if %{pre} %autosetup -p1 -n %{crate}-%{version}-pre %else %autosetup -p1 -n %{crate}-%{version} %endif # do NOT use %%cargo_prep – it forces offline mode and Zed needs git deps. # COPR has network enabled, so we let cargo fetch normally. mkdir -p .cargo 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" %if %{pre} export ZED_RELEASE_CHANNEL=preview %else export ZED_RELEASE_CHANNEL=stable %endif export ZED_UPDATE_EXPLANATION="Please use the package manager to update zed." envsubst < "crates/zed/resources/zed.desktop.in" > $APP_ID.desktop sed -i 's|@release_info@||g' crates/zed/resources/flatpak/zed.metainfo.xml.in envsubst < "crates/zed/resources/flatpak/zed.metainfo.xml.in" > $APP_ID.metainfo.xml %build echo "stable" > crates/zed/RELEASE_CHANNEL export ZED_UPDATE_EXPLANATION="Please use the package manager to update zed." # generate assets/licenses.md (this installs dependency cargo-about) script/generate-licenses # compiled into the binary via option_env!("RELEASE_VERSION"); without it # `zed --version` and the About dialog report a blank version. export RELEASE_VERSION=%{version} # online build (network is available on COPR) export CARGO_HOME=%{_builddir}/.cargo cargo build \ --release \ --package zed \ --package cli \ --package remote_server %install install -Dm0755 target/release/zed %{buildroot}%{_libexecdir}/zed-editor install -Dm0755 target/release/cli %{buildroot}%{_bindir}/zed install -Dm0755 target/release/remote_server %{buildroot}%{_bindir}/zed-remote_server # remove rpath chrpath --delete %{buildroot}%{_libexecdir}/zed-editor chrpath --delete %{buildroot}%{_bindir}/zed chrpath --delete %{buildroot}%{_bindir}/zed-remote_server desktop-file-install \ --dir=%{buildroot}%{_datadir}/applications \ %app_id.desktop %if %{pre} install -Dm644 crates/zed/resources/app-icon-dev.png %{buildroot}%{_datadir}/pixmaps/%app_id.png %else install -Dm644 crates/zed/resources/app-icon.png %{buildroot}%{_datadir}/pixmaps/%app_id.png %endif ##install -Dm644 assets/icons/logo_96.svg %{buildroot}%{_datadir}/pixmaps/%app_id.svg install -Dm644 %app_id.metainfo.xml %{buildroot}%{_metainfodir}/%app_id.metainfo.xml %files %license LICENSE-* assets/licenses.md %{_bindir}/zed %{_bindir}/zed-remote_server %{_libexecdir}/zed-editor %{_datadir}/applications/%app_id.desktop %{_datadir}/pixmaps/%app_id.* %{_metainfodir}/%app_id.metainfo.xml %changelog * Mon Aug 03 2026 Patrick - initial release