aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Bergin <peter.bergin@windriver.com>2023-05-23 14:07:40 +0200
committerKhem Raj <raj.khem@gmail.com>2023-05-23 15:04:38 -0700
commit48297a8f75b9d7b507ab90058dd5de286722bce6 (patch)
tree6e7f36ac3d6da0c7642c499faa59e6e8c67fbbf9
parentea516e9563e5c827466fd8ca674e5ab1cc8cd5f9 (diff)
downloadmeta-openembedded-48297a8f75b9d7b507ab90058dd5de286722bce6.tar.gz
redis-plus-plus: introduce fix for library detection
When building static library a substitution for library name was bad. Reported in https://github.com/sewenew/redis-plus-plus/issues/486 and detected when building new version of hiredis that also builds a static library. Signed-off-by: Peter Bergin <peter.bergin@windriver.com> Signed-off-by: Peter Bergin <peter@berginkonsult.se> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/recipes-extended/redis-plus-plus/files/0001-CMakeLists.txt-fix-substitution-for-static-libs.patch45
-rw-r--r--meta-oe/recipes-extended/redis-plus-plus/redis-plus-plus_1.3.7.bb3
2 files changed, 47 insertions, 1 deletions
diff --git a/meta-oe/recipes-extended/redis-plus-plus/files/0001-CMakeLists.txt-fix-substitution-for-static-libs.patch b/meta-oe/recipes-extended/redis-plus-plus/files/0001-CMakeLists.txt-fix-substitution-for-static-libs.patch
new file mode 100644
index 0000000000..627b929b4d
--- /dev/null
+++ b/meta-oe/recipes-extended/redis-plus-plus/files/0001-CMakeLists.txt-fix-substitution-for-static-libs.patch
@@ -0,0 +1,45 @@
+From 608d0f1caf43628c8260a994c277a040f1e616e0 Mon Sep 17 00:00:00 2001
+From: Peter Bergin <peter.bergin@windriver.com>
+Date: Tue, 23 May 2023 13:19:55 +0200
+Subject: [PATCH] CMakeLists.txt: fix substitution for static libs
+
+During configuration the liibrary names are substitued for
+the static build. When building with tls support the first
+substitution will match both cases and trash the name for hiredis_ssl.
+
+Input string: 'hiredis::hiredis;hiredis::hiredis_ssl;'
+Output string: 'hiredis::hiredis_static;hiredis::hiredis_static_ssl;'
+Wanted string: 'hiredis::hiredis_static;hiredis::hiredis_ssl_static;'
+
+Fix string replacement by also including the ';' token to better match.
+
+Upstream-Status: Submitted [https://github.com/sewenew/redis-plus-plus/issues/486]
+
+Signed-off-by: Peter Bergin <peter.bergin@windriver.com>
+---
+ CMakeLists.txt | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 69794d9..08c265d 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -160,13 +160,12 @@ if(REDIS_PLUS_PLUS_BUILD_STATIC)
+ set(REDIS_PLUS_PLUS_HIREDIS_LIBS_STATIC ${REDIS_PLUS_PLUS_HIREDIS_LIBS})
+
+ if (TARGET hiredis::hiredis_static)
+- string(REPLACE "hiredis::hiredis" "hiredis::hiredis_static" REDIS_PLUS_PLUS_HIREDIS_LIBS_STATIC
++ string(REPLACE "hiredis::hiredis;" "hiredis::hiredis_static;" REDIS_PLUS_PLUS_HIREDIS_LIBS_STATIC
+ "${REDIS_PLUS_PLUS_HIREDIS_LIBS_STATIC}")
+ endif()
+-
+ if (TARGET hiredis::hiredis_ssl_static)
+ # If SSL is not enabled, this line will have no effect
+- string(REPLACE "hiredis::hiredis_ssl" "hiredis::hiredis_ssl_static" REDIS_PLUS_PLUS_HIREDIS_LIBS_STATIC
++ string(REPLACE "hiredis::hiredis_ssl;" "hiredis::hiredis_ssl_static;" REDIS_PLUS_PLUS_HIREDIS_LIBS_STATIC
+ "${REDIS_PLUS_PLUS_HIREDIS_LIBS_STATIC}")
+ endif()
+
+--
+2.34.1
+
diff --git a/meta-oe/recipes-extended/redis-plus-plus/redis-plus-plus_1.3.7.bb b/meta-oe/recipes-extended/redis-plus-plus/redis-plus-plus_1.3.7.bb
index 8483331fa4..3a1eec8b1c 100644
--- a/meta-oe/recipes-extended/redis-plus-plus/redis-plus-plus_1.3.7.bb
+++ b/meta-oe/recipes-extended/redis-plus-plus/redis-plus-plus_1.3.7.bb
@@ -7,7 +7,8 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
DEPENDS += "hiredis"
SRC_URI = "git://github.com/sewenew/redis-plus-plus;branch=master;protocol=https \
- file://0001-include-cstdint.patch"
+ file://0001-include-cstdint.patch \
+ file://0001-CMakeLists.txt-fix-substitution-for-static-libs.patch"
SRCREV = "f3b19a8a1f609d1a1b79002802e5cf8c336dc262"
S = "${WORKDIR}/git"