diff --git a/cmake.spec b/cmake.spec index 536d5c6fe46ce8666d35af899264613c5bace5b8..4d489fc041dcd61d11bce05dcb4f5962b2e1a329 100644 --- a/cmake.spec +++ b/cmake.spec @@ -11,7 +11,7 @@ Name: cmake Version: 3.22.0 -Release: 8 +Release: 9 Summary: Cross-platform make system License: BSD and MIT and zlib URL: http://www.cmake.org @@ -27,6 +27,7 @@ Patch2: cmake-mingw-dl.patch %ifarch sw_64 Patch3: cmake-3.22.0-sw.patch %endif +Patch4: fix-messy-code-for-openssl-1.1.1wa-version.patch BuildRequires: coreutils findutils gcc-c++ gcc-gfortran sed BuildRequires: emacs python3-devel pkgconfig(Qt5Widgets) desktop-file-utils @@ -237,6 +238,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %exclude %{_pkgdocdir}/Copyright.txt %changelog +* Sun Apr 28 2024 wangkai <13474090681@163.com> - 3.22.0-9 +- Fix messy code for openssl-1.1.1wa version + * Fri Feb 2 2024 liyanan - 3.22.0-8 - Remove Windows_TemporaryKey.pfx diff --git a/fix-messy-code-for-openssl-1.1.1wa-version.patch b/fix-messy-code-for-openssl-1.1.1wa-version.patch new file mode 100644 index 0000000000000000000000000000000000000000..95a53b9935d17aeb5d940bd42e356863c947d2b3 --- /dev/null +++ b/fix-messy-code-for-openssl-1.1.1wa-version.patch @@ -0,0 +1,32 @@ +diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake +index 8474e05c..ac742855 100644 +--- a/Modules/FindOpenSSL.cmake ++++ b/Modules/FindOpenSSL.cmake +@@ -520,7 +520,6 @@ if(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h") + from_hex("${OPENSSL_VERSION_PATCH}" _tmp) + # 96 is the ASCII code of 'a' minus 1 + math(EXPR OPENSSL_VERSION_PATCH_ASCII "${_tmp} + 96") +- unset(_tmp) + # Once anyone knows how OpenSSL would call the patch versions beyond 'z' + # this should be updated to handle that, too. This has not happened yet + # so it is simply ignored here for now. +@@ -528,6 +527,16 @@ if(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h") + endif () + + set(OPENSSL_VERSION "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_FIX}${OPENSSL_VERSION_PATCH_STRING}") ++ ++ if ("${_tmp}" GREATER 26) ++ # openssl version 1.1.1wa get text directly ++ file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_text ++ REGEX "^#[\t ]*define[\t ]+OPENSSL_VERSION_TEXT[\t ]+\"OpenSSL[^\"]*\".*") ++ string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+[a-zA-Z]+" version_number ${openssl_version_text}) ++ set(OPENSSL_VERSION "${version_number}") ++ endif () ++ unset(_tmp) ++ + else () + # Since OpenSSL 3.0.0, the new version format is MAJOR.MINOR.PATCH and + # a new OPENSSL_VERSION_STR macro contains exactly that +-- +2.33.0 +