From f304eb1c7d99e77f23b2acc5c8eb1be76494c583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Wed, 26 Feb 2025 14:46:43 +0100 Subject: [PATCH 01/21] cmake-4.0.0-rc2 --- cmake-findruby.patch | 26 +++++++++++++++++--------- cmake.spec | 13 +++++++++---- sources | 2 +- 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/cmake-findruby.patch b/cmake-findruby.patch index 8a06752..5de08ee 100644 --- a/cmake-findruby.patch +++ b/cmake-findruby.patch @@ -1,22 +1,30 @@ -Index: cmake-3.31.4/Modules/FindRuby.cmake +Index: cmake-4.0.0-rc2/Modules/FindRuby.cmake =================================================================== ---- cmake-3.31.4.orig/Modules/FindRuby.cmake -+++ cmake-3.31.4/Modules/FindRuby.cmake -@@ -307,14 +307,9 @@ if(Ruby_EXECUTABLE AND NOT Ruby_VERSION_ +--- cmake-4.0.0-rc2.orig/Modules/FindRuby.cmake ++++ cmake-4.0.0-rc2/Modules/FindRuby.cmake +@@ -285,14 +285,9 @@ if (Ruby_EXECUTABLE AND NOT Ruby_EXECUTA _RUBY_CONFIG_VAR("sitearchdir" Ruby_SITEARCH_DIR) _RUBY_CONFIG_VAR("sitelibdir" Ruby_SITELIB_DIR) - # vendor_ruby available ? - execute_process(COMMAND ${Ruby_EXECUTABLE} -r vendor-specific -e "print 'true'" -- OUTPUT_VARIABLE Ruby_HAS_VENDOR_RUBY ERROR_QUIET) +- OUTPUT_VARIABLE Ruby_HAS_VENDOR_RUBY ERROR_QUIET) - -- if(Ruby_HAS_VENDOR_RUBY) +- if (Ruby_HAS_VENDOR_RUBY) - _RUBY_CONFIG_VAR("vendorlibdir" Ruby_VENDORLIB_DIR) - _RUBY_CONFIG_VAR("vendorarchdir" Ruby_VENDORARCH_DIR) -- endif() -+ # vendor_ruby +- endif () ++# vendor_ruby + _RUBY_CONFIG_VAR("vendorlibdir" Ruby_VENDORLIB_DIR) + _RUBY_CONFIG_VAR("vendorarchdir" Ruby_VENDORARCH_DIR) # save the results in the cache so we don't have to run ruby the next time again - set(Ruby_VERSION_MAJOR ${Ruby_VERSION_MAJOR} CACHE PATH "The Ruby major version" FORCE) + set(_Ruby_EXECUTABLE_LAST_QUERIED "${Ruby_EXECUTABLE}" CACHE INTERNAL "The ruby executable last queried for version and path info") +@@ -306,7 +301,7 @@ if (Ruby_EXECUTABLE AND NOT Ruby_EXECUTA + set(Ruby_RUBY_LIB_DIR ${Ruby_RUBY_LIB_DIR} CACHE PATH "The Ruby ruby-lib dir" FORCE) + set(Ruby_SITEARCH_DIR ${Ruby_SITEARCH_DIR} CACHE PATH "The Ruby site arch dir" FORCE) + set(Ruby_SITELIB_DIR ${Ruby_SITELIB_DIR} CACHE PATH "The Ruby site lib dir" FORCE) +- set(Ruby_HAS_VENDOR_RUBY ${Ruby_HAS_VENDOR_RUBY} CACHE BOOL "Vendor Ruby is available" FORCE) ++ set(Ruby_HAS_VENDOR_RUBY $ CACHE BOOL "Vendor Ruby is available" FORCE) + set(Ruby_VENDORARCH_DIR ${Ruby_VENDORARCH_DIR} CACHE PATH "The Ruby vendor arch dir" FORCE) + set(Ruby_VENDORLIB_DIR ${Ruby_VENDORLIB_DIR} CACHE PATH "The Ruby vendor lib dir" FORCE) diff --git a/cmake.spec b/cmake.spec index 487d4c4..5e2f732 100644 --- a/cmake.spec +++ b/cmake.spec @@ -67,15 +67,15 @@ # Setup _vpath_builddir if not defined already %{!?_vpath_builddir:%global _vpath_builddir %{_target_platform}} -%global major_version 3 -%global minor_version 31 -%global patch_version 6 +%global major_version 4 +%global minor_version 0 +%global patch_version 0 # For handling bump release by rpmdev-bumpspec and mass rebuild %global baserelease 1 # Set to RC version if building RC, else comment out. -#%%global rcsuf rc3 +%global rcsuf rc2 %if 0%{?rcsuf:1} %global pkg_version %{major_version}.%{minor_version}.%{patch_version}~%{rcsuf} @@ -508,6 +508,8 @@ NO_TEST="$NO_TEST|Qt5Autogen.ManySources|Qt5Autogen.MocInclude|Qt5Autogen.MocInc # Test failing on Fedora 41, only. NO_TEST="$NO_TEST|RunCMake.Make|RunCMake.BuildDepends|Qt6Autogen.RerunMocBasic|Qt6Autogen.RerunRccDepends" %endif +# Drop for v4.0.0-final +NO_TEST="$NO_TEST|RunCMake.LinkWarningAsError" bin/ctest%{?name_suffix} %{?_smp_mflags} -V -E "$NO_TEST" --output-on-failure ## do this only periodically, not for every build -- besser82 20221102 # Keep an eye on failing tests @@ -588,6 +590,9 @@ popd %changelog +* Wed Feb 26 2025 Björn Esser - 4.0.0~rc2-1 +- cmake-4.0.0-rc2 + * Mon Feb 24 2025 Björn Esser - 3.31.6-1 - cmake-3.31.6 Fixes rhbz#2347346 diff --git a/sources b/sources index df523b5..e0f5b84 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (cmake-3.31.6.tar.gz) = 839d06b6ebd0bf78cbe8f7ae3a7c00026e70d759a81ac51aa103f35ad985ac69be9e667aae7b5fe48c5e0c41baec791259279679dbdf2ddd8b63a48382a8a2a0 +SHA512 (cmake-4.0.0-rc2.tar.gz) = 568aee129e25941767707bad8ae8efe1d82d589df08b273315df22a579f525fb4b4f09ba27825665e5dd16c613e1d85fc33e5e827f13804a33eea6c9fdcc271b From 3604f33f8726e48382aa5d9a733c41479a081cf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Wed, 26 Feb 2025 23:36:55 +0100 Subject: [PATCH 02/21] tests/cmake-testsuite-sanity: Adapt for new builddir layout --- tests/cmake-testsuite-sanity/runtest.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/cmake-testsuite-sanity/runtest.sh b/tests/cmake-testsuite-sanity/runtest.sh index 5853dbf..71b061c 100755 --- a/tests/cmake-testsuite-sanity/runtest.sh +++ b/tests/cmake-testsuite-sanity/runtest.sh @@ -57,8 +57,9 @@ rlJournalStart rlRun "dnf builddep -y $TmpDir/SPECS/*.spec" rlRun "su -c 'rpmbuild -D \"_topdir $TmpDir\" -bp $TmpDir/SPECS/*.spec &>$TmpDir/rpmbuild.log' $BUILD_USER" rlRun "rlFileSubmit $TmpDir/rpmbuild.log" - rlRun "CMakeDir=`ls $TmpDir/BUILD | grep -E '^cmake-[0-9]+(\.[0-9]+)+(-rc[0-9]+)?$' | tail -n 1`" - rlRun "cd $TmpDir/BUILD/$CMakeDir" + rlRun "BuildDir=`ls $TmpDir/BUILD | grep -E '^cmake-[0-9]+(\.[0-9]+)+(_rc[0-9]+)?-build$' | tail -n 1`" + rlRun "CMakeDir=`ls $TmpDir/BUILD/$BuildDir | grep -E '^cmake-[0-9]+(\.[0-9]+)+(-rc[0-9]+)?$' | tail -n 1`" + rlRun "cd $TmpDir/BUILD/$BuildDir/$CMakeDir" rlRun "su -c './bootstrap &>$TmpDir/bootstrap.log' $BUILD_USER" rlRun "rlFileSubmit $TmpDir/bootstrap.log" rlRun "ln -fs /usr/bin/cmake bin/cmake" From c45037a52e8cc8e39a820880a0a55de8d12ec198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Thu, 27 Feb 2025 08:58:41 +0100 Subject: [PATCH 03/21] macros.cmake: Restore compatibility with cmake3 macros --- cmake.spec | 5 ++++- macros.cmake.in | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/cmake.spec b/cmake.spec index 5e2f732..69760fc 100644 --- a/cmake.spec +++ b/cmake.spec @@ -72,7 +72,7 @@ %global patch_version 0 # For handling bump release by rpmdev-bumpspec and mass rebuild -%global baserelease 1 +%global baserelease 2 # Set to RC version if building RC, else comment out. %global rcsuf rc2 @@ -590,6 +590,9 @@ popd %changelog +* Thu Feb 27 2025 Björn Esser - 4.0.0~rc2-2 +- Restore compatibility with cmake3 macros + * Wed Feb 26 2025 Björn Esser - 4.0.0~rc2-1 - cmake-4.0.0-rc2 diff --git a/macros.cmake.in b/macros.cmake.in index a2cbd48..0d65e1d 100644 --- a/macros.cmake.in +++ b/macros.cmake.in @@ -61,3 +61,9 @@ %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 %{**} + +# For compatibility with cmake3 macros +%cmake3 %cmake +%cmake3_build %cmake_build +%cmake3_install %cmake_install +%ctest3(:-:h:j:u:v:A:C:D:E:F:H:I:L:M:N:O:Q:R:S:T:U:V:) %ctest %{**} From 1f2cca05f1309726b6ad967e438407d4e80454e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Thu, 27 Feb 2025 09:19:57 +0100 Subject: [PATCH 04/21] Rebuild (jsoncpp) --- cmake.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cmake.spec b/cmake.spec index 69760fc..1d1c92d 100644 --- a/cmake.spec +++ b/cmake.spec @@ -8,7 +8,7 @@ # Set to bcond_without or use --with bootstrap if bootstrapping a new release # or architecture -%bcond_with bootstrap +%bcond_without bootstrap # Build with Emacs support %bcond_without emacs @@ -35,7 +35,7 @@ %bcond_without sphinx %if !0%{?rhel} -%bcond_with bundled_jsoncpp +%bcond_without bundled_jsoncpp %bcond_with bundled_rhash %else %bcond_without bundled_jsoncpp @@ -72,7 +72,7 @@ %global patch_version 0 # For handling bump release by rpmdev-bumpspec and mass rebuild -%global baserelease 2 +%global baserelease 3 # Set to RC version if building RC, else comment out. %global rcsuf rc2 @@ -590,6 +590,9 @@ popd %changelog +* Thu Feb 27 2025 Björn Esser - 4.0.0~rc2-3 +- Rebuild (jsoncpp) + * Thu Feb 27 2025 Björn Esser - 4.0.0~rc2-2 - Restore compatibility with cmake3 macros From a3a0079a1248ea656abd8cca2afc4dc66d4a826d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Thu, 27 Feb 2025 09:32:18 +0100 Subject: [PATCH 05/21] Disable bootstrap build --- cmake.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake.spec b/cmake.spec index 1d1c92d..ecaca06 100644 --- a/cmake.spec +++ b/cmake.spec @@ -8,7 +8,7 @@ # Set to bcond_without or use --with bootstrap if bootstrapping a new release # or architecture -%bcond_without bootstrap +%bcond_with bootstrap # Build with Emacs support %bcond_without emacs @@ -35,7 +35,7 @@ %bcond_without sphinx %if !0%{?rhel} -%bcond_without bundled_jsoncpp +%bcond_with bundled_jsoncpp %bcond_with bundled_rhash %else %bcond_without bundled_jsoncpp From 90810d6226a02ef9854bb2243c08b07caa228436 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Thu, 27 Feb 2025 10:53:35 +0100 Subject: [PATCH 06/21] Provide cmake3 for legacy --- cmake.spec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake.spec b/cmake.spec index ecaca06..d96732c 100644 --- a/cmake.spec +++ b/cmake.spec @@ -214,6 +214,11 @@ Requires: make # Provide the major version name Provides: %{orig_name}%{major_version} = %{version}-%{release} +# Provide cmake3 for legacy. +%if 0%{?major_version} > 3 +Provides: %{orig_name}3 = %{version}-%{release} +%endif + # Source/kwsys/MD5.c # see https://fedoraproject.org/wiki/Packaging:No_Bundled_Libraries Provides: bundled(md5-deutsch) @@ -592,6 +597,7 @@ popd %changelog * Thu Feb 27 2025 Björn Esser - 4.0.0~rc2-3 - Rebuild (jsoncpp) +- Provide cmake3 for legacy * Thu Feb 27 2025 Björn Esser - 4.0.0~rc2-2 - Restore compatibility with cmake3 macros From d8fe77bab98b15952b6e49a4e81392d965df0ec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Thu, 6 Mar 2025 10:16:21 +0100 Subject: [PATCH 07/21] cmake-4.0.0-rc3 --- cmake.spec | 7 +++++-- sources | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cmake.spec b/cmake.spec index d96732c..8354877 100644 --- a/cmake.spec +++ b/cmake.spec @@ -72,10 +72,10 @@ %global patch_version 0 # For handling bump release by rpmdev-bumpspec and mass rebuild -%global baserelease 3 +%global baserelease 1 # Set to RC version if building RC, else comment out. -%global rcsuf rc2 +%global rcsuf rc3 %if 0%{?rcsuf:1} %global pkg_version %{major_version}.%{minor_version}.%{patch_version}~%{rcsuf} @@ -595,6 +595,9 @@ popd %changelog +* Thu Mar 06 2025 Björn Esser - 4.0.0~rc3-1 +- cmake-4.0.0-rc3 + * Thu Feb 27 2025 Björn Esser - 4.0.0~rc2-3 - Rebuild (jsoncpp) - Provide cmake3 for legacy diff --git a/sources b/sources index e0f5b84..133d661 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (cmake-4.0.0-rc2.tar.gz) = 568aee129e25941767707bad8ae8efe1d82d589df08b273315df22a579f525fb4b4f09ba27825665e5dd16c613e1d85fc33e5e827f13804a33eea6c9fdcc271b +SHA512 (cmake-4.0.0-rc3.tar.gz) = 69814a171a5210b8d54e5c1e80e713b5f208f90e145eeaada1be8508c209a660e4cad03aa0b174b17844e922288a9490dddca164e99409e37821e5ab3b5c4dee From ae4f1fd8691c484b09cf526dde74b67d12bdd9e3 Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Fri, 7 Mar 2025 11:58:10 +0100 Subject: [PATCH 08/21] Drop non-standard `*_INSTALL` options Signed-off-by: Cristian Le --- cmake.spec | 5 ++++- macros.cmake.in | 8 -------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/cmake.spec b/cmake.spec index 8354877..7f419df 100644 --- a/cmake.spec +++ b/cmake.spec @@ -72,7 +72,7 @@ %global patch_version 0 # For handling bump release by rpmdev-bumpspec and mass rebuild -%global baserelease 1 +%global baserelease 2 # Set to RC version if building RC, else comment out. %global rcsuf rc3 @@ -595,6 +595,9 @@ popd %changelog +* Fri Mar 07 2025 Cristian Le - 4.0.0~rc3-2 +- Drop non-standard *_INSTALL options + * Thu Mar 06 2025 Björn Esser - 4.0.0~rc3-1 - cmake-4.0.0-rc3 diff --git a/macros.cmake.in b/macros.cmake.in index 0d65e1d..deb8484 100644 --- a/macros.cmake.in +++ b/macros.cmake.in @@ -1,7 +1,6 @@ # # Macros for cmake # -%_cmake_lib_suffix64 -DLIB_SUFFIX=64 %_cmake_shared_libs -DBUILD_SHARED_LIBS:BOOL=ON %_cmake_skip_rpath -DCMAKE_SKIP_RPATH:BOOL=ON %_cmake_version @@CMAKE_VERSION@@ @@ -30,13 +29,6 @@ -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \\\ -DCMAKE_INSTALL_FULL_SBINDIR:PATH=%{_sbindir} \\\ -DCMAKE_INSTALL_SBINDIR:PATH=%(s=%{_sbindir}; echo ${s##*/}) \\\ - -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \\\ - -DLIB_INSTALL_DIR:PATH=%{_libdir} \\\ - -DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \\\ - -DSHARE_INSTALL_PREFIX:PATH=%{_datadir} \\\ -%if "%{?_lib}" == "lib64" \ - %{?_cmake_lib_suffix64} \\\ -%endif \ %{?_cmake_shared_libs} %cmake_build \ From 66fb93f9767d0f8285b821e9f2d278f66b63b53e Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Fri, 7 Mar 2025 15:24:51 -0500 Subject: [PATCH 09/21] Define CMAKE_POLICY_VERSION_MINIMUM in %cmake cmake 4.0 drops compatibility with CMake < 3.5, meaning that any packages with an earlier CMAKE_MINIMUM_REQUIRED will fail. In many cases though, no further modification is required to build with newer versions, includes 4.0. As such, overriding this by policy will avoid the need for patching a lot of packages to fix their builds. https://cmake.org/cmake/help/latest/variable/CMAKE_POLICY_VERSION_MINIMUM.html https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html#policy-version --- cmake.spec | 5 ++++- macros.cmake.in | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake.spec b/cmake.spec index 7f419df..f97af28 100644 --- a/cmake.spec +++ b/cmake.spec @@ -72,7 +72,7 @@ %global patch_version 0 # For handling bump release by rpmdev-bumpspec and mass rebuild -%global baserelease 2 +%global baserelease 3 # Set to RC version if building RC, else comment out. %global rcsuf rc3 @@ -595,6 +595,9 @@ popd %changelog +* Fri Mar 07 2025 Yaakov Selkowitz - 4.0.0~rc3-3 +- Define CMAKE_POLICY_VERSION_MINIMUM in %%cmake + * Fri Mar 07 2025 Cristian Le - 4.0.0~rc3-2 - Drop non-standard *_INSTALL options diff --git a/macros.cmake.in b/macros.cmake.in index deb8484..dac98f4 100644 --- a/macros.cmake.in +++ b/macros.cmake.in @@ -16,6 +16,7 @@ # - Turn off stripping by default so RPM can do it separately # - Set default install prefixes and library install directories # - Turn on shared libraries by default +# - Avoid errors in packages with CMAKE_MINIMUM_REQUIRED < 3.5 %cmake \ %{set_build_flags} \ %__cmake \\\ @@ -29,6 +30,7 @@ -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \\\ -DCMAKE_INSTALL_FULL_SBINDIR:PATH=%{_sbindir} \\\ -DCMAKE_INSTALL_SBINDIR:PATH=%(s=%{_sbindir}; echo ${s##*/}) \\\ + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \\\ %{?_cmake_shared_libs} %cmake_build \ From 8d9eeb10dfce45c7e28a6fa985e5e43b474f9a37 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Tue, 11 Mar 2025 08:26:52 -0400 Subject: [PATCH 10/21] Set CMAKE_POLICY_VERSION_MINIMUM as environment variable While passing this as a cmake argument works for top-level projects, it does not carry over automatically to subprojects. Setting this in the environment works for both. --- macros.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macros.cmake.in b/macros.cmake.in index dac98f4..e42ca1c 100644 --- a/macros.cmake.in +++ b/macros.cmake.in @@ -19,6 +19,7 @@ # - Avoid errors in packages with CMAKE_MINIMUM_REQUIRED < 3.5 %cmake \ %{set_build_flags} \ + export CMAKE_POLICY_VERSION_MINIMUM=3.5 \ %__cmake \\\ %{!?__cmake_in_source_build:-S "%{_vpath_srcdir}"} \\\ %{!?__cmake_in_source_build:-B "%{__cmake_builddir}"} \\\ @@ -30,7 +31,6 @@ -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \\\ -DCMAKE_INSTALL_FULL_SBINDIR:PATH=%{_sbindir} \\\ -DCMAKE_INSTALL_SBINDIR:PATH=%(s=%{_sbindir}; echo ${s##*/}) \\\ - -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \\\ %{?_cmake_shared_libs} %cmake_build \ From ff50d850d5d1c36e00e346c3382f5146cc0fe43e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Wed, 12 Mar 2025 11:07:02 +0100 Subject: [PATCH 11/21] macros: Set CMAKE_POLICY_VERSION_MINIMUM as environment variable --- cmake.spec | 5 ++++- macros.cmake.in | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cmake.spec b/cmake.spec index f97af28..b13db20 100644 --- a/cmake.spec +++ b/cmake.spec @@ -72,7 +72,7 @@ %global patch_version 0 # For handling bump release by rpmdev-bumpspec and mass rebuild -%global baserelease 3 +%global baserelease 4 # Set to RC version if building RC, else comment out. %global rcsuf rc3 @@ -595,6 +595,9 @@ popd %changelog +* Wed Mar 12 2025 Björn Esser - 4.0.0~rc3-4 +- macros: Set CMAKE_POLICY_VERSION_MINIMUM as environment variable + * Fri Mar 07 2025 Yaakov Selkowitz - 4.0.0~rc3-3 - Define CMAKE_POLICY_VERSION_MINIMUM in %%cmake diff --git a/macros.cmake.in b/macros.cmake.in index e42ca1c..aafc191 100644 --- a/macros.cmake.in +++ b/macros.cmake.in @@ -19,7 +19,8 @@ # - Avoid errors in packages with CMAKE_MINIMUM_REQUIRED < 3.5 %cmake \ %{set_build_flags} \ - export CMAKE_POLICY_VERSION_MINIMUM=3.5 \ + CMAKE_POLICY_VERSION_MINIMUM="${CMAKE_POLICY_VERSION_MINIMUM:-3.5}" \ + export CMAKE_POLICY_VERSION_MINIMUM \ %__cmake \\\ %{!?__cmake_in_source_build:-S "%{_vpath_srcdir}"} \\\ %{!?__cmake_in_source_build:-B "%{__cmake_builddir}"} \\\ From 696e959fd59baea593a4bbbe98c5595930e55063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Wed, 12 Mar 2025 11:14:26 +0100 Subject: [PATCH 12/21] cmake-4.0.0-rc4 --- cmake.spec | 7 +++++-- sources | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cmake.spec b/cmake.spec index b13db20..f9ae3e9 100644 --- a/cmake.spec +++ b/cmake.spec @@ -72,10 +72,10 @@ %global patch_version 0 # For handling bump release by rpmdev-bumpspec and mass rebuild -%global baserelease 4 +%global baserelease 1 # Set to RC version if building RC, else comment out. -%global rcsuf rc3 +%global rcsuf rc4 %if 0%{?rcsuf:1} %global pkg_version %{major_version}.%{minor_version}.%{patch_version}~%{rcsuf} @@ -595,6 +595,9 @@ popd %changelog +* Wed Mar 12 2025 Björn Esser - 4.0.0~rc4-1 +- cmake-4.0.0-rc4 + * Wed Mar 12 2025 Björn Esser - 4.0.0~rc3-4 - macros: Set CMAKE_POLICY_VERSION_MINIMUM as environment variable diff --git a/sources b/sources index 133d661..4d2d3a4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (cmake-4.0.0-rc3.tar.gz) = 69814a171a5210b8d54e5c1e80e713b5f208f90e145eeaada1be8508c209a660e4cad03aa0b174b17844e922288a9490dddca164e99409e37821e5ab3b5c4dee +SHA512 (cmake-4.0.0-rc4.tar.gz) = a2325e22f23bd62a048b6e9e9c2b6c069260b510169686ee69e45fe1596b53947bef449b32c14471ecc94840d8275e5fe3de89dd63b2aa9e7bdcbd7972e5a457 From 4a9c46f9360f9ebb41b745952ccee580619e5d0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Wed, 12 Mar 2025 18:55:02 +0100 Subject: [PATCH 13/21] Exclude RunCMake.ParseImplicitLinkInfo from tests --- cmake.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake.spec b/cmake.spec index f9ae3e9..28140b5 100644 --- a/cmake.spec +++ b/cmake.spec @@ -514,7 +514,7 @@ NO_TEST="$NO_TEST|Qt5Autogen.ManySources|Qt5Autogen.MocInclude|Qt5Autogen.MocInc NO_TEST="$NO_TEST|RunCMake.Make|RunCMake.BuildDepends|Qt6Autogen.RerunMocBasic|Qt6Autogen.RerunRccDepends" %endif # Drop for v4.0.0-final -NO_TEST="$NO_TEST|RunCMake.LinkWarningAsError" +NO_TEST="$NO_TEST|RunCMake.LinkWarningAsError|RunCMake.ParseImplicitLinkInfo" bin/ctest%{?name_suffix} %{?_smp_mflags} -V -E "$NO_TEST" --output-on-failure ## do this only periodically, not for every build -- besser82 20221102 # Keep an eye on failing tests From b3bf0e8abc8fcae9e27f11a1dcbe872848e0eb32 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Tue, 18 Mar 2025 18:38:42 -0400 Subject: [PATCH 14/21] Revert to 3.31.6 Rebuild (jsoncpp) Fix build with latest curl https://pagure.io/fesco/issue/3377 --- cmake-curl-fix.patch | 33 ++++++++++++++++++ cmake-findruby.patch | 26 +++++--------- cmake.spec | 46 ++++++------------------- macros.cmake.in | 17 +++++---- sources | 2 +- tests/cmake-testsuite-sanity/runtest.sh | 5 ++- 6 files changed, 64 insertions(+), 65 deletions(-) create mode 100644 cmake-curl-fix.patch diff --git a/cmake-curl-fix.patch b/cmake-curl-fix.patch new file mode 100644 index 0000000..118733f --- /dev/null +++ b/cmake-curl-fix.patch @@ -0,0 +1,33 @@ +From 1b0c92a3a1b782ff3e1c4499b6ab8db614d45bcd Mon Sep 17 00:00:00 2001 +From: Brad King +Date: Mon, 10 Mar 2025 11:08:42 -0400 +Subject: [PATCH] cmCurl: Avoid using undocumented type for CURLOPT_NETRC + values + +Since upstream curl commit `2ec00372a1` (curl.h: change some enums to +defines with L suffix, 2025-02-25), the `CURL_NETRC_*` constants are +integer literals instead of `enum CURL_NETRC_OPTION`. It turns out +that `curl_easy_setopt` has always expected a `long` anyway, and +that `CURL_NETRC_OPTION` is not documented for public use. + +Fixes: #26754 +--- + Source/cmCurl.cxx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Source/cmCurl.cxx b/Source/cmCurl.cxx +index b9133ed7d47..0cf8a71a72d 100644 +--- a/Source/cmCurl.cxx ++++ b/Source/cmCurl.cxx +@@ -170,7 +170,7 @@ std::string cmCurlSetNETRCOption(::CURL* curl, const std::string& netrc_level, + const std::string& netrc_file) + { + std::string e; +- CURL_NETRC_OPTION curl_netrc_level = CURL_NETRC_LAST; ++ long curl_netrc_level = CURL_NETRC_LAST; + ::CURLcode res; + + if (!netrc_level.empty()) { +-- +GitLab + diff --git a/cmake-findruby.patch b/cmake-findruby.patch index 5de08ee..8a06752 100644 --- a/cmake-findruby.patch +++ b/cmake-findruby.patch @@ -1,30 +1,22 @@ -Index: cmake-4.0.0-rc2/Modules/FindRuby.cmake +Index: cmake-3.31.4/Modules/FindRuby.cmake =================================================================== ---- cmake-4.0.0-rc2.orig/Modules/FindRuby.cmake -+++ cmake-4.0.0-rc2/Modules/FindRuby.cmake -@@ -285,14 +285,9 @@ if (Ruby_EXECUTABLE AND NOT Ruby_EXECUTA +--- cmake-3.31.4.orig/Modules/FindRuby.cmake ++++ cmake-3.31.4/Modules/FindRuby.cmake +@@ -307,14 +307,9 @@ if(Ruby_EXECUTABLE AND NOT Ruby_VERSION_ _RUBY_CONFIG_VAR("sitearchdir" Ruby_SITEARCH_DIR) _RUBY_CONFIG_VAR("sitelibdir" Ruby_SITELIB_DIR) - # vendor_ruby available ? - execute_process(COMMAND ${Ruby_EXECUTABLE} -r vendor-specific -e "print 'true'" -- OUTPUT_VARIABLE Ruby_HAS_VENDOR_RUBY ERROR_QUIET) +- OUTPUT_VARIABLE Ruby_HAS_VENDOR_RUBY ERROR_QUIET) - -- if (Ruby_HAS_VENDOR_RUBY) +- if(Ruby_HAS_VENDOR_RUBY) - _RUBY_CONFIG_VAR("vendorlibdir" Ruby_VENDORLIB_DIR) - _RUBY_CONFIG_VAR("vendorarchdir" Ruby_VENDORARCH_DIR) -- endif () -+# vendor_ruby +- endif() ++ # vendor_ruby + _RUBY_CONFIG_VAR("vendorlibdir" Ruby_VENDORLIB_DIR) + _RUBY_CONFIG_VAR("vendorarchdir" Ruby_VENDORARCH_DIR) # save the results in the cache so we don't have to run ruby the next time again - set(_Ruby_EXECUTABLE_LAST_QUERIED "${Ruby_EXECUTABLE}" CACHE INTERNAL "The ruby executable last queried for version and path info") -@@ -306,7 +301,7 @@ if (Ruby_EXECUTABLE AND NOT Ruby_EXECUTA - set(Ruby_RUBY_LIB_DIR ${Ruby_RUBY_LIB_DIR} CACHE PATH "The Ruby ruby-lib dir" FORCE) - set(Ruby_SITEARCH_DIR ${Ruby_SITEARCH_DIR} CACHE PATH "The Ruby site arch dir" FORCE) - set(Ruby_SITELIB_DIR ${Ruby_SITELIB_DIR} CACHE PATH "The Ruby site lib dir" FORCE) -- set(Ruby_HAS_VENDOR_RUBY ${Ruby_HAS_VENDOR_RUBY} CACHE BOOL "Vendor Ruby is available" FORCE) -+ set(Ruby_HAS_VENDOR_RUBY $ CACHE BOOL "Vendor Ruby is available" FORCE) - set(Ruby_VENDORARCH_DIR ${Ruby_VENDORARCH_DIR} CACHE PATH "The Ruby vendor arch dir" FORCE) - set(Ruby_VENDORLIB_DIR ${Ruby_VENDORLIB_DIR} CACHE PATH "The Ruby vendor lib dir" FORCE) + set(Ruby_VERSION_MAJOR ${Ruby_VERSION_MAJOR} CACHE PATH "The Ruby major version" FORCE) diff --git a/cmake.spec b/cmake.spec index 28140b5..021f29b 100644 --- a/cmake.spec +++ b/cmake.spec @@ -67,15 +67,15 @@ # Setup _vpath_builddir if not defined already %{!?_vpath_builddir:%global _vpath_builddir %{_target_platform}} -%global major_version 4 -%global minor_version 0 -%global patch_version 0 +%global major_version 3 +%global minor_version 31 +%global patch_version 6 # For handling bump release by rpmdev-bumpspec and mass rebuild -%global baserelease 1 +%global baserelease 2 # Set to RC version if building RC, else comment out. -%global rcsuf rc4 +#%%global rcsuf rc3 %if 0%{?rcsuf:1} %global pkg_version %{major_version}.%{minor_version}.%{patch_version}~%{rcsuf} @@ -117,6 +117,9 @@ Source5: %{name}.req # http://public.kitware.com/Bug/view.php?id=12965 # https://bugzilla.redhat.com/show_bug.cgi?id=822796 Patch100: %{name}-findruby.patch +# Fix build with latest curl +# https://gitlab.kitware.com/cmake/cmake/-/merge_requests/10449 +Patch101: %{name}-curl-fix.patch # Patch for renaming on EPEL %if 0%{?name_suffix:1} @@ -214,11 +217,6 @@ Requires: make # Provide the major version name Provides: %{orig_name}%{major_version} = %{version}-%{release} -# Provide cmake3 for legacy. -%if 0%{?major_version} > 3 -Provides: %{orig_name}3 = %{version}-%{release} -%endif - # Source/kwsys/MD5.c # see https://fedoraproject.org/wiki/Packaging:No_Bundled_Libraries Provides: bundled(md5-deutsch) @@ -513,8 +511,6 @@ NO_TEST="$NO_TEST|Qt5Autogen.ManySources|Qt5Autogen.MocInclude|Qt5Autogen.MocInc # Test failing on Fedora 41, only. NO_TEST="$NO_TEST|RunCMake.Make|RunCMake.BuildDepends|Qt6Autogen.RerunMocBasic|Qt6Autogen.RerunRccDepends" %endif -# Drop for v4.0.0-final -NO_TEST="$NO_TEST|RunCMake.LinkWarningAsError|RunCMake.ParseImplicitLinkInfo" bin/ctest%{?name_suffix} %{?_smp_mflags} -V -E "$NO_TEST" --output-on-failure ## do this only periodically, not for every build -- besser82 20221102 # Keep an eye on failing tests @@ -595,30 +591,10 @@ popd %changelog -* Wed Mar 12 2025 Björn Esser - 4.0.0~rc4-1 -- cmake-4.0.0-rc4 - -* Wed Mar 12 2025 Björn Esser - 4.0.0~rc3-4 -- macros: Set CMAKE_POLICY_VERSION_MINIMUM as environment variable - -* Fri Mar 07 2025 Yaakov Selkowitz - 4.0.0~rc3-3 -- Define CMAKE_POLICY_VERSION_MINIMUM in %%cmake - -* Fri Mar 07 2025 Cristian Le - 4.0.0~rc3-2 -- Drop non-standard *_INSTALL options - -* Thu Mar 06 2025 Björn Esser - 4.0.0~rc3-1 -- cmake-4.0.0-rc3 - -* Thu Feb 27 2025 Björn Esser - 4.0.0~rc2-3 +* Tue Mar 18 2025 Yaakov Selkowitz - 3.31.6-2 +- Revert to 3.31.6 - Rebuild (jsoncpp) -- Provide cmake3 for legacy - -* Thu Feb 27 2025 Björn Esser - 4.0.0~rc2-2 -- Restore compatibility with cmake3 macros - -* Wed Feb 26 2025 Björn Esser - 4.0.0~rc2-1 -- cmake-4.0.0-rc2 +- Fix build with latest curl * Mon Feb 24 2025 Björn Esser - 3.31.6-1 - cmake-3.31.6 diff --git a/macros.cmake.in b/macros.cmake.in index aafc191..a2cbd48 100644 --- a/macros.cmake.in +++ b/macros.cmake.in @@ -1,6 +1,7 @@ # # Macros for cmake # +%_cmake_lib_suffix64 -DLIB_SUFFIX=64 %_cmake_shared_libs -DBUILD_SHARED_LIBS:BOOL=ON %_cmake_skip_rpath -DCMAKE_SKIP_RPATH:BOOL=ON %_cmake_version @@CMAKE_VERSION@@ @@ -16,11 +17,8 @@ # - Turn off stripping by default so RPM can do it separately # - Set default install prefixes and library install directories # - Turn on shared libraries by default -# - Avoid errors in packages with CMAKE_MINIMUM_REQUIRED < 3.5 %cmake \ %{set_build_flags} \ - CMAKE_POLICY_VERSION_MINIMUM="${CMAKE_POLICY_VERSION_MINIMUM:-3.5}" \ - export CMAKE_POLICY_VERSION_MINIMUM \ %__cmake \\\ %{!?__cmake_in_source_build:-S "%{_vpath_srcdir}"} \\\ %{!?__cmake_in_source_build:-B "%{__cmake_builddir}"} \\\ @@ -32,6 +30,13 @@ -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \\\ -DCMAKE_INSTALL_FULL_SBINDIR:PATH=%{_sbindir} \\\ -DCMAKE_INSTALL_SBINDIR:PATH=%(s=%{_sbindir}; echo ${s##*/}) \\\ + -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \\\ + -DLIB_INSTALL_DIR:PATH=%{_libdir} \\\ + -DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \\\ + -DSHARE_INSTALL_PREFIX:PATH=%{_datadir} \\\ +%if "%{?_lib}" == "lib64" \ + %{?_cmake_lib_suffix64} \\\ +%endif \ %{?_cmake_shared_libs} %cmake_build \ @@ -56,9 +61,3 @@ %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 %{**} - -# For compatibility with cmake3 macros -%cmake3 %cmake -%cmake3_build %cmake_build -%cmake3_install %cmake_install -%ctest3(:-:h:j:u:v:A:C:D:E:F:H:I:L:M:N:O:Q:R:S:T:U:V:) %ctest %{**} diff --git a/sources b/sources index 4d2d3a4..df523b5 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (cmake-4.0.0-rc4.tar.gz) = a2325e22f23bd62a048b6e9e9c2b6c069260b510169686ee69e45fe1596b53947bef449b32c14471ecc94840d8275e5fe3de89dd63b2aa9e7bdcbd7972e5a457 +SHA512 (cmake-3.31.6.tar.gz) = 839d06b6ebd0bf78cbe8f7ae3a7c00026e70d759a81ac51aa103f35ad985ac69be9e667aae7b5fe48c5e0c41baec791259279679dbdf2ddd8b63a48382a8a2a0 diff --git a/tests/cmake-testsuite-sanity/runtest.sh b/tests/cmake-testsuite-sanity/runtest.sh index 71b061c..5853dbf 100755 --- a/tests/cmake-testsuite-sanity/runtest.sh +++ b/tests/cmake-testsuite-sanity/runtest.sh @@ -57,9 +57,8 @@ rlJournalStart rlRun "dnf builddep -y $TmpDir/SPECS/*.spec" rlRun "su -c 'rpmbuild -D \"_topdir $TmpDir\" -bp $TmpDir/SPECS/*.spec &>$TmpDir/rpmbuild.log' $BUILD_USER" rlRun "rlFileSubmit $TmpDir/rpmbuild.log" - rlRun "BuildDir=`ls $TmpDir/BUILD | grep -E '^cmake-[0-9]+(\.[0-9]+)+(_rc[0-9]+)?-build$' | tail -n 1`" - rlRun "CMakeDir=`ls $TmpDir/BUILD/$BuildDir | grep -E '^cmake-[0-9]+(\.[0-9]+)+(-rc[0-9]+)?$' | tail -n 1`" - rlRun "cd $TmpDir/BUILD/$BuildDir/$CMakeDir" + rlRun "CMakeDir=`ls $TmpDir/BUILD | grep -E '^cmake-[0-9]+(\.[0-9]+)+(-rc[0-9]+)?$' | tail -n 1`" + rlRun "cd $TmpDir/BUILD/$CMakeDir" rlRun "su -c './bootstrap &>$TmpDir/bootstrap.log' $BUILD_USER" rlRun "rlFileSubmit $TmpDir/bootstrap.log" rlRun "ln -fs /usr/bin/cmake bin/cmake" From 851a4c373df8251daf6162016cbfd5acc92fb4d6 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Tue, 3 Jun 2025 11:00:58 +0200 Subject: [PATCH 15/21] Rebuilt for Python 3.14 --- cmake.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake.spec b/cmake.spec index 021f29b..d2d60e8 100644 --- a/cmake.spec +++ b/cmake.spec @@ -72,7 +72,7 @@ %global patch_version 6 # For handling bump release by rpmdev-bumpspec and mass rebuild -%global baserelease 2 +%global baserelease 3 # Set to RC version if building RC, else comment out. #%%global rcsuf rc3 @@ -591,6 +591,9 @@ popd %changelog +* Tue Jun 03 2025 Python Maint - 3.31.6-3 +- Rebuilt for Python 3.14 + * Tue Mar 18 2025 Yaakov Selkowitz - 3.31.6-2 - Revert to 3.31.6 - Rebuild (jsoncpp) From 864529c3fb76e5ee7a67809f32746091b75aede5 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 23 Jul 2025 18:26:49 +0000 Subject: [PATCH 16/21] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- cmake.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake.spec b/cmake.spec index d2d60e8..5a322d6 100644 --- a/cmake.spec +++ b/cmake.spec @@ -72,7 +72,7 @@ %global patch_version 6 # For handling bump release by rpmdev-bumpspec and mass rebuild -%global baserelease 3 +%global baserelease 4 # Set to RC version if building RC, else comment out. #%%global rcsuf rc3 @@ -591,6 +591,9 @@ popd %changelog +* Wed Jul 23 2025 Fedora Release Engineering - 3.31.6-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Tue Jun 03 2025 Python Maint - 3.31.6-3 - Rebuilt for Python 3.14 From e615fbe99754926fba8c106dd584418a473abab0 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Tue, 2 Dec 2025 16:38:10 -0500 Subject: [PATCH 17/21] Update to 3.31.10 --- cmake-curl-fix.patch | 33 --------------------------------- cmake.spec | 10 +++++----- sources | 2 +- 3 files changed, 6 insertions(+), 39 deletions(-) delete mode 100644 cmake-curl-fix.patch diff --git a/cmake-curl-fix.patch b/cmake-curl-fix.patch deleted file mode 100644 index 118733f..0000000 --- a/cmake-curl-fix.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 1b0c92a3a1b782ff3e1c4499b6ab8db614d45bcd Mon Sep 17 00:00:00 2001 -From: Brad King -Date: Mon, 10 Mar 2025 11:08:42 -0400 -Subject: [PATCH] cmCurl: Avoid using undocumented type for CURLOPT_NETRC - values - -Since upstream curl commit `2ec00372a1` (curl.h: change some enums to -defines with L suffix, 2025-02-25), the `CURL_NETRC_*` constants are -integer literals instead of `enum CURL_NETRC_OPTION`. It turns out -that `curl_easy_setopt` has always expected a `long` anyway, and -that `CURL_NETRC_OPTION` is not documented for public use. - -Fixes: #26754 ---- - Source/cmCurl.cxx | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Source/cmCurl.cxx b/Source/cmCurl.cxx -index b9133ed7d47..0cf8a71a72d 100644 ---- a/Source/cmCurl.cxx -+++ b/Source/cmCurl.cxx -@@ -170,7 +170,7 @@ std::string cmCurlSetNETRCOption(::CURL* curl, const std::string& netrc_level, - const std::string& netrc_file) - { - std::string e; -- CURL_NETRC_OPTION curl_netrc_level = CURL_NETRC_LAST; -+ long curl_netrc_level = CURL_NETRC_LAST; - ::CURLcode res; - - if (!netrc_level.empty()) { --- -GitLab - diff --git a/cmake.spec b/cmake.spec index 5a322d6..60ad2b9 100644 --- a/cmake.spec +++ b/cmake.spec @@ -69,10 +69,10 @@ %global major_version 3 %global minor_version 31 -%global patch_version 6 +%global patch_version 10 # For handling bump release by rpmdev-bumpspec and mass rebuild -%global baserelease 4 +%global baserelease 1 # Set to RC version if building RC, else comment out. #%%global rcsuf rc3 @@ -117,9 +117,6 @@ Source5: %{name}.req # http://public.kitware.com/Bug/view.php?id=12965 # https://bugzilla.redhat.com/show_bug.cgi?id=822796 Patch100: %{name}-findruby.patch -# Fix build with latest curl -# https://gitlab.kitware.com/cmake/cmake/-/merge_requests/10449 -Patch101: %{name}-curl-fix.patch # Patch for renaming on EPEL %if 0%{?name_suffix:1} @@ -591,6 +588,9 @@ popd %changelog +* Tue Dec 02 2025 Yaakov Selkowitz - 3.31.10-1 +- Update to 3.31.10 + * Wed Jul 23 2025 Fedora Release Engineering - 3.31.6-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild diff --git a/sources b/sources index df523b5..5f1214c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (cmake-3.31.6.tar.gz) = 839d06b6ebd0bf78cbe8f7ae3a7c00026e70d759a81ac51aa103f35ad985ac69be9e667aae7b5fe48c5e0c41baec791259279679dbdf2ddd8b63a48382a8a2a0 +SHA512 (cmake-3.31.10.tar.gz) = ae1eed42c143b5afd70124853367dab130b3a668fd161a8fd794a44d2eb42f0a64367d152eb43edbf167ffa95612ffe10f8f18c6db9410ff473b97d4f04a978e From 063d6e7fc93eab7cac9331b863345cee49e67141 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 11 Dec 2025 12:19:12 -0800 Subject: [PATCH 18/21] cmake-testsuite-sanity: fix for RPM 4.19.90 build dir change See https://github.com/rpm-software-management/rpm/issues/3147 for the background. RPM 4.19.90 changed RPM's build directory behavior; the tl;dr is that everything's one level deeper now. This code was expecting something like: /tmp/tmp.dheZFHDA0M/BUILD/cmake-3.31.10 but now we actually get something like: /tmp/tmp.dheZFHDA0M/BUILD/cmake-3.31.10-build/cmake-3.31.10 this uses the trick from https://github.com/rpm-software-management/rpm/issues/3147#issuecomment-2154192419 to figure out the base build directory and then go from there, which *should* make this work on both older and newer RPM. Without this fix, the tests are failing like this: :: [ 21:03:33 ] :: [ BEGIN ] :: Running 'CMakeDir=' :: [ 21:03:33 ] :: [ PASS ] :: Command 'CMakeDir=' (Expected 0, got 0) :: [ 21:03:33 ] :: [ BEGIN ] :: Running 'cd /tmp/tmp.dheZFHDA0M/BUILD/' :: [ 21:03:33 ] :: [ PASS ] :: Command 'cd /tmp/tmp.dheZFHDA0M/BUILD/' (Expected 0, got 0) :: [ 21:03:33 ] :: [ BEGIN ] :: Running 'su -c './bootstrap &>/tmp/tmp.dheZFHDA0M/bootstrap.log' cmkbld' :: [ 21:03:33 ] :: [ FAIL ] :: Command 'su -c './bootstrap &>/tmp/tmp.dheZFHDA0M/bootstrap.log' cmkbld' (Expected 0, got 127) you can see it doesn't get the directory right - it's trying to run `./bootstrap` in `/tmp/tmp.dheZFHDA0M/BUILD/`, because the attempt to discover `CMakeDir` failed and returned an empty string. That's never going to work. See: https://artifacts.dev.testing-farm.io/974c2a93-5d4c-4896-a48a-b2a54d2dd01d/ Signed-off-by: Adam Williamson --- tests/cmake-testsuite-sanity/runtest.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/cmake-testsuite-sanity/runtest.sh b/tests/cmake-testsuite-sanity/runtest.sh index 5853dbf..5753827 100755 --- a/tests/cmake-testsuite-sanity/runtest.sh +++ b/tests/cmake-testsuite-sanity/runtest.sh @@ -57,8 +57,9 @@ rlJournalStart rlRun "dnf builddep -y $TmpDir/SPECS/*.spec" rlRun "su -c 'rpmbuild -D \"_topdir $TmpDir\" -bp $TmpDir/SPECS/*.spec &>$TmpDir/rpmbuild.log' $BUILD_USER" rlRun "rlFileSubmit $TmpDir/rpmbuild.log" - rlRun "CMakeDir=`ls $TmpDir/BUILD | grep -E '^cmake-[0-9]+(\.[0-9]+)+(-rc[0-9]+)?$' | tail -n 1`" - rlRun "cd $TmpDir/BUILD/$CMakeDir" + rlRun "BuildDir=`rpmbuild -D \"_topdir $TmpDir\" -bc --short-circuit --define '__spec_build_pre echo %{_builddir}; exit 0' $TmpDir/SPECS/*.spec | tail -1`" + rlRun "CMakeDir=`ls $BuildDir | grep -E '^cmake-[0-9]+(\.[0-9]+)+(-rc[0-9]+)?$' | tail -n 1`" + rlRun "cd $BuildDir/$CMakeDir" rlRun "su -c './bootstrap &>$TmpDir/bootstrap.log' $BUILD_USER" rlRun "rlFileSubmit $TmpDir/bootstrap.log" rlRun "ln -fs /usr/bin/cmake bin/cmake" From 3445533b7573d49f24560001c4e5cc6e5a75d559 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Tue, 18 Nov 2025 02:43:28 -0500 Subject: [PATCH 19/21] macros: Add section comment explaining cmakeX macros --- macros.cmake.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/macros.cmake.in b/macros.cmake.in index a2cbd48..9a3db0c 100644 --- a/macros.cmake.in +++ b/macros.cmake.in @@ -56,6 +56,8 @@ %{lua:print((string.gsub(rpm.expand('%{**}'),"%-%-%s","")))} +# Legacy cmakeX macros for multiversioned CMake + %cmake@@CMAKE_MAJOR_VERSION@@ %cmake %cmake@@CMAKE_MAJOR_VERSION@@_build %cmake_build %cmake@@CMAKE_MAJOR_VERSION@@_install %cmake_install From fef4fab786da32b44525636032fc7bf770791e9f Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Thu, 11 Dec 2025 17:08:07 -0500 Subject: [PATCH 20/21] macros: Enable support for RPM 4.20+ declarative buildsystem feature The new cmake-srpm-macros package definition is required for supporting Koji and COPR's two-stage build process where the SRPM isn't made in the full build environment. --- cmake.spec | 43 +++++++++++++++++++++++++++++-------------- macros.aaa-cmake-srpm | 12 ++++++++++++ macros.cmake.in | 11 +++++++++++ 3 files changed, 52 insertions(+), 14 deletions(-) create mode 100644 macros.aaa-cmake-srpm diff --git a/cmake.spec b/cmake.spec index 60ad2b9..05724ca 100644 --- a/cmake.spec +++ b/cmake.spec @@ -58,9 +58,6 @@ %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') -# Place rpm-macros into proper location -%global rpm_macros_dir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) - # Setup _pkgdocdir if not defined already %{!?_pkgdocdir:%global _pkgdocdir %{_docdir}/%{name}-%{version}} @@ -72,7 +69,7 @@ %global patch_version 10 # For handling bump release by rpmdev-bumpspec and mass rebuild -%global baserelease 1 +%global baserelease 2 # Set to RC version if building RC, else comment out. #%%global rcsuf rc3 @@ -104,10 +101,11 @@ URL: http://www.cmake.org Source0: http://www.cmake.org/files/v%{major_version}.%{minor_version}/%{orig_name}-%{tar_version}.tar.gz Source1: %{name}-init.el Source2: macros.%{name}.in +Source3: macros.aaa-%{name}-srpm # See https://bugzilla.redhat.com/show_bug.cgi?id=1202899 -Source3: %{name}.attr -Source4: %{name}.prov -Source5: %{name}.req +Source4: %{name}.attr +Source5: %{name}.prov +Source6: %{name}.req # Always start regular patches with numbers >= 100. # We need lower numbers for patches in compat package. @@ -288,6 +286,16 @@ BuildArch: noarch This package contains common RPM macros for %{name}. +%package srpm-macros +Summary: Common SRPM macros for %{name} +Requires: rpm + +BuildArch: noarch + +%description srpm-macros +This package contains common SRPM macros for %{name}. + + %package -n python3-cmake Summary: Python metadata for packages depending on %{name} Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} @@ -310,8 +318,8 @@ echo '#!%{__python3}' > %{name}.req echo '#!%{__python2}' > %{name}.prov echo '#!%{__python2}' > %{name}.req %endif -tail -n +2 %{SOURCE4} >> %{name}.prov -tail -n +2 %{SOURCE5} >> %{name}.req +tail -n +2 %{SOURCE5} >> %{name}.prov +tail -n +2 %{SOURCE6} >> %{name}.req %endif @@ -387,12 +395,13 @@ install -p -m 0644 %{SOURCE1} %{buildroot}%{_emacs_sitestartdir} rm -f %{buildroot}%{_emacs_sitelispdir} %endif # RPM macros -install -p -m0644 -D %{SOURCE2} %{buildroot}%{rpm_macros_dir}/macros.%{name} -sed -i -e "s|@@CMAKE_VERSION@@|%{version}|" -e "s|@@CMAKE_MAJOR_VERSION@@|%{major_version}|" %{buildroot}%{rpm_macros_dir}/macros.%{name} -touch -r %{SOURCE2} %{buildroot}%{rpm_macros_dir}/macros.%{name} +install -p -m0644 -D %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} +install -p -m0644 -D %{SOURCE3} %{buildroot}%{_rpmmacrodir}/macros.aaa-%{name}-srpm +sed -i -e "s|@@CMAKE_VERSION@@|%{version}|" -e "s|@@CMAKE_MAJOR_VERSION@@|%{major_version}|" %{buildroot}%{_rpmmacrodir}/macros.%{name} +touch -r %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name} %if %{with rpm} && 0%{?_rpmconfigdir:1} # RPM auto provides -install -p -m0644 -D %{SOURCE3} %{buildroot}%{_prefix}/lib/rpm/fileattrs/%{name}.attr +install -p -m0644 -D %{SOURCE4} %{buildroot}%{_prefix}/lib/rpm/fileattrs/%{name}.attr install -p -m0755 -D %{name}.prov %{buildroot}%{_prefix}/lib/rpm/%{name}.prov install -p -m0755 -D %{name}.req %{buildroot}%{_prefix}/lib/rpm/%{name}.req %endif @@ -575,19 +584,25 @@ popd %files rpm-macros -%{rpm_macros_dir}/macros.%{name} +%{_rpmmacrodir}/macros.%{name} %if %{with rpm} && 0%{?_rpmconfigdir:1} %{_rpmconfigdir}/fileattrs/%{name}.attr %{_rpmconfigdir}/%{name}.prov %{_rpmconfigdir}/%{name}.req %endif +%files srpm-macros +%{_rpmmacrodir}/macros.aaa-%{name}-srpm + %files -n python3-cmake %{python3_sitelib}/%{cmake_distinfo} %changelog +* Thu Dec 11 2025 Neal Gompa - 3.31.10-2 +- macros: Enable support for RPM 4.20+ declarative buildsystem feature + * Tue Dec 02 2025 Yaakov Selkowitz - 3.31.10-1 - Update to 3.31.10 diff --git a/macros.aaa-cmake-srpm b/macros.aaa-cmake-srpm new file mode 100644 index 0000000..e62f0fb --- /dev/null +++ b/macros.aaa-cmake-srpm @@ -0,0 +1,12 @@ +# Declarative buildsystem macros (usable with rpm >= 4.20) +# https://rpm-software-management.github.io/rpm/manual/buildsystem.html + +# When this file is installed but macros.cmake is not, +# this macro will just cause the real macros to get installed. +%cmake_generate_buildrequires(-) echo "cmake-rpm-macros" + +%buildsystem_cmake_generate_buildrequires() %cmake_generate_buildrequires %{*} +%buildsystem_cmake_conf() %{nil} +%buildsystem_cmake_build() %{nil} +%buildsystem_cmake_install() %{nil} +%buildsystem_cmake_check() %{nil} diff --git a/macros.cmake.in b/macros.cmake.in index 9a3db0c..6c260fd 100644 --- a/macros.cmake.in +++ b/macros.cmake.in @@ -56,6 +56,17 @@ %{lua:print((string.gsub(rpm.expand('%{**}'),"%-%-%s","")))} +# Declarative buildsystem macros (usable with rpm >= 4.20) +# https://rpm-software-management.github.io/rpm/manual/buildsystem.html +%cmake_generate_buildrequires(-) echo "cmake" + +%buildsystem_cmake_generate_buildrequires() %cmake_generate_buildrequires %{*} +%buildsystem_cmake_conf() %cmake %{*} +%buildsystem_cmake_build() %cmake_build %{*} +%buildsystem_cmake_install() %cmake_install %{*} +%buildsystem_cmake_check() %{?with_ctest:%ctest %{*}} %{!?with_ctest:%{nil}} + + # Legacy cmakeX macros for multiversioned CMake %cmake@@CMAKE_MAJOR_VERSION@@ %cmake From aaa289ec8e04448b1b35e24f7b5d9edf0fad135a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 12 Dec 2025 14:28:38 +0100 Subject: [PATCH 21/21] Declarative %generate_buildrequires: Keep the BRs stable Make the rpm-macros implementation add new BuildRequires, but not removing some. This makes the individual rounds of %generate_buildrequires behave more predictably. Nothing says the previous approach is wrong, but is might blow up unexpectedly. --- cmake.spec | 5 ++++- macros.cmake.in | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cmake.spec b/cmake.spec index 05724ca..0bd47ae 100644 --- a/cmake.spec +++ b/cmake.spec @@ -69,7 +69,7 @@ %global patch_version 10 # For handling bump release by rpmdev-bumpspec and mass rebuild -%global baserelease 2 +%global baserelease 3 # Set to RC version if building RC, else comment out. #%%global rcsuf rc3 @@ -600,6 +600,9 @@ popd %changelog +* Fri Dec 12 2025 Miro Hrončok - 3.31.10-3 +- Declarative %%generate_buildrequires: Keep the BRs stable + * Thu Dec 11 2025 Neal Gompa - 3.31.10-2 - macros: Enable support for RPM 4.20+ declarative buildsystem feature diff --git a/macros.cmake.in b/macros.cmake.in index 6c260fd..3eb0ef5 100644 --- a/macros.cmake.in +++ b/macros.cmake.in @@ -58,7 +58,7 @@ # Declarative buildsystem macros (usable with rpm >= 4.20) # https://rpm-software-management.github.io/rpm/manual/buildsystem.html -%cmake_generate_buildrequires(-) echo "cmake" +%cmake_generate_buildrequires(-) echo "cmake-rpm-macros"; echo "cmake" %buildsystem_cmake_generate_buildrequires() %cmake_generate_buildrequires %{*} %buildsystem_cmake_conf() %cmake %{*}