From ac547f5af8cfcd0cc75c3bf375859099d9a24de8 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Thu, 9 Feb 2023 11:33:24 -0300 Subject: [PATCH] apfree-wifidog: add support for OpenSSL 3.0 This adds an upstream commit to allow building with OpenSSL 3.0. Signed-off-by: Eneas U de Queiroz --- net/apfree-wifidog/Makefile | 2 +- .../patches/010-support-openssl-3.0.patch | 53 +++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 net/apfree-wifidog/patches/010-support-openssl-3.0.patch diff --git a/net/apfree-wifidog/Makefile b/net/apfree-wifidog/Makefile index 876f6107f..d15d8493d 100644 --- a/net/apfree-wifidog/Makefile +++ b/net/apfree-wifidog/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=apfree-wifidog PKG_VERSION:=4.08.1771 -PKG_RELEASE:=6 +PKG_RELEASE:=7 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/liudf0716/apfree_wifidog.git diff --git a/net/apfree-wifidog/patches/010-support-openssl-3.0.patch b/net/apfree-wifidog/patches/010-support-openssl-3.0.patch new file mode 100644 index 000000000..4c8147e0a --- /dev/null +++ b/net/apfree-wifidog/patches/010-support-openssl-3.0.patch @@ -0,0 +1,53 @@ +From 53a042836063e965f8df9fc85bb32e8e46da8a05 Mon Sep 17 00:00:00 2001 +From: staylightblow8 +Date: Thu, 20 Oct 2022 10:47:59 +0800 +Subject: [PATCH] support openssl > 3.0 + +--- + cmake/Modules/FindOpenSSL.cmake | 27 +++++++++++++++++++++++---- + 1 file changed, 23 insertions(+), 4 deletions(-) + +--- a/cmake/Modules/FindOpenSSL.cmake ++++ b/cmake/Modules/FindOpenSSL.cmake +@@ -282,11 +282,11 @@ function(from_hex HEX DEC) + set(${DEC} ${_res} PARENT_SCOPE) + endfunction() + +-if (OPENSSL_INCLUDE_DIR) +- if(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h") +- file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str +- REGEX "^# *define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*") ++if(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h") ++ file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str ++ REGEX "^#[\t ]*define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*") + ++ if(openssl_version_str) + # The version number is encoded as 0xMNNFFPPS: major minor fix patch status + # The status gives if this is a developer or prerelease and is ignored here. + # Major, minor, and fix directly translate into the version numbers shown in +@@ -315,6 +315,25 @@ if (OPENSSL_INCLUDE_DIR) + 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}") ++ ++ # Setting OPENSSL_VERSION_MAJOR OPENSSL_VERSION_MINOR and OPENSSL_VERSION_FIX ++ string(REGEX MATCHALL "([0-9])+" OPENSSL_VERSION_NUMBER "${OPENSSL_VERSION}") ++ list(POP_FRONT OPENSSL_VERSION_NUMBER ++ OPENSSL_VERSION_MAJOR ++ OPENSSL_VERSION_MINOR ++ OPENSSL_VERSION_FIX) ++ ++ unset(OPENSSL_VERSION_NUMBER) ++ unset(OPENSSL_VERSION_STR) + endif () + endif () +