git: f89fd0980a5c - main - databases/mysql57-client: be ready for OpenSSL 3.0 in base

From: Eugene Grosbein <eugen_at_FreeBSD.org>
Date: Tue, 13 Jun 2023 05:16:33 UTC
The branch main has been updated by eugen:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f89fd0980a5cbcc54597578015f660643cdccf0f

commit f89fd0980a5cbcc54597578015f660643cdccf0f
Author:     Eugene Grosbein <eugen@FreeBSD.org>
AuthorDate: 2023-06-13 05:12:49 +0000
Commit:     Eugene Grosbein <eugen@FreeBSD.org>
CommitDate: 2023-06-13 05:12:49 +0000

    databases/mysql57-client: be ready for OpenSSL 3.0 in base
    
    Fix build by merging another change in ssl.cmake from MySQL 8.0
    PORTREVISION not bumped intentionally.
    
    PR:             271656
---
 .../mysql57-client/files/patch-cmake_ssl.cmake     | 40 ++++++++++++++++++----
 1 file changed, 34 insertions(+), 6 deletions(-)

diff --git a/databases/mysql57-client/files/patch-cmake_ssl.cmake b/databases/mysql57-client/files/patch-cmake_ssl.cmake
index 0e70d693a90d..014ae927331a 100644
--- a/databases/mysql57-client/files/patch-cmake_ssl.cmake
+++ b/databases/mysql57-client/files/patch-cmake_ssl.cmake
@@ -1,6 +1,6 @@
---- cmake/ssl.cmake.orig	2019-12-06 10:41:47 UTC
-+++ cmake/ssl.cmake
-@@ -150,22 +150,12 @@ MACRO (MYSQL_CHECK_SSL)
+--- cmake/ssl.cmake.orig	2023-03-16 22:25:04.000000000 +0700
++++ cmake/ssl.cmake	2023-06-13 12:11:25.125506000 +0700
+@@ -176,24 +176,32 @@ MACRO (MYSQL_CHECK_SSL)
        MESSAGE(STATUS "OPENSSL_APPLINK_C ${OPENSSL_APPLINK_C}")
      ENDIF()
  
@@ -20,10 +20,38 @@
 -    IF (WITH_SSL_PATH)
 -      LIST(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES)
 -    ENDIF()
- 
+-
      IF(OPENSSL_INCLUDE_DIR)
++     FOREACH(version_part
++        OPENSSL_VERSION_MAJOR
++        OPENSSL_VERSION_MINOR
++        OPENSSL_VERSION_PATCH
++     )
++        FILE(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" ${version_part}
++        REGEX "^#[\t ]*define[\t ]+${version_part}[\t ]+([0-9]+).*")
++        STRING(REGEX REPLACE
++          "^.*${version_part}[\t ]+([0-9]+).*" "\\1"
++          ${version_part} "${${version_part}}")
++     ENDFOREACH()
++
++     IF(OPENSSL_VERSION_MAJOR VERSION_EQUAL 3)
++      # OpenSSL 3
++        SET(OPENSSL_MAJOR_VERSION "${OPENSSL_VERSION_MAJOR}")
++        SET(OPENSSL_MINOR_VERSION "${OPENSSL_VERSION_MINOR}")
++        SET(OPENSSL_FIX_VERSION "${OPENSSL_VERSION_PATCH}")
++        SET(OPENSSL_FOUND TRUE)
++     ELSE()
        # Verify version number. Version information looks like:
-@@ -193,9 +183,10 @@ MACRO (MYSQL_CHECK_SSL)
+       #   #define OPENSSL_VERSION_NUMBER 0x1000103fL
+       # Encoded as MNNFFPPS: major minor fix patch status
+@@ -213,15 +221,17 @@ MACRO (MYSQL_CHECK_SSL)
+         "^.*OPENSSL_VERSION_NUMBER[\t ]+0x[0-9][0-9][0-9]([0-9][0-9]).*$" "\\1"
+         OPENSSL_FIX_VERSION "${OPENSSL_VERSION_NUMBER}"
+         )
++     ENDIF()
+     ENDIF()
+     SET(OPENSSL_VERSION
+       "${OPENSSL_MAJOR_VERSION}.${OPENSSL_MINOR_VERSION}.${OPENSSL_FIX_VERSION}"
        )
      SET(OPENSSL_VERSION ${OPENSSL_VERSION} CACHE INTERNAL "")
  
@@ -37,7 +65,7 @@
         IF(SOLARIS)
           SET(FORCE_SSL_SOLARIS "-Wl,--undefined,address_of_sk_new_null")
         ENDIF()
-@@ -203,7 +204,13 @@ MACRO (MYSQL_CHECK_SSL)
+@@ -229,7 +239,13 @@ MACRO (MYSQL_CHECK_SSL)
      IF(OPENSSL_INCLUDE_DIR AND
         OPENSSL_LIBRARY   AND
         CRYPTO_LIBRARY      AND