Add support for bundle_compat_lib

This commit is contained in:
Nikita Popov 2024-08-08 14:33:26 +00:00 committed by Timm Bäder
parent 5218c9a2fb
commit ad9f519879
5 changed files with 50 additions and 2 deletions

View file

@ -230,3 +230,23 @@ popd
%cmake_build --target runtimes
cd ..
%if %{with bundle_compat_lib}
%cmake -S ../llvm-project-%{compat_ver}.src/llvm -B ../llvm-compat-libs -G Ninja \
-DCMAKE_INSTALL_PREFIX=%{buildroot}%{_libdir}/llvm%{compat_maj_ver}/ \
-DCMAKE_SKIP_RPATH=ON \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DLLVM_BUILD_LLVM_DYLIB=ON \
-DLLVM_ENABLE_EH=ON \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_ENABLE_PROJECTS=clang \
-DLLVM_TARGETS_TO_BUILD=%{targets_to_build} \
-DLLVM_INCLUDE_BENCHMARKS=OFF \
-DLLVM_INCLUDE_TESTS=OFF
%ninja_build -C ../llvm-compat-libs LLVM
%ninja_build -C ../llvm-compat-libs libclang.so
%ninja_build -C ../llvm-compat-libs libclang-cpp.so
%endif

View file

@ -271,6 +271,9 @@
%if %{with compat_build}
%config(noreplace) /etc/ld.so.conf.d/%{name}-%{_arch}.conf
%endif
%if %{with bundle_compat_lib}
%{_libdir}/libLLVM.so.%{compat_maj_ver}*
%endif
%files -n %{pkg_name_llvm}-devel
%license llvm/LICENSE.TXT
@ -364,8 +367,12 @@
%files -n %{pkg_name_clang}-libs
%license clang/LICENSE.TXT
%{_prefix}/lib/clang/%{maj_ver}/include/*
%{install_libdir}/libclang.so.*
%{install_libdir}/libclang-cpp.so.*
%{install_libdir}/libclang.so.%{maj_ver}*
%{install_libdir}/libclang-cpp.so.%{maj_ver}*
%if %{with bundle_compat_lib}
%{_libdir}/libclang.so.%{compat_maj_ver}*
%{_libdir}/libclang-cpp.so.%{compat_maj_ver}*
%endif
%files -n %{pkg_name_clang}-devel
%license clang/LICENSE.TXT

View file

@ -5,9 +5,20 @@
%else
%bcond_with gold
%endif
# Build compat packages llvmN instead of main package for the current LLVM
# version. Used on Fedora.
%bcond_with compat_build
# Bundle compat libraries for a previous LLVM version, as part of llvm-libs and
# clang-libs. Used on RHEL.
%bcond_with bundle_compat_lib
%bcond_without check
%if %{with bundle_compat_lib}
%global compat_maj_ver 18
%global compat_ver %{compat_maj_ver}.1.8
%endif
# Compat builds do not include python-lit and lldb
%if %{with compat_build}
%bcond_with python_lit

View file

@ -269,3 +269,8 @@ rm %{buildroot}%{_bindir}/llvm-config%{exec_suffix}
# ghost presence
touch %{buildroot}%{_bindir}/llvm-config%{exec_suffix}
%if %{with bundle_compat_lib}
install -m 0755 ../llvm-compat-libs/lib/libLLVM.so.%{compat_maj_ver}* %{buildroot}%{_libdir}
install -m 0755 ../llvm-compat-libs/lib/libclang.so.%{compat_maj_ver}* %{buildroot}%{_libdir}
install -m 0755 ../llvm-compat-libs/lib/libclang-cpp.so.%{compat_maj_ver}* %{buildroot}%{_libdir}
%endif

View file

@ -3,6 +3,11 @@
%{gpgverify} --keyring='%{SOURCE6}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
%endif
%if %{with bundle_compat_lib}
%{gpgverify} --keyring='%{SOURCE6}' --signature='%{SOURCE3001}' --data='%{SOURCE3000}'
%setup -T -q -b 3000 -n llvm-project-%{compat_ver}.src
%endif
# -T : Do Not Perform Default Archive Unpacking (without this, the <n>th source would be unpacked twice)
# -b <n> : Unpack The nth Sources Before Changing Directory
# -n : Set Name of Build Directory