%global debug_package %{nil} %global source_date_epoch_from_changelog 0 %global __brp_mangle_shebangs_exclude_from ^/usr/src/.*$ %global crate zed %global app_id dev.zed.Zed %global version 0.188.0 %global release 1 # set this to "1" if building a pre release %global pre 1 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: %{name}-%{version}-pre.tar.gz %else Source0: %{name}-%{version}.tar.gz %endif #Patch0: a2d83ec6195c0f3e254a16d4dc7d47f6c6a7bf18.patch BuildRequires: cargo-rpm-macros #BuildRequires: gcc #BuildRequires: g++ BuildRequires: clang BuildRequires: alsa-lib-devel BuildRequires: fontconfig-devel BuildRequires: wayland-devel BuildRequires: libxkbcommon-x11-devel BuildRequires: openssl-devel BuildRequires: libzstd-devel 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: cmake ### for the desktop file BuildRequires: desktop-file-utils %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 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_ARGS="%U" export ZED_RELEASE_CHANNEL=stable envsubst < "crates/zed/resources/zed.desktop.in" > $APP_ID.desktop envsubst < "crates/zed/resources/flatpak/zed.metainfo.xml.in" > $APP_ID.metainfo.xml %cargo_prep -N ## can not build it offline yet sed -i 's/offline = true/offline = false/g' .cargo/config.toml %build # build with clang like zed does export CC=$(which clang) export ZED_UPDATE_EXPLANATION="Please use the package manager to update zed." script/generate-licenses ## Build CLI #pushd crates/cli/ #%%{cargo_build} #popd ## Build Editor #pushd crates/zed/ #%%{cargo_build} #popd # see https://github.com/zed-industries/zed/blob/main/script/bundle-linux /usr/bin/env CARGO_HOME=.cargo RUSTC_BOOTSTRAP=1 RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Cforce-frame-pointers=yes --cap-lints=warn' /usr/bin/cargo build -j${RPM_BUILD_NCPUS} -Z avoid-dev-deps --release --target "x86_64-unknown-linux-gnu" --package zed --package cli strip --strip-debug "target/x86_64-unknown-linux-gnu/release/zed" strip --strip-debug "target/x86_64-unknown-linux-gnu/release/cli" %install #install -Dm755 target/release/zed %{buildroot}%{_libexecdir}/zed-editor #install -Dm755 target/release/cli %{buildroot}%{_bindir}/zed ##install -Dm755 target/release/zed %{buildroot}%{_bindir}/zed install -Dm755 target/x86_64-unknown-linux-gnu/release/zed %{buildroot}%{_libexecdir}/zed-editor install -Dm755 target/x86_64-unknown-linux-gnu/release/cli %{buildroot}%{_bindir}/zed desktop-file-install \ --dir=%{buildroot}%{_datadir}/applications \ %app_id.desktop #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 %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 %{_libexecdir}/zed-editor %{_datadir}/applications/%app_id.desktop %{_datadir}/pixmaps/%app_id.* %{_metainfodir}/%app_id.metainfo.xml %changelog * Thu May 22 2025 Patrick Laimbock - 0.188.0-0.1 - update to version 0.188.0-pre * Thu May 22 2025 Patrick Laimbock - 0.187.5-1 - update to version 0.187.5 * Thu May 15 2025 Patrick Laimbock - 0.187.2-0.1 - update to version 0.187.2-pre * Thu May 15 2025 Patrick Laimbock - 0.186.9-1 - update to version 0.186.9 * Wed May 14 2025 Patrick Laimbock - 0.187.1-0.1 - update to version 0.187.1-pre * Wed May 14 2025 Patrick Laimbock - 0.186.8-1 - update to version 0.186.8 * Mon May 12 2025 Patrick Laimbock - 0.186.7-0.1 - update to version 0.186.7-pre * Mon May 12 2025 Patrick Laimbock - 0.185.15-1 - update to version 0.185.15 * Thu May 08 2025 Patrick Laimbock - 0.185.12-1 - update to version 0.185.12 * Wed May 07 2025 Patrick Laimbock - 0.185.10-1 - update to 0.185.10 * Tue May 06 2025 Patrick Laimbock - 0.185.7-0.1 - update to version 0.185.7-pre * Mon May 05 2025 Patrick Laimbock - 0.184.10-1 - update to version 0.184.10 * Sat May 03 2025 Patrick Laimbock - 0.184.9-1 - update to 0.184.9 * Thu May 01 2025 Patrick Laimbock - 0.184.8-1 - update to version 0.184.8 * Tue Apr 29 2025 Patrick Laimbock - 0.184.6-0.1 - update to version 0.184.6-pre * Tue Apr 29 2025 Patrick Laimbock - 0.184.5-0.1 - update to version 0.184.5-pre * Sat Apr 26 2025 Patrick Laimbock - 0.183.11-1 - update to version 0.183.11 * Fri Apr 18 2025 Patrick Laimbock - 0.182.11-1 - update to version 0.182.11 * Thu Apr 17 2025 Patrick Laimbock - 0.182.10-1 - update to version 0.182.10 * Tue Apr 15 2025 Patrick Laimbock - 0.181.8-1 - build with clang - set debug_package %%{nil} * Sun Apr 13 2025 Patrick Laimbock - 0.181.6-1 - update to version 0.181.6 * Tue Apr 08 2025 Patrick Laimbock - 0.180.3-1 - update to version 0.180.3 * Thu Apr 03 2025 Patrick Laimbock - 0.180.2-1 - update to version 0.180.2 * Thu Mar 20 2025 Patrick Laimbock - 0.178.5-1 - update to version 0.178.5 * Thu Mar 13 2025 Patrick Laimbock - 0.178.0-0.1 - update to version 0.178.0-pre * Sun Feb 02 2025 Patrick Laimbock - 0.171.6-1 - update to version 0.171.6 - based on https://copr.fedorainfracloud.org/coprs/che/zed