diff --git a/ports/redis-plus-plus/fix-dependency-libuv.patch b/ports/redis-plus-plus/fix-dependency-libuv.patch new file mode 100644 index 00000000000000..0990debe911653 --- /dev/null +++ b/ports/redis-plus-plus/fix-dependency-libuv.patch @@ -0,0 +1,23 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e85a158..e67681c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -30,8 +30,8 @@ if(REDIS_PLUS_PLUS_BUILD_ASYNC) + message(STATUS "redis-plus-plus build async interface with libuv") + + # libuv dependency +- find_path(REDIS_PLUS_PLUS_ASYNC_LIB_HEADER NAMES uv.h) +- find_library(REDIS_PLUS_PLUS_ASYNC_LIB uv) ++ find_package(unofficial-libuv CONFIG REQUIRED) ++ set(REDIS_PLUS_PLUS_ASYNC_LIB unofficial::libuv::libuv) + else() + message(FATAL_ERROR "invalid REDIS_PLUS_PLUS_BUILD_ASYNC") + endif() +@@ -150,7 +150,6 @@ if(REDIS_PLUS_PLUS_BUILD_STATIC) + + if(REDIS_PLUS_PLUS_BUILD_ASYNC) + target_include_directories(${STATIC_LIB} PUBLIC $) +- target_include_directories(${STATIC_LIB} PUBLIC $) + if(REDIS_PLUS_PLUS_ASYNC_FUTURE STREQUAL "boost") + target_include_directories(${STATIC_LIB} SYSTEM PUBLIC $) + endif() diff --git a/ports/redis-plus-plus/portfile.cmake b/ports/redis-plus-plus/portfile.cmake index 93ee71b583883d..0853be1a977514 100644 --- a/ports/redis-plus-plus/portfile.cmake +++ b/ports/redis-plus-plus/portfile.cmake @@ -7,6 +7,7 @@ vcpkg_from_github( PATCHES fix-ws2-linking-windows.patch fix-conversion.patch + fix-dependency-libuv.patch ) if("cxx17" IN_LIST FEATURES) @@ -15,6 +16,14 @@ else() set(REDIS_PLUS_PLUS_CXX_STANDARD 11) endif() +set(EXTRA_OPT "") +if ("async" IN_LIST FEATURES) + list(APPEND EXTRA_OPT -DREDIS_PLUS_PLUS_BUILD_ASYNC="libuv") +endif() +if ("async-std" IN_LIST FEATURES) + list(APPEND EXTRA_OPT -DREDIS_PLUS_PLUS_ASYNC_FUTURE="std") +endif() + string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" REDIS_PLUS_PLUS_BUILD_STATIC) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" REDIS_PLUS_PLUS_BUILD_SHARED) @@ -26,6 +35,7 @@ vcpkg_cmake_configure( -DREDIS_PLUS_PLUS_BUILD_SHARED=${REDIS_PLUS_PLUS_BUILD_SHARED} -DREDIS_PLUS_PLUS_BUILD_TEST=OFF -DREDIS_PLUS_PLUS_CXX_STANDARD=${REDIS_PLUS_PLUS_CXX_STANDARD} + ${EXTRA_OPT} ) vcpkg_cmake_install() diff --git a/ports/redis-plus-plus/vcpkg.json b/ports/redis-plus-plus/vcpkg.json index 769edb78d2cd15..649fc686ab52c8 100644 --- a/ports/redis-plus-plus/vcpkg.json +++ b/ports/redis-plus-plus/vcpkg.json @@ -1,8 +1,10 @@ { "name": "redis-plus-plus", "version-semver": "1.3.2", + "port-version": 1, "description": "This is a C++ client for Redis. It's based on hiredis, and written in C++ 11", "homepage": "https://github.com/sewenew/redis-plus-plus", + "license": "Apache-2.0", "dependencies": [ "hiredis", { @@ -15,6 +17,24 @@ } ], "features": { + "async": { + "description": "Build with async", + "dependencies": [ + "libuv" + ] + }, + "async-std": { + "description": "Build async with std::future", + "dependencies": [ + { + "name": "redis-plus-plus", + "default-features": false, + "features": [ + "async" + ] + } + ] + }, "cxx17": { "description": "Build redis-plus-plus with cxx 17 standard" } diff --git a/versions/baseline.json b/versions/baseline.json index cfa3bcaa6040df..242dae2902c605 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6202,7 +6202,7 @@ }, "redis-plus-plus": { "baseline": "1.3.2", - "port-version": 0 + "port-version": 1 }, "refl-cpp": { "baseline": "0.12.3", diff --git a/versions/r-/redis-plus-plus.json b/versions/r-/redis-plus-plus.json index de899f3b71847e..cfe71b9ca07166 100644 --- a/versions/r-/redis-plus-plus.json +++ b/versions/r-/redis-plus-plus.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "bfb560234e651a06204f44976997b21466ba6a9d", + "version-semver": "1.3.2", + "port-version": 1 + }, { "git-tree": "a58c88604be6da2e638127442cc413c0504e2f51", "version-semver": "1.3.2",