mirror of
https://abf.rosa.ru/djam/zed.git
synced 2025-02-22 23:52:46 +00:00
Imported from SRPM
This commit is contained in:
commit
a2db65662d
2 changed files with 85 additions and 0 deletions
2
.abf.yml
Normal file
2
.abf.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
sources:
|
||||
zed-0.149.3.tar.gz: b716aaf594a7d9564126b51105d7a8f941bd1e06
|
83
zed.spec
Normal file
83
zed.spec
Normal file
|
@ -0,0 +1,83 @@
|
|||
%define debug %nil
|
||||
%define debug_package %nil
|
||||
%define rustver 1.80.0
|
||||
%define llvmver llvm17
|
||||
%define _llvmdir /opt/%{llvmver}
|
||||
|
||||
Name: zed
|
||||
Version: 0.149.3
|
||||
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"
|
||||
|
||||
upx target/*linux*/release/*
|
||||
|
||||
|
||||
%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}*
|
||||
|
||||
|
Loading…
Add table
Reference in a new issue