2024-08-21 23:01:16 +03:00
|
|
|
|
%define debug %nil
|
|
|
|
|
%define debug_package %nil
|
2024-09-17 07:17:11 +00:00
|
|
|
|
%define rustver 1.80.0
|
2024-08-21 23:01:16 +03:00
|
|
|
|
%define llvmver llvm17
|
|
|
|
|
%define _llvmdir /opt/%{llvmver}
|
|
|
|
|
|
|
|
|
|
Name: zed
|
2024-10-31 14:27:57 +00:00
|
|
|
|
Version: 0.159.6
|
2024-08-21 23:01:16 +03:00
|
|
|
|
Release: 1
|
|
|
|
|
Summary: A high-performance, multiplayer code editor
|
|
|
|
|
URL: https://zed.dev
|
|
|
|
|
Source0: https://github.com/zed-industries/zed/archive/v%{version}/%{name}-%{version}.tar.gz
|
|
|
|
|
License: GPL && ASL 2.0 && AGPL
|
|
|
|
|
Group: Development/Other
|
|
|
|
|
BuildRequires: git-core
|
|
|
|
|
BuildRequires: curl
|
|
|
|
|
BuildRequires: cmake
|
|
|
|
|
BuildRequires: upx
|
|
|
|
|
%if %{mdvver} > 201610
|
|
|
|
|
BuildRequires: rust
|
|
|
|
|
BuildRequires: cargo
|
|
|
|
|
%endif
|
|
|
|
|
BuildRequires: %{llvmver}
|
|
|
|
|
BuildRequires: pkgconfig(openssl3.3)
|
|
|
|
|
BuildRequires: pkgconfig(libzstd)
|
|
|
|
|
BuildRequires: pkgconfig(alsa)
|
|
|
|
|
BuildRequires: pkgconfig(xcb)
|
|
|
|
|
BuildRequires: pkgconfig(xkbcommon)
|
|
|
|
|
BuildRequires: pkgconfig(xkbcommon-x11)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
Code at the speed of thought – Zed is a high-performance,
|
|
|
|
|
multiplayer code editor from the creators of Atom and
|
|
|
|
|
Tree-sitter.
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%setup -q
|
|
|
|
|
%if %{mdvver} <= 201610
|
|
|
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs |\
|
|
|
|
|
sh -s -- -y --profile default --default-toolchain %{rustver}
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
sed -i -e 's|clang|%{_llvmdir}/bin/clang|g' -e 's|mold|lld|' .cargo/config.toml
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
%if %{mdvver} <= 201610
|
|
|
|
|
source "$HOME/.cargo/env"
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
version_info=$(rustc --version --verbose)
|
|
|
|
|
host_line=$(echo "$version_info" | grep host)
|
|
|
|
|
target_triple=${host_line#*: }
|
|
|
|
|
|
|
|
|
|
export LLD=%{_llvmdir}/bin/lld
|
|
|
|
|
export X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR=/opt/openssl3.3
|
|
|
|
|
|
|
|
|
|
export LDFLAGS="-lstdc++-gcc10"
|
|
|
|
|
export CFLAGS="-I/usr/include/libstdc++-gcc10 -I/usr/include/libstdc++-gcc10/%{_host}"
|
|
|
|
|
export CXXFLAGS="-I/usr/include/libstdc++-gcc10 -I/usr/include/libstdc++-gcc10/%{_host}"
|
|
|
|
|
|
|
|
|
|
export RUSTFLAGS="-C link-args=-Wl,--disable-new-dtags"
|
|
|
|
|
|
|
|
|
|
cargo build --release --target "${target_triple}" --package zed --package cli
|
|
|
|
|
|
|
|
|
|
# Strip the binary of all debug symbols
|
|
|
|
|
# Later, we probably want to do something like this: https://github.com/GabrielMajeri/separate-symbols
|
|
|
|
|
strip --strip-debug "target/${target_triple}/release/zed"
|
|
|
|
|
strip --strip-debug "target/${target_triple}/release/cli"
|
|
|
|
|
|
2024-08-21 22:06:39 +00:00
|
|
|
|
upx target/*linux*/release/zed
|
|
|
|
|
upx target/*linux*/release/cli
|
2024-08-21 23:01:16 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
install -Dm0755 target/*-linux-*/release/%{name} %{buildroot}%{_bindir}/%{name}
|
|
|
|
|
install -Dm0755 target/*-linux-*/release/cli %{buildroot}%{_bindir}/%{name}-cli
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%files
|
|
|
|
|
%doc README.md LICENSE*
|
|
|
|
|
%{_bindir}/%{name}*
|
|
|
|
|
|
|
|
|
|
|