From 653d3f17d2b96f98466949f71c4779ae00802bf7 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 1 Aug 2024 12:24:01 +0000 Subject: [PATCH] Move llvm-config handling --- install.spec.inc | 53 ++++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/install.spec.inc b/install.spec.inc index 5958aec..97844fc 100644 --- a/install.spec.inc +++ b/install.spec.inc @@ -60,32 +60,6 @@ done %endif -# llvm-config special casing. llvm-config is managed by update-alternatives. -# the original file must remain available for compatibility with the CMake -# infrastructure. Without compat, cmake points to the symlink, with compat it -# points to the original file. - -%if %{without compat_build} - -mv %{buildroot}/%{install_bindir}/llvm-config %{buildroot}/%{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} -# We still maintain a versionned symlink for consistency across llvm versions. -# This is specific to the non-compat build and matches the exec prefix for -# compat builds. An isa-agnostic versionned symlink is also maintained in the (un)install -# steps. -(cd %{buildroot}/%{install_bindir} ; ln -s llvm-config%{exec_suffix}-%{__isa_bits} llvm-config-%{maj_ver}-%{__isa_bits} ) -# ghost presence -touch %{buildroot}%{_bindir}/llvm-config-%{maj_ver} - -%else - -rm %{buildroot}%{_bindir}/llvm-config%{exec_suffix} -(cd %{buildroot}/%{install_bindir} ; ln -s llvm-config llvm-config%{exec_suffix}-%{__isa_bits} ) - -%endif - -# ghost presence -touch %{buildroot}%{_bindir}/llvm-config%{exec_suffix} - mkdir -p %{buildroot}%{pkg_datadir}/llvm/cmake cp -Rv cmake/* %{buildroot}%{pkg_datadir}/llvm/cmake @@ -280,3 +254,30 @@ for f in %{buildroot}/%{install_bindir}/*; do ln -s ../../%{install_bindir}/$filename %{buildroot}/%{_bindir}/$filename%{exec_suffix} done %endif + +# llvm-config special casing. llvm-config is managed by update-alternatives. +# the original file must remain available for compatibility with the CMake +# infrastructure. Without compat, cmake points to the symlink, with compat it +# points to the original file. + +%if %{without compat_build} + +mv %{buildroot}/%{install_bindir}/llvm-config %{buildroot}/%{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} +# We still maintain a versionned symlink for consistency across llvm versions. +# This is specific to the non-compat build and matches the exec prefix for +# compat builds. An isa-agnostic versionned symlink is also maintained in the (un)install +# steps. +(cd %{buildroot}/%{install_bindir} ; ln -s llvm-config%{exec_suffix}-%{__isa_bits} llvm-config-%{maj_ver}-%{__isa_bits} ) +# ghost presence +touch %{buildroot}%{_bindir}/llvm-config-%{maj_ver} + +%else + +rm %{buildroot}%{_bindir}/llvm-config%{exec_suffix} +(cd %{buildroot}/%{install_bindir} ; ln -s llvm-config llvm-config%{exec_suffix}-%{__isa_bits} ) + +%endif + +# ghost presence +touch %{buildroot}%{_bindir}/llvm-config%{exec_suffix} +