%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.22.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 Patch0: 0001-build.rs-remove-rpath.patch # for a wayland-only build - no x11 support #Patch1: 0001-Remove-x11-from-all-features-for-a-wayland-only-buil.patch #Patch2: 0002-Cargo.toml-add-features-wayland-to-zed-scap.patch # https://github.com/zed-industries/zed/pull/64058 Patch3: 64058.patch BuildRequires: cargo BuildRequires: cargo-rpm-macros BuildRequires: clang BuildRequires: cmake BuildRequires: gcc # verify there no x11 in zed: # ldd target/release/zed | grep -Ei 'x11|xcb' # # ldd target/release/zed | grep -Ei 'wayland|xkbcommon|vulkan' # should show the Wayland/XKB/Vulkan runtime libraries # in the zed src: # cargo tree -e features -p zed | grep -Ei 'x11|xcb|wayland|xkbcommon' # # see https://github.com/zed-industries/zed/blob/main/script/linux BuildRequires: alsa-lib-devel BuildRequires: dbus-glib-devel BuildRequires: fontconfig-devel BuildRequires: freetype-devel BuildRequires: gettext-envsubst BuildRequires: glib2-devel BuildRequires: libva-devel BuildRequires: libxkbcommon-devel BuildRequires: libzstd-devel BuildRequires: openssl-devel BuildRequires: pipewire-devel BuildRequires: sqlite-devel BuildRequires: vulkan-loader BuildRequires: wayland-devel BuildRequires: xdg-desktop-portal # x11 BuildRequires: libxcb-devel # x11 BuildRequires: libxkbcommon-x11-devel BuildRequires: jq BuildRequires: git BuildRequires: tar # 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 # for the desktop file BuildRequires: desktop-file-utils # # for poking around in a failed build BuildRequires: mc BuildRequires: vim-minimal # Requires: hicolor-icon-theme Requires: alsa-lib Requires: dbus-libs Requires: glib2 Requires: libffi Requires: libblkid Requires: libmount Requires: libstdc++ # x11 Requires: libX11-xcb # x11 Requires: libXau # x11 Requires: libxcb Requires: libxkbcommon # x11 Requires: libxkbcommon-x11 Requires: pcre2 Requires: zlib-ng-compat # for Wayland Requires: libwayland-client Requires: libwayland-cursor Requires: libwayland-egl # libraries via dlopen - grep -R dlopen\(\" . Requires: libdrm Requires: libva Requires: mesa-libgbm # https://zedhub.dev/system-requirements Requires: xdg-utils # Vulkan related Requires: mesa-libEGL Requires: mesa-libGL Requires: mesa-dri-drivers Requires: mesa-vulkan-drivers Requires: vulkan-loader # optional, for testing Requires: vulkan-tools %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 fetch 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 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