Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hiredis: uprev to 1.1.0 and add ptest support #695

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions meta-oe/recipes-core/packagegroups/packagegroup-meta-oe.bb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions meta-oe/recipes-extended/hiredis/hiredis/run-ptest
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

TEST_SSL=0 TEST_ASYNC=0 ./test.sh
17 changes: 0 additions & 17 deletions meta-oe/recipes-extended/hiredis/hiredis_1.0.2.bb

This file was deleted.

39 changes: 39 additions & 0 deletions meta-oe/recipes-extended/hiredis/hiredis_1.1.0.bb
Original file line number Diff line number Diff line change
@@ -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)}"
Original file line number Diff line number Diff line change
@@ -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

This file was deleted.

24 changes: 0 additions & 24 deletions meta-oe/recipes-extended/redis-plus-plus/redis-plus-plus_1.3.7.bb

This file was deleted.

26 changes: 26 additions & 0 deletions meta-oe/recipes-extended/redis-plus-plus/redis-plus-plus_1.3.8.bb
Original file line number Diff line number Diff line change
@@ -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
}