diff --git a/meta-oe/recipes-core/packagegroups/packagegroup-meta-oe.bb b/meta-oe/recipes-core/packagegroups/packagegroup-meta-oe.bb index 21d07a1a263..aef3a05392b 100644 --- a/meta-oe/recipes-core/packagegroups/packagegroup-meta-oe.bb +++ b/meta-oe/recipes-core/packagegroups/packagegroup-meta-oe.bb @@ -982,6 +982,7 @@ RDEPENDS:packagegroup-meta-oe-ptest-packages = "\ poco-ptest \ cmocka-ptest \ minicoredumper-ptest \ + hiredis-ptest \ " RDEPENDS:packagegroup-meta-oe-ptest-packages:append:x86 = " mcelog-ptest" RDEPENDS:packagegroup-meta-oe-ptest-packages:append:x86-64 = " mcelog-ptest" diff --git a/meta-oe/recipes-extended/hiredis/hiredis/run-ptest b/meta-oe/recipes-extended/hiredis/hiredis/run-ptest new file mode 100644 index 00000000000..59b747dbd82 --- /dev/null +++ b/meta-oe/recipes-extended/hiredis/hiredis/run-ptest @@ -0,0 +1,3 @@ +#!/bin/sh + +TEST_SSL=0 TEST_ASYNC=0 ./test.sh diff --git a/meta-oe/recipes-extended/hiredis/hiredis_1.0.2.bb b/meta-oe/recipes-extended/hiredis/hiredis_1.0.2.bb deleted file mode 100644 index 3a8c9481fcc..00000000000 --- a/meta-oe/recipes-extended/hiredis/hiredis_1.0.2.bb +++ /dev/null @@ -1,17 +0,0 @@ -DESCRIPTION = "Minimalistic C client library for Redis" -HOMEPAGE = "http://github.com/redis/hiredis" -SECTION = "libs" -LICENSE = "BSD-3-Clause" -LIC_FILES_CHKSUM = "file://COPYING;md5=d84d659a35c666d23233e54503aaea51" -DEPENDS = "redis openssl" - -SRC_URI = "git://github.com/redis/hiredis;protocol=https;branch=master" -SRCREV = "b731283245f3183af527237166261ad0768ba7d4" - -S = "${WORKDIR}/git" - -inherit cmake - -EXTRA_OECMAKE += "-DENABLE_SSL=ON" - -FILES:${PN}-dev += "${datadir}/hiredis_ssl" diff --git a/meta-oe/recipes-extended/hiredis/hiredis_1.1.0.bb b/meta-oe/recipes-extended/hiredis/hiredis_1.1.0.bb new file mode 100644 index 00000000000..b3814afc716 --- /dev/null +++ b/meta-oe/recipes-extended/hiredis/hiredis_1.1.0.bb @@ -0,0 +1,39 @@ +DESCRIPTION = "Minimalistic C client library for Redis" +HOMEPAGE = "http://github.com/redis/hiredis" +SECTION = "libs" +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://COPYING;md5=d84d659a35c666d23233e54503aaea51" + +SRC_URI = " \ + git://github.com/redis/hiredis;protocol=https;branch=master \ + file://run-ptest \ + " +SRCREV = "c14775b4e48334e0262c9f168887578f4a368b5d" + +S = "${WORKDIR}/git" + +inherit cmake ptest + +# 'testssl' is not enabled by default as redis recipe does not build with ssl support +# option 'testssl' requires 'ssl' +PACKAGECONFIG ??= "ssl ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'test testasync', '', d)}" +PACKAGECONFIG[ssl] = "-DENABLE_SSL=ON, -DENABLE_SSL=OFF, openssl" +PACKAGECONFIG[test] = "-DDISABLE_TESTS=OFF, -DDISABLE_TESTS=ON" +PACKAGECONFIG[testssl] = "-DENABLE_SSL_TESTS=ON, -DENABLE_SSL_TESTS=OFF, openssl" +PACKAGECONFIG[testasync] = "-DENABLE_ASYNC_TESTS=ON, -DENABLE_ASYNC_TESTS=OFF, libevent" + +do_install_ptest() { + install ${S}/test.sh ${D}${PTEST_PATH}/ + install ${B}/hiredis-test ${D}${PTEST_PATH}/ + if ${@bb.utils.contains('PACKAGECONFIG','testssl','true','false',d)}; then + sed -i 's/TEST_SSL=0/TEST_SSL=1/g' ${D}${PTEST_PATH}/run-ptest + fi + if ${@bb.utils.contains('PACKAGECONFIG','testasync','true','false',d)}; then + sed -i 's/TEST_ASYNC=0/TEST_ASYNC=1/g' ${D}${PTEST_PATH}/run-ptest + fi +} + +FILES:${PN}-dev += "${datadir}/hiredis_ssl ${prefix}/build" + +RDEPENDS:${PN} = "redis" +RDEPENDS:${PN}-ptest = "${@bb.utils.contains('PACKAGECONFIG', 'testssl', 'openssl-bin', '', d)}" 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 00000000000..627b929b4db --- /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 +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 +--- + 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/files/0001-include-cstdint.patch b/meta-oe/recipes-extended/redis-plus-plus/files/0001-include-cstdint.patch deleted file mode 100644 index bfe2412b5d8..00000000000 --- a/meta-oe/recipes-extended/redis-plus-plus/files/0001-include-cstdint.patch +++ /dev/null @@ -1,37 +0,0 @@ -From e74bb5a7ef87e697571181280e6108b89104c02d Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 25 Jan 2023 20:40:56 -0800 -Subject: [PATCH] include - -gcc 13 libstdc++ moved some includes around and as a result -is no longer transitively included [1]. Explicitly include it for uintXX_t. - -Fixes - -../git/src/sw/redis++/utils.h:187:1: error: 'uint16_t' does not name a type - 187 | uint16_t crc16(const char *buf, int len); - | ^~~~~~~~ - -[1] https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes - -Upstream-Status: Submitted [https://github.com/sewenew/redis-plus-plus/pull/449] -Signed-off-by: Khem Raj ---- - src/sw/redis++/utils.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/sw/redis++/utils.h b/src/sw/redis++/utils.h -index f77f796..ff38f2d 100644 ---- a/src/sw/redis++/utils.h -+++ b/src/sw/redis++/utils.h -@@ -17,6 +17,7 @@ - #ifndef SEWENEW_REDISPLUSPLUS_UTILS_H - #define SEWENEW_REDISPLUSPLUS_UTILS_H - -+#include - #include - #include - #include --- -2.39.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 deleted file mode 100644 index 8e906a4483f..00000000000 --- a/meta-oe/recipes-extended/redis-plus-plus/redis-plus-plus_1.3.7.bb +++ /dev/null @@ -1,24 +0,0 @@ -DESCRIPTION = "C++ client for Redis based on hiredis" -HOMEPAGE = "https://github.com/sewenew/redis-plus-plus" -SECTION = "libs" -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" - -SRC_URI = "git://github.com/sewenew/redis-plus-plus;branch=master;protocol=https \ - file://0001-include-cstdint.patch" -SRCREV = "f3b19a8a1f609d1a1b79002802e5cf8c336dc262" - -S = "${WORKDIR}/git" - -inherit cmake - -EXTRA_OECMAKE += "-DREDIS_PLUS_PLUS_USE_TLS=ON" - -DEPENDS += "hiredis openssl" - -RDEPENDS:${PN} += "hiredis" - -FILES_SOLIBSDEV = "" -FILES:${PN} += " ${libdir}/libredis++.so*" - -INSANE_SKIP:${PN} += "dev-so" diff --git a/meta-oe/recipes-extended/redis-plus-plus/redis-plus-plus_1.3.8.bb b/meta-oe/recipes-extended/redis-plus-plus/redis-plus-plus_1.3.8.bb new file mode 100644 index 00000000000..bea1f0b18c0 --- /dev/null +++ b/meta-oe/recipes-extended/redis-plus-plus/redis-plus-plus_1.3.8.bb @@ -0,0 +1,26 @@ +DESCRIPTION = "C++ client for Redis based on hiredis" +HOMEPAGE = "https://github.com/sewenew/redis-plus-plus" +SECTION = "libs" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" + +DEPENDS += "hiredis" + +SRC_URI = "git://github.com/sewenew/redis-plus-plus;branch=master;protocol=https \ + file://0001-CMakeLists.txt-fix-substitution-for-static-libs.patch" +SRCREV = "4368319fb668204f345da05b9dd79762506c67b6" + +S = "${WORKDIR}/git" + +inherit cmake + +# if ssl is enabled for redis-plus-plus it must also be enabled for hiredis +PACKAGECONFIG ??= "ssl" +PACKAGECONFIG[ssl] = "-DREDIS_PLUS_PLUS_USE_TLS=ON, -DREDIS_PLUS_PLUS_USE_TLS=OFF, openssl" +PACKAGECONFIG[test] = "-DREDIS_PLUS_PLUS_BUILD_TEST=ON, -DREDIS_PLUS_PLUS_BUILD_TEST=OFF" + +do_install:append() { + # To remove absolute path in .cmake found by QA warning [buildpaths] + sed -i -e 's|${STAGING_LIBDIR}/libcrypto.so|crypto|g' ${D}${datadir}/cmake/redis++/redis++-targets.cmake + sed -i -e 's|${STAGING_LIBDIR}/libssl.so|ssl|g' ${D}${datadir}/cmake/redis++/redis++-targets.cmake +}