Remove cmake source in favor of patch
Remove cmake source in favor of using LLVM_COMMON_CMAKE_UTILS with the installed cmake files and a patch, same as is done in some of the other subprojects.
This commit is contained in:
parent
99fab00322
commit
6afe272e01
30
0001-Change-LLVM_COMMON_CMAKE_UTILS-usage.patch
Normal file
30
0001-Change-LLVM_COMMON_CMAKE_UTILS-usage.patch
Normal file
@ -0,0 +1,30 @@
|
||||
From 2a0175c88ccd8c162901ac0ade56859d2b599f38 Mon Sep 17 00:00:00 2001
|
||||
From: Nikita Popov <npopov@redhat.com>
|
||||
Date: Mon, 17 Apr 2023 16:19:04 +0200
|
||||
Subject: [PATCH] Change LLVM_COMMON_CMAKE_UTILS usage
|
||||
|
||||
Let LLVM_COMMON_CMAKE_UTILS store the directory where cmake modules are
|
||||
available and stop assuming its directory structure.
|
||||
---
|
||||
clang/CMakeLists.txt | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
|
||||
index 1fff005d6525..f4b3ef4bd15a 100644
|
||||
--- a/clang/CMakeLists.txt
|
||||
+++ b/clang/CMakeLists.txt
|
||||
@@ -1,9 +1,9 @@
|
||||
cmake_minimum_required(VERSION 3.13.4)
|
||||
|
||||
if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
|
||||
- set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
|
||||
+ set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/Modules)
|
||||
endif()
|
||||
-include(${LLVM_COMMON_CMAKE_UTILS}/Modules/CMakePolicy.cmake
|
||||
+include(${LLVM_COMMON_CMAKE_UTILS}/CMakePolicy.cmake
|
||||
NO_POLICY_SCOPE)
|
||||
|
||||
# If we are not building as a part of LLVM, build Clang as an
|
||||
--
|
||||
2.39.2
|
||||
|
22
clang.spec
22
clang.spec
@ -37,7 +37,6 @@
|
||||
%endif
|
||||
|
||||
%global clang_srcdir clang-%{clang_version}%{?rc_ver:rc%{rc_ver}}.src
|
||||
%global cmake_srcdir cmake-%{clang_version}%{?rc_ver:rc%{rc_ver}}.src
|
||||
%global clang_tools_srcdir clang-tools-extra-%{clang_version}%{?rc_ver:rc%{rc_ver}}.src
|
||||
|
||||
Name: %pkg_name
|
||||
@ -53,11 +52,9 @@ Source3: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{clang_
|
||||
Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{clang_version}%{?rc_ver:-rc%{rc_ver}}/%{clang_tools_srcdir}.tar.xz
|
||||
Source2: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{clang_version}%{?rc_ver:-rc%{rc_ver}}/%{clang_tools_srcdir}.tar.xz.sig
|
||||
%endif
|
||||
Source4: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{clang_version}%{?rc_ver:-rc%{rc_ver}}/%{cmake_srcdir}.tar.xz
|
||||
Source5: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{clang_version}%{?rc_ver:-rc%{rc_ver}}/%{cmake_srcdir}.tar.xz.sig
|
||||
Source6: release-keys.asc
|
||||
Source4: release-keys.asc
|
||||
%if %{without compat_build}
|
||||
Source7: macros.%{name}
|
||||
Source5: macros.%{name}
|
||||
%endif
|
||||
|
||||
# Patches for clang
|
||||
@ -78,6 +75,8 @@ Patch8: D138472.diff
|
||||
|
||||
Patch10: fix-ieee128-cross.diff
|
||||
|
||||
Patch11: 0001-Change-LLVM_COMMON_CMAKE_UTILS-usage.patch
|
||||
|
||||
%if %{without compat_build}
|
||||
# Patches for clang-tools-extra
|
||||
# See https://reviews.llvm.org/D120301
|
||||
@ -260,19 +259,13 @@ Requires: python3
|
||||
|
||||
|
||||
%prep
|
||||
%{gpgverify} --keyring='%{SOURCE6}' --signature='%{SOURCE3}' --data='%{SOURCE0}'
|
||||
%{gpgverify} --keyring='%{SOURCE6}' --signature='%{SOURCE5}' --data='%{SOURCE4}'
|
||||
%{gpgverify} --keyring='%{SOURCE4}' --signature='%{SOURCE3}' --data='%{SOURCE0}'
|
||||
|
||||
%setup -T -q -b 4 -n %{cmake_srcdir}
|
||||
# TODO: It would be more elegant to set -DLLVM_COMMON_CMAKE_UTILS=%{_builddir}/%{cmake_srcdir},
|
||||
# but this is not a CACHED variable, so we can't actually set it externally :(
|
||||
cd ..
|
||||
mv %{cmake_srcdir} cmake
|
||||
%if %{with compat_build}
|
||||
%autosetup -n %{clang_srcdir} -p2
|
||||
%else
|
||||
|
||||
%{gpgverify} --keyring='%{SOURCE6}' --signature='%{SOURCE2}' --data='%{SOURCE1}'
|
||||
%{gpgverify} --keyring='%{SOURCE4}' --signature='%{SOURCE2}' --data='%{SOURCE1}'
|
||||
%setup -T -q -b 1 -n %{clang_tools_srcdir}
|
||||
%autopatch -m200 -p2
|
||||
|
||||
@ -366,6 +359,7 @@ sed -i 's/\@FEDORA_LLVM_LIB_SUFFIX\@//g' test/lit.cfg.py
|
||||
%else
|
||||
-DLLVM_TABLEGEN_EXE:FILEPATH=%{_bindir}/llvm-tblgen \
|
||||
%endif
|
||||
-DLLVM_COMMON_CMAKE_UTILS=%{_libdir}/cmake/llvm \
|
||||
-DCLANG_ENABLE_ARCMT:BOOL=ON \
|
||||
-DCLANG_ENABLE_STATIC_ANALYZER:BOOL=ON \
|
||||
-DCLANG_INCLUDE_DOCS:BOOL=ON \
|
||||
@ -406,7 +400,7 @@ rm -Rf %{buildroot}%{install_prefix}/lib/{libear,libscanbuild}
|
||||
# File in the macros file for other packages to use. We are not doing this
|
||||
# in the compat package, because the version macros would # conflict with
|
||||
# eachother if both clang and the clang compat package were installed together.
|
||||
install -p -m0644 -D %{SOURCE7} %{buildroot}%{_rpmmacrodir}/macros.%{name}
|
||||
install -p -m0644 -D %{SOURCE5} %{buildroot}%{_rpmmacrodir}/macros.%{name}
|
||||
sed -i -e "s|@@CLANG_MAJOR_VERSION@@|%{maj_ver}|" \
|
||||
-e "s|@@CLANG_MINOR_VERSION@@|%{min_ver}|" \
|
||||
-e "s|@@CLANG_PATCH_VERSION@@|%{patch_ver}|" \
|
||||
|
2
sources
2
sources
@ -2,5 +2,3 @@ SHA512 (clang-16.0.1.src.tar.xz) = c7ef4c386471850f30e194d0a8afe95fdd366c9182b1c
|
||||
SHA512 (clang-16.0.1.src.tar.xz.sig) = 31756b55641debde8e075819a3705c9fbf9a3e39d0f5da5a0e8421bd96eb19972ced6f22df0f66f918d48375089c06b5e499f0627dc81d22956421d9791e088e
|
||||
SHA512 (clang-tools-extra-16.0.1.src.tar.xz) = eb3a5656526db559fa331e4020305b6070a33e9c4e7a082f0ebe2b307ac43d542c989585e99c660fc749041774ff80dbad089678456318b40415e340654424c8
|
||||
SHA512 (clang-tools-extra-16.0.1.src.tar.xz.sig) = c661a454ddc27aa12fd82aa19f49e26982147519bb108580059042302dc010b351d99fef65dc51c854a3d06a89a9200ee22dd613a1777bcf35b5236fa75ba2af
|
||||
SHA512 (cmake-16.0.1.src.tar.xz) = 7a0f01a82660a953e06b1df267918542205ac46f151d284dca74255c36fe5ccd995266638a85ce502a81cdd5e76ff3311e5f8488e09d0abbf22ee07cec186f5f
|
||||
SHA512 (cmake-16.0.1.src.tar.xz.sig) = 8d49050e9b04df253a5bb2fa3b27796f204d085610432826bef6bb6cab876990d67e7fd5267fc89fadf21d88da73c535c82ae6ea0e1c867f7cd5efac244b0fa2
|
||||
|
Loading…
Reference in New Issue
Block a user