From a7241631703b2e7a66f32d1bdc5e17e6e75d1566 Mon Sep 17 00:00:00 2001 From: wk333 <13474090681@163.com> Date: Sun, 28 Apr 2024 15:42:50 +0800 Subject: [PATCH] Fix messy code for openssl-1.1.1wa version (cherry picked from commit 09dedd8c9820bb369b2d722505659f379c6d2c70) --- cmake.spec | 6 +++- ...ssy-code-for-openssl-1.1.1wa-version.patch | 32 +++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 fix-messy-code-for-openssl-1.1.1wa-version.patch diff --git a/cmake.spec b/cmake.spec index 536d5c6..4d489fc 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 0000000..95a53b9 --- /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 + -- Gitee