Skip to content

Commit ad9f519

Browse files
nikictbaederr
authored andcommitted
Add support for bundle_compat_lib
1 parent 5218c9a commit ad9f519

File tree

5 files changed

+50
-2
lines changed

5 files changed

+50
-2
lines changed

build.spec.inc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,3 +230,23 @@ popd
230230
%cmake_build --target runtimes
231231

232232
cd ..
233+
234+
%if %{with bundle_compat_lib}
235+
%cmake -S ../llvm-project-%{compat_ver}.src/llvm -B ../llvm-compat-libs -G Ninja \
236+
-DCMAKE_INSTALL_PREFIX=%{buildroot}%{_libdir}/llvm%{compat_maj_ver}/ \
237+
-DCMAKE_SKIP_RPATH=ON \
238+
-DCMAKE_BUILD_TYPE=Release \
239+
-DBUILD_SHARED_LIBS=OFF \
240+
-DLLVM_BUILD_LLVM_DYLIB=ON \
241+
-DLLVM_ENABLE_EH=ON \
242+
-DLLVM_ENABLE_RTTI=ON \
243+
-DLLVM_ENABLE_PROJECTS=clang \
244+
-DLLVM_TARGETS_TO_BUILD=%{targets_to_build} \
245+
-DLLVM_INCLUDE_BENCHMARKS=OFF \
246+
-DLLVM_INCLUDE_TESTS=OFF
247+
248+
%ninja_build -C ../llvm-compat-libs LLVM
249+
%ninja_build -C ../llvm-compat-libs libclang.so
250+
%ninja_build -C ../llvm-compat-libs libclang-cpp.so
251+
252+
%endif

files.spec.inc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,9 @@
271271
%if %{with compat_build}
272272
%config(noreplace) /etc/ld.so.conf.d/%{name}-%{_arch}.conf
273273
%endif
274+
%if %{with bundle_compat_lib}
275+
%{_libdir}/libLLVM.so.%{compat_maj_ver}*
276+
%endif
274277

275278
%files -n %{pkg_name_llvm}-devel
276279
%license llvm/LICENSE.TXT
@@ -364,8 +367,12 @@
364367
%files -n %{pkg_name_clang}-libs
365368
%license clang/LICENSE.TXT
366369
%{_prefix}/lib/clang/%{maj_ver}/include/*
367-
%{install_libdir}/libclang.so.*
368-
%{install_libdir}/libclang-cpp.so.*
370+
%{install_libdir}/libclang.so.%{maj_ver}*
371+
%{install_libdir}/libclang-cpp.so.%{maj_ver}*
372+
%if %{with bundle_compat_lib}
373+
%{_libdir}/libclang.so.%{compat_maj_ver}*
374+
%{_libdir}/libclang-cpp.so.%{compat_maj_ver}*
375+
%endif
369376

370377
%files -n %{pkg_name_clang}-devel
371378
%license clang/LICENSE.TXT

globals.spec.inc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,20 @@
55
%else
66
%bcond_with gold
77
%endif
8+
9+
# Build compat packages llvmN instead of main package for the current LLVM
10+
# version. Used on Fedora.
811
%bcond_with compat_build
12+
# Bundle compat libraries for a previous LLVM version, as part of llvm-libs and
13+
# clang-libs. Used on RHEL.
14+
%bcond_with bundle_compat_lib
915
%bcond_without check
1016

17+
%if %{with bundle_compat_lib}
18+
%global compat_maj_ver 18
19+
%global compat_ver %{compat_maj_ver}.1.8
20+
%endif
21+
1122
# Compat builds do not include python-lit and lldb
1223
%if %{with compat_build}
1324
%bcond_with python_lit

install.spec.inc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,3 +269,8 @@ rm %{buildroot}%{_bindir}/llvm-config%{exec_suffix}
269269
# ghost presence
270270
touch %{buildroot}%{_bindir}/llvm-config%{exec_suffix}
271271

272+
%if %{with bundle_compat_lib}
273+
install -m 0755 ../llvm-compat-libs/lib/libLLVM.so.%{compat_maj_ver}* %{buildroot}%{_libdir}
274+
install -m 0755 ../llvm-compat-libs/lib/libclang.so.%{compat_maj_ver}* %{buildroot}%{_libdir}
275+
install -m 0755 ../llvm-compat-libs/lib/libclang-cpp.so.%{compat_maj_ver}* %{buildroot}%{_libdir}
276+
%endif

prep.spec.inc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
%{gpgverify} --keyring='%{SOURCE6}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
44
%endif
55

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

0 commit comments

Comments
 (0)