diff options
author | CoprDistGit <infra@openeuler.org> | 2024-07-30 12:53:33 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2024-07-30 12:53:33 +0000 |
commit | 52360406d943eb6fe5e11a2209985e4407bfe4ab (patch) | |
tree | 547fa3e7339f5cd4b3b808d30d266afc9f565132 | |
parent | 9d7a2f3d0b23af5254f1d2bfea703f8a7420b581 (diff) |
automatic import of cmakeopeneuler24.03_LTS
-rw-r--r-- | cmake.spec | 27 | ||||
-rw-r--r-- | macros.cmake.in | 8 |
2 files changed, 26 insertions, 9 deletions
@@ -14,6 +14,11 @@ %bcond_without sphinx %endif +# Do not build non-lto objects to reduce build time significantly. +%global build_cflags %(echo '%{build_cflags}' | sed -e 's!-ffat-lto-objects!-fno-fat-lto-objects!g') +%global build_cxxflags %(echo '%{build_cxxflags}' | sed -e 's!-ffat-lto-objects!-fno-fat-lto-objects!g') +%global build_fflags %(echo '%{build_fflags}' | sed -e 's!-ffat-lto-objects!-fno-fat-lto-objects!g') +%global build_fcflags %(echo '%{build_fflags}' | sed -e 's!-ffat-lto-objects!-fno-fat-lto-objects!g') %global rpm_macros_dir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) %{!?_pkgdocdir:%global _pkgdocdir %{_docdir}/cmake-%{version}} @@ -22,6 +27,7 @@ Name: cmake Version: 3.27.9 +%global major_version %(echo %{version} | awk -F. '{print $1}') Release: 5 Summary: Cross-platform make system License: BSD-3-Clause AND MIT-open-group AND Zlib @@ -144,8 +150,8 @@ tail -n +2 %{SOURCE5} >> %{name}.req export CFLAGS=`echo %{optflags} | sed 's/-g\b/-s/g'` export CXXFLAGS=`echo %{optflags} | sed 's/-g\b/-s/g'` export LDFLAGS="%{?__global_ldflags}" -mkdir build -pushd build +mkdir %{_vpath_builddir} +pushd %{_vpath_builddir} ../bootstrap --prefix=%{_prefix} --datadir=/share/cmake \ --docdir=/share/doc/cmake --mandir=/share/man \ --%{?with_bootstrap:no-}system-libs \ @@ -163,11 +169,13 @@ pushd build %endif %endif ; -%make_build VERBOSE=1 +popd + +%make_build -C %{_vpath_builddir} %install install -d %{buildroot}%{_pkgdocdir} -%make_install -C build CMAKE_DOC_DIR=%{buildroot}%{_pkgdocdir} +%make_install -C %{_vpath_builddir} CMAKE_DOC_DIR=%{buildroot}%{_pkgdocdir} find %{buildroot}%{_datadir}/cmake/Modules -type f | xargs chmod -x for f in ccmake cmake cpack ctest; do @@ -223,15 +231,15 @@ find %{buildroot}%{_bindir} -type f -or -type l -or -xtype l | \ sed -e '/.*-gui$/d' -e '/^$/d' -e 's!^%{buildroot}!"!g' -e 's!$!"!g' >> lib_files.mf %check -pushd build +pushd %{_vpath_builddir} # CTestTestUpload requires internet access. NO_TEST="CTestTestUpload" # Likely failing for hardening flags from system. NO_TEST="$NO_TEST|CustomCommand|RunCMake.PositionIndependentCode" -# Failing for rpm 4.19 -NO_TEST="$NO_TEST|CPackComponentsForAll-RPM-default" -NO_TEST="$NO_TEST|CPackComponentsForAll-RPM-OnePackPerGroup" -NO_TEST="$NO_TEST|CPackComponentsForAll-RPM-AllInOne" +%ifarch riscv64 +# These three tests timeout on riscv64, skip them. +NO_TEST="$NO_TEST|Qt5Autogen.ManySources|Qt5Autogen.MocInclude|Qt5Autogen.MocIncludeSymlink|Qt6Autogen.MocIncludeSymlink" +%endif bin/ctest%{?name_suffix} %{?_smp_mflags} -V -E "$NO_TEST" --output-on-failure popd @@ -310,6 +318,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %changelog * Thu Jul 18 2024 Funda Wang <fundawang@yeah.net> - 3.27.9-5 - Update cmake rpm macro +- make use of _vpath_builddir - enable check section * Wed Jul 10 2024 fuanan <fuanan3@h-partners.com> - 3.27.9-4 diff --git a/macros.cmake.in b/macros.cmake.in index 675ca90..986d3d3 100644 --- a/macros.cmake.in +++ b/macros.cmake.in @@ -58,3 +58,11 @@ %cmake@@CMAKE_MAJOR_VERSION@@_install %cmake_install %ctest@@CMAKE_MAJOR_VERSION@@(:-:h:j:u:v:A:C:D:E:F:H:I:L:M:N:O:Q:R:S:T:U:V:) \ %ctest %{**} + +# Declarative buildsystem, requires RPM 4.20+ to work +# https://rpm-software-management.github.io/rpm/manual/buildsystem.html +%buildsystem_cmake_generate_buildrequires() %{nil} +%buildsystem_cmake_conf() %cmake %* +%buildsystem_cmake_build() %cmake_build %* +%buildsystem_cmake_install() %cmake_install %* +%buildsystem_cmake_check(:-:h:j:u:v:A:C:D:E:F:H:I:L:M:N:O:Q:R:S:T:U:V:) %ctest %{**} |