Name: custom-macros
Version: 1.0
Release: 8%{?dist}
Summary: Buildroot macros: clang + ThinLTO + x86-64-v3 for user-space rebuilds
License: MIT
URL: https://copr.fedorainfracloud.org/coprs/garrus/clang-opt/
Source0: macros.z-clang-opt
BuildArch: noarch
# Pull the clang toolchain into the buildroot: the default mock buildroot
# only ships gcc, and this project's macros switch rpmbuild to clang.
Requires: clang
Requires: lld
%description
Installs the macro override file at /etc/rpm/macros (rpm's site-default
override, loaded last), flipping this COPR project's builds to the clang
toolchain via redhat-rpm-config's native %toolchain machinery: clang +
ThinLTO (%_clang_lto) + x86-64-v3 [AVX2] baseline (%__cflags_arch_x86_64),
linking through lld (%_distro_extra_ldflags -fuse-ld=lld). Debug/debuginfo
subpackages are disabled for slim builds, and %%check is skipped (rebuild
repo). Requires clang+lld so the buildroot can actually run the switched
toolchain.
%prep
%setup -q -c -T
%install
install -d %{buildroot}%{_sysconfdir}/rpm
install -m 0644 %{SOURCE0} %{buildroot}%{_sysconfdir}/rpm/macros
install -d %{buildroot}%{_rpmconfigdir}/macros.d
install -m 0644 %{SOURCE0} %{buildroot}%{_rpmconfigdir}/macros.d/macros.z-clang-opt
%files
%{_sysconfdir}/rpm/macros
%{_rpmconfigdir}/macros.d/macros.z-clang-opt
%changelog
* Sun Oct 12 2026 Lutherus <128003623+lshyrilser1@users.noreply.github.com> - 1.0-8
- Set the check-pre macro to a bare "exit 0". Appending it after the build-pre
macro produced "cd
exit 0" (build-pre has no trailing newline), which
made the check script die with "cd: too many arguments".
* Sun Oct 12 2026 Lutherus <128003623+lshyrilser1@users.noreply.github.com> - 1.0-7
- Skip the check stage by making the check-pre macro exit 0; the without_check
macro alone only feeds the conditional-build machinery and does not stop a
literal check section (zlib-ng abicheck still ran).
- Undefine the mingw debug-package macro too, so suppressing the mingw debug
install hook no longer leaves mingw file lists referencing a nonexistent
debugfiles.list (libdeflate).
* Sun Oct 12 2026 Lutherus <128003623+lshyrilser1@users.noreply.github.com> - 1.0-6
- Keep Requires: clang, lld (a rebuild of 1.0-5 dropped them, so the buildroot
lost clang and cmake failed with "CMAKE_C_COMPILER not set").
* Sun Oct 12 2026 Lutherus <128003623+lshyrilser1@users.noreply.github.com> - 1.0-5
- Disable %check globally (%_without_check) for rebuild-friendly builds
- Neutralize %__debug_install_post / %mingw_debug_install_post so specs that
call debug hooks explicitly no longer leave unpackaged debug files
* Thu Sep 24 2026 garrus - 1.0-4
- Ride Fedora's native clang toolchain machinery: %toolchain clang +
%_clang_lto 1 (thin), %__cflags_arch_x86_64 -march=x86-64-v3 (composes
into %{optflags}), %_distro_extra_ldflags -fuse-ld=lld (real cross-TU
ThinLTO at link). Requires clang+lld: the base buildroot has neither, and
hello canary (11032646) failed with "C compiler cannot create executables".
* Thu Sep 24 2026 garrus - 1.0-3
- Install override at /etc/rpm/macros (site-default file, loaded last); the
1.0-1/1.0-2 macros.d installs had zero effect on the build (gcc was still
used), so rpm is not honoring macros.d content in the COPR buildroot.
- Add %_enable_debug_packages 0 alongside %_without_debug/%_without_debuginfo.
* Thu Sep 24 2026 garrus - 1.0-2
- Install to /usr/lib/rpm/macros.d with z- prefix (loads after macros.redhat);
the original /etc/rpm/macros.d path is not read by the COPR buildroot.
- Use %_without_debug/%_without_debuginfo (kernel-project-proven recipe).
* Thu Sep 24 2026 garrus - 1.0-1
- Initial clang + ThinLTO + x86-64-v3 buildroot macros for clang-opt project.