SHA256
3
0
forked from pool/cmake

Accepting request 810134 from home:vitezslav_cizek:branches:devel:tools:building

- FindOpenSSL: Detect OpenSSL 3.0.0 (bsc#1172267)
  61d746e592
  * add 0001-FindOpenSSL-Detect-OpenSSL-3.0.0.patch

OBS-URL: https://build.opensuse.org/request/show/810134
OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/cmake?expand=0&rev=412
This commit is contained in:
Martin Pluskal 2020-05-29 08:12:33 +00:00 committed by Git OBS Bridge
parent e79a6a498e
commit 4aea471671
3 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,40 @@
From 61d746e5922de50310558364f157b261f3e7917a Mon Sep 17 00:00:00 2001
From: Vitezslav Cizek <vcizek@suse.com>
Date: Wed, 27 May 2020 14:52:17 +0200
Subject: [PATCH] FindOpenSSL: Detect OpenSSL 3.0.0
The OpenSSL versioning is changing with the upcoming 3.0.0 release.
https://www.openssl.org/blog/blog/2018/11/28/version/
Since 3.0.0, the patch letters are being dropped. The new format is:
MAJOR.MINOR.PATCH
The OPENSSL_VERSION variable can now be directly derived from the new
OPENSSL_VERSION_STR macro.
https://www.openssl.org/docs/manmaster/man3/OPENSSL_VERSION_NUMBER.html
---
Modules/FindOpenSSL.cmake | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index af713d6a84..45b641ddef 100644
--- a/Modules/FindOpenSSL.cmake
+++ b/Modules/FindOpenSSL.cmake
@@ -415,6 +415,15 @@ 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}")
+ else ()
+ # Since OpenSSL 3.0.0, the new version format is MAJOR.MINOR.PATCH and
+ # a new OPENSSL_VERSION_STR macro contains exactly that
+ file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" OPENSSL_VERSION_STR
+ REGEX "^#[\t ]*define[\t ]+OPENSSL_VERSION_STR[\t ]+\"([0-9])+\.([0-9])+\.([0-9])+\".*")
+ string(REGEX REPLACE "^.*OPENSSL_VERSION_STR[\t ]+\"([0-9]+\.[0-9]+\.[0-9]+)\".*$"
+ "\\1" OPENSSL_VERSION_STR "${OPENSSL_VERSION_STR}")
+
+ set(OPENSSL_VERSION "${OPENSSL_VERSION_STR}")
endif ()
endif ()
--
2.26.2

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri May 29 06:42:43 UTC 2020 - Vítězslav Čížek <vcizek@suse.com>
- FindOpenSSL: Detect OpenSSL 3.0.0 (bsc#1172267)
https://gitlab.kitware.com/cmake/cmake/-/commit/61d746e5922de50310558364f157b261f3e7917a
* add 0001-FindOpenSSL-Detect-OpenSSL-3.0.0.patch
-------------------------------------------------------------------
Sat May 2 21:50:30 UTC 2020 - Andreas Stieger <andreas.stieger@gmx.de>

View File

@ -55,6 +55,7 @@ Patch0: cmake-fix-ruby-test.patch
# Search for python interpreters from newest to oldest rather then picking up /usr/bin/python as first choice
Patch1: feature-suse-python-interp-search-order.patch
Patch2: cmake-fix-png-include-dir.patch
Patch3: 0001-FindOpenSSL-Detect-OpenSSL-3.0.0.patch
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: pkgconfig