From d893057d7757e501199371ca65fa230af21ed959 Mon Sep 17 00:00:00 2001
From: Dmitry Puzyrkov <dmitry.puzyrkov@demlabs.net>
Date: Tue, 11 Apr 2023 12:18:20 +0000
Subject: [PATCH] [+] static self-build openssl for python-builds.

---
 CMakeLists.txt | 11 ++++++++---
 cellframe-sdk  |  2 +-
 version.mk     |  2 +-
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index df9cce881..81ae0440d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -242,18 +242,23 @@ if(UNIX AND NOT WIN32)
             )
 
             FetchContent_MakeAvailable(CPython37Static)
+            
+            SET(OPENSSL_ARCHIVE_URL https://pub.cellframe.net/3rdparty/python/openssl-1.1.1o.tar.gz)
+            add_subdirectory(cellframe-sdk/3rdparty/openssl-cmake)
+            add_dependencies(${NODE_TARGET} ssl_lib crypto_lib)
 
             set(CMAKE_PREFIX_PATH ${cpython37static_SOURCE_DIR})
-
+            
             set(Python_ADDITIONAL_VERSIONS 3.7)
+
             find_package(PythonLibs REQUIRED)
 
             add_definitions("-DDAP_BUILD_WITH_PYTHON_ENV")
             if(MACOS OR IOS)
-                set(PYTHON_LIBRARIES  ${PYTHON_LIBRARIES} -lssl -lcrypto -lz -lutil -lexpat )
+                set(PYTHON_LIBRARIES  ${PYTHON_LIBRARIES} ssl_lib crypto_lib -lz -lutil -lexpat )
             else()
                 if(LINUX OR BSD)
-                    set(PYTHON_LIBRARIES  ${PYTHON_LIBRARIES} -lssl -lcrypto -lcrypt -lnsl -lz -lutil -lexpat )
+                    set(PYTHON_LIBRARIES  ${PYTHON_LIBRARIES} ssl_lib crypto_lib -lcrypt -lnsl -lz -lutil -lexpat )
                 endif()
             endif()
 
diff --git a/cellframe-sdk b/cellframe-sdk
index 03dd65110..45a9f5e7a 160000
--- a/cellframe-sdk
+++ b/cellframe-sdk
@@ -1 +1 @@
-Subproject commit 03dd65110edcad74a8263ee1e2d16e065cc1ba77
+Subproject commit 45a9f5e7a1582c513c46e98cf53e9a96f457a5e1
diff --git a/version.mk b/version.mk
index c829ac3d8..a296bce3f 100644
--- a/version.mk
+++ b/version.mk
@@ -1,3 +1,3 @@
 VERSION_MAJOR=5
 VERSION_MINOR=2
-VERSION_PATCH=80
+VERSION_PATCH=81
-- 
GitLab