%define _debugsource_template %{nil} %define debug_package %{nil} # zed-editor embeds /usr/lib64 runpath (redundant with default ld search path) %define __brp_check_rpaths %{nil} %global __brp_mangle_shebangs_exclude_from ^/usr/src/.*$ %global source_date_epoch_from_changelog 0 %bcond_with vendored Name: zed Version: 1.1.6 Release: 7%{?dist} Summary: High-performance, multiplayer code editor from the creators of Atom and Tree-sitter License: AGPL-3.0-or-later AND Apache-2.0 AND GPL-3.0-or-later URL: https://github.com/zed-industries/zed Source0: %{url}/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz %if %{with vendored} Source1: %{name}-%{version}-vendor.tar.zst %endif # Rust edition 2024 requires 1.85+. Zed toolchain is 1.95. BuildRequires: cargo-rpm-macros BuildRequires: cargo >= 1.85 BuildRequires: rust >= 1.85 BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: clang BuildRequires: cmake BuildRequires: gettext BuildRequires: jq BuildRequires: llvm BuildRequires: make BuildRequires: pkgconf-pkg-config BuildRequires: desktop-file-utils BuildRequires: systemd-rpm-macros # System C library devel packages for Rust FFI crate linkage BuildRequires: alsa-lib-devel BuildRequires: fontconfig-devel BuildRequires: glib2-devel BuildRequires: libgit2-devel BuildRequires: libva-devel BuildRequires: libxcb-devel BuildRequires: libxkbcommon-x11-devel BuildRequires: libzstd-devel BuildRequires: openssl-devel BuildRequires: protobuf-compiler BuildRequires: sqlite-devel BuildRequires: wayland-devel BuildRequires: vulkan-loader BuildRequires: libcurl-devel BuildRequires: perl-FindBin BuildRequires: perl-IPC-Cmd BuildRequires: perl-File-Compare BuildRequires: perl-File-Copy BuildRequires: perl-lib %description Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter. It blends the power of an IDE with the speed of a lightweight editor, featuring GPU-accelerated rendering, LSP integration, and real-time collaboration. %prep %autosetup -n %{name}-%{version} rm -f rust-toolchain.toml %if %{with vendored} tar -xaf %{SOURCE1} test -f .cargo/config.toml %else %cargo_prep -N # can not build it offline yet if not vendored mkdir -p .cargo touch .cargo/config.toml sed -i 's/offline = true/offline = false/g' .cargo/config.toml || : echo "offline = false" >> .cargo/config.toml %endif # Replace the non-existent from_const with the standard from method # This was needed in older versions, keeping just in case sed -i 's/SmallVec::from_const/SmallVec::from/g' crates/gpui/src/svg_renderer.rs || : %build export CARGO_HOME=$PWD/.cargo-home export CC=clang export RUSTFLAGS="%{?build_rustflags} -Cdebuginfo=line-tables-only" export LIBGIT2_NO_VENDOR=1 export LIBSQLITE3_SYS_USE_PKG_CONFIG=1 export ZSTD_SYS_USE_PKG_CONFIG=1 export PROTOC=/usr/bin/protoc export PROTOC_INCLUDE=/usr/include export ZED_UPDATE_EXPLANATION="Please use the package manager to update zed." export ZED_RELEASE_CHANNEL=stable # Build CLI pushd crates/cli/ %if %{with vendored} cargo build --release --frozen --offline %else %{cargo_build} %endif popd # Build Editor pushd crates/zed/ %if %{with vendored} cargo build --release --frozen --offline %else %{cargo_build} %endif popd %install CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-target}" # Main editor binary under libexec install -Dpm 0755 $CARGO_TARGET_DIR/release/zed \ %{buildroot}%{_libexecdir}/zed-editor # CLI launcher install -Dpm 0755 $CARGO_TARGET_DIR/release/cli \ %{buildroot}%{_bindir}/zed # Desktop file mkdir -p %{buildroot}%{_datadir}/applications export APP_ID="dev.zed.Zed" export APP_NAME="Zed" export APP_CLI="zed" export APP_ICON="zed" export APP_ARGS="%%U" export DO_STARTUP_NOTIFY="true" envsubst < crates/zed/resources/zed.desktop.in \ > %{buildroot}%{_datadir}/applications/dev.zed.Zed.desktop chmod 0755 %{buildroot}%{_datadir}/applications/dev.zed.Zed.desktop # App icons for res in 512 1024; do src="crates/zed/resources/app-icon.png" if [ "$res" = "1024" ]; then src="crates/zed/resources/app-icon@2x.png" fi install -Dpm 0644 "$src" \ %{buildroot}%{_datadir}/icons/hicolor/${res}x${res}/apps/zed.png done # Metainfo (appstream) export BRANDING_LIGHT="#ffc83d" export BRANDING_DARK="#ffc83d" mkdir -p %{buildroot}%{_metainfodir} sed '/@release_info@/d' < crates/zed/resources/flatpak/zed.metainfo.xml.in | \ envsubst > %{buildroot}%{_metainfodir}/dev.zed.Zed.metainfo.xml # Licenses install -Dpm 0644 LICENSE-AGPL %{buildroot}%{_licensedir}/%{name}/LICENSE-AGPL install -Dpm 0644 LICENSE-APACHE %{buildroot}%{_licensedir}/%{name}/LICENSE-APACHE install -Dpm 0644 LICENSE-GPL %{buildroot}%{_licensedir}/%{name}/LICENSE-GPL %check desktop-file-validate %{buildroot}%{_datadir}/applications/dev.zed.Zed.desktop # Skip version check as it might require GPU/Display in some environments # %{buildroot}%{_libexecdir}/zed-editor --version %files %license %{_licensedir}/%{name}/ %doc README.md %{_bindir}/zed %{_libexecdir}/zed-editor %{_datadir}/applications/dev.zed.Zed.desktop %{_metainfodir}/dev.zed.Zed.metainfo.xml %{_datadir}/icons/hicolor/512x512/apps/zed.png %{_datadir}/icons/hicolor/1024x1024/apps/zed.png %changelog * Fri May 08 2026 sachesi - 1.1.6-7 - Fix Cargo registry override: use %%cargo_prep -N to avoid system registry - Force offline = false in .cargo/config.toml for online builds * Fri May 08 2026 sachesi - 1.1.6-6 - Disable RPATH check properly with %%__brp_check_rpaths %%{nil} - Align BuildRequires and build process with working example - Add SmallVec sed fix and use %%cargo_build where possible - Fix shebang mangling exclusion and source_date_epoch