diff options
Diffstat (limited to 'vcpkg/ports/redis-plus-plus')
| -rw-r--r-- | vcpkg/ports/redis-plus-plus/fix-absolute-path.patch | 13 | ||||
| -rw-r--r-- | vcpkg/ports/redis-plus-plus/fix-conversion.patch | 13 | ||||
| -rw-r--r-- | vcpkg/ports/redis-plus-plus/fix-dependency-libuv.patch | 23 | ||||
| -rw-r--r-- | vcpkg/ports/redis-plus-plus/portfile.cmake | 66 | ||||
| -rw-r--r-- | vcpkg/ports/redis-plus-plus/vcpkg.json | 53 |
5 files changed, 168 insertions, 0 deletions
diff --git a/vcpkg/ports/redis-plus-plus/fix-absolute-path.patch b/vcpkg/ports/redis-plus-plus/fix-absolute-path.patch new file mode 100644 index 0000000..38f0181 --- /dev/null +++ b/vcpkg/ports/redis-plus-plus/fix-absolute-path.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4b99109..e45ca43 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -158,7 +158,7 @@ if(${redisEnableKeepAliveWithInterval_POS} GREATER -1) + endif() + + set(REDIS_PLUS_PLUS_GENERATED_HEADER_DIR ${CMAKE_CURRENT_BINARY_DIR}/${REDIS_PLUS_PLUS_HEADER_DIR}) +-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/hiredis_features.h.in ${CMAKE_CURRENT_BINARY_DIR}/${REDIS_PLUS_PLUS_SOURCE_DIR}/hiredis_features.h) ++configure_file("${CMAKE_CURRENT_SOURCE_DIR}/hiredis_features.h.in" "${CMAKE_CURRENT_BINARY_DIR}/${REDIS_PLUS_PLUS_SOURCE_DIR}/hiredis_features.h") + + # Build static library + option(REDIS_PLUS_PLUS_BUILD_STATIC "Build static library" ON) diff --git a/vcpkg/ports/redis-plus-plus/fix-conversion.patch b/vcpkg/ports/redis-plus-plus/fix-conversion.patch new file mode 100644 index 0000000..088e7fd --- /dev/null +++ b/vcpkg/ports/redis-plus-plus/fix-conversion.patch @@ -0,0 +1,13 @@ +diff --git a/src/sw/redis++/shards.cpp b/src/sw/redis++/shards.cpp
+index fc58eea..ea57266 100644
+--- a/src/sw/redis++/shards.cpp
++++ b/src/sw/redis++/shards.cpp
+@@ -42,7 +42,7 @@ std::pair<Slot, Node> RedirectionError::_parse_error(const std::string &msg) con
+ auto host = msg.substr(space_pos + 1, colon_pos - space_pos - 1);
+ auto port = std::stoi(msg.substr(colon_pos + 1));
+
+- return {slot, {host, port}};
++ return {static_cast<std::size_t>(slot), {host, port}};
+ } catch (const std::exception &) {
+ throw ProtoError("invalid redirection error message: " + msg);
+ }
diff --git a/vcpkg/ports/redis-plus-plus/fix-dependency-libuv.patch b/vcpkg/ports/redis-plus-plus/fix-dependency-libuv.patch new file mode 100644 index 0000000..bc1808a --- /dev/null +++ b/vcpkg/ports/redis-plus-plus/fix-dependency-libuv.patch @@ -0,0 +1,23 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ae2507e..c329f9b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -45,8 +45,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(libuv CONFIG REQUIRED) ++ set(REDIS_PLUS_PLUS_ASYNC_LIB $<IF:$<TARGET_EXISTS:libuv::uv_a>,libuv::uv_a,libuv::uv>) + else() + message(FATAL_ERROR "invalid REDIS_PLUS_PLUS_BUILD_ASYNC") + endif() +@@ -228,7 +228,6 @@ if(REDIS_PLUS_PLUS_BUILD_STATIC) + + if(REDIS_PLUS_PLUS_BUILD_ASYNC) + target_include_directories(${STATIC_LIB} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/${REDIS_PLUS_PLUS_ASYNC_FUTURE_HEADER}>) +- target_include_directories(${STATIC_LIB} PUBLIC $<BUILD_INTERFACE:${REDIS_PLUS_PLUS_ASYNC_LIB_HEADER}>) + if(REDIS_PLUS_PLUS_ASYNC_FUTURE STREQUAL "boost") + target_include_directories(${STATIC_LIB} SYSTEM PUBLIC $<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>) + endif() diff --git a/vcpkg/ports/redis-plus-plus/portfile.cmake b/vcpkg/ports/redis-plus-plus/portfile.cmake new file mode 100644 index 0000000..656806e --- /dev/null +++ b/vcpkg/ports/redis-plus-plus/portfile.cmake @@ -0,0 +1,66 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO sewenew/redis-plus-plus + REF "${VERSION}" + SHA512 3de216fc32894eb2d9f61a559bf69c8e154122209f2ba95aac202d769688d27cd1059424ad8a1173c7073ee34bfbd5ad981bb313d9298cd39ebe245e88d9e9fe + HEAD_REF master + PATCHES + fix-conversion.patch + fix-dependency-libuv.patch + fix-absolute-path.patch +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + "tls" REDIS_PLUS_PLUS_USE_TLS +) + +if("cxx17" IN_LIST FEATURES) + set(REDIS_PLUS_PLUS_CXX_STANDARD 17) +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) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + DISABLE_PARALLEL_CONFIGURE + OPTIONS + ${FEATURE_OPTIONS} + -DREDIS_PLUS_PLUS_BUILD_STATIC=${REDIS_PLUS_PLUS_BUILD_STATIC} + -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() + +vcpkg_copy_pdbs() + +vcpkg_cmake_config_fixup(PACKAGE_NAME redis++ CONFIG_PATH share/cmake/redis++) + +if("async" IN_LIST FEATURES) + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/redis++/redis++-config.cmake" +"include(CMakeFindDependencyMacro)" +[[include(CMakeFindDependencyMacro) +find_dependency(libuv CONFIG)]]) +endif() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") + +# Handle copyright +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") + +vcpkg_fixup_pkgconfig() diff --git a/vcpkg/ports/redis-plus-plus/vcpkg.json b/vcpkg/ports/redis-plus-plus/vcpkg.json new file mode 100644 index 0000000..ddc120e --- /dev/null +++ b/vcpkg/ports/redis-plus-plus/vcpkg.json @@ -0,0 +1,53 @@ +{ + "name": "redis-plus-plus", + "version-semver": "1.3.15", + "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", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "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" + }, + "tls": { + "description": "Build with TLS support", + "dependencies": [ + { + "name": "hiredis", + "default-features": false, + "features": [ + "ssl" + ] + } + ] + } + } +} |