From b3bf0e8abc8fcae9e27f11a1dcbe872848e0eb32 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Tue, 18 Mar 2025 18:38:42 -0400 Subject: [PATCH] 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"