%global debug_package %{nil} %global gituser just-every %global gitname code Name: code Version: 0.4.20 Release: 0%{?dist}.1sunshine Summary: A fast, local coding agent for your terminal License: Apache-2.0 URL: https://github.com/%{gituser}/%{gitname} Source0: %{url}/archive/refs/tags/v%{version}.tar.gz#/%{gituser}-%{name}-%{version}.tar.gz # Patch1: %%{url}/pull/16588.patch#/update_crates_16588.patch BuildRequires: rust-packaging protobuf-compiler cmake BuildRequires: llvm-devel clang-devel BuildRequires: openssl-devel BuildRequires: devscripts %description Code is a fast, local coding agent for your terminal. It's a community-driven fork of openai/codex focused on real developer ergonomics: Browser integration, multi-agents, theming, and reasoning control — all while staying compatible with upstream. %prep %autosetup -p1 -n %{name}-%{version} %build %set_build_flags # export CFLAGS=$(echo "$CFLAGS -Wno-error=implicit-function-declaration") # sed -i 's|lto = true|lto = "thin"|' Cargo.toml export RUSTFLAGS="%{build_rustflags}" export RUSTFLAGS=$(echo "$RUSTFLAGS" | sed -e 's|debuginfo=2|debuginfo=0|') pushd code-rs cargo build --release --verbose popd %install # control flow protection not supported pushd code-rs hardening-check -v --nocfprotection --nobranchprotection target/release/%{name} install -Dm755 target/release/%{name} %{buildroot}%{_bindir}/%{name} popd %files %{_bindir}/%{name} %doc README.md CHANGELOG.md %license LICENSE %changelog * Thu Nov 20 2025 Moritz Barsnick 0.4.20-0.1sunshine - initial RPM