From 33cd8da12d7cc49428489d36a69033c640ae5a57 Mon Sep 17 00:00:00 2001 From: An Tao Date: Wed, 7 Sep 2022 03:46:47 +0800 Subject: [PATCH] [drogon] Update to 1.8.0 (#26639) * [drogon] Update to 1.8.0 * fix a confilict with hiredis --- ports/drogon/portfile.cmake | 9 ++--- ports/drogon/redis.patch | 66 +++++++++++++++++++++++++++++++ ports/drogon/static-brotli.patch | 17 -------- ports/drogon/use-libmariadb.patch | 31 --------------- ports/drogon/vcpkg.json | 2 +- ports/drogon/vcpkg.patch | 3 +- versions/baseline.json | 2 +- versions/d-/drogon.json | 5 +++ 8 files changed, 79 insertions(+), 56 deletions(-) create mode 100644 ports/drogon/redis.patch delete mode 100644 ports/drogon/static-brotli.patch delete mode 100644 ports/drogon/use-libmariadb.patch diff --git a/ports/drogon/portfile.cmake b/ports/drogon/portfile.cmake index 4f24228c3e..ad7b310a35 100644 --- a/ports/drogon/portfile.cmake +++ b/ports/drogon/portfile.cmake @@ -1,14 +1,13 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO an-tao/drogon - REF v1.7.5 - SHA512 8be77961026d13b55dbfcc2e43972b4fb8f1cd9a6bfb8098d5bdfc8b60ff67c2d3ede4bdb5815614a8233dc184cbf3aa363a9d33eed96b9f748544e20b15f2c7 + REF v1.8.0 + SHA512 a834d937e3719059223d9bf19d777dbc92eaf09c5c9c44b5a742bfefcbcd95a146a6568cef8c058050fb87e330f221434ffe784dfa29a49de12b031f86ab1a33 HEAD_REF master PATCHES vcpkg.patch drogon_config.patch - static-brotli.patch - use-libmariadb.patch + redis.patch ) vcpkg_check_features( @@ -29,7 +28,7 @@ vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" DISABLE_PARALLEL_CONFIGURE OPTIONS - -DBUILD_DROGON_SHARED=${BUILD_DROGON_SHARED} + -DBUILD_SHARED_LIBS=${BUILD_DROGON_SHARED} -DBUILD_EXAMPLES=OFF -DCMAKE_DISABLE_FIND_PACKAGE_Boost=ON ${FEATURE_OPTIONS} diff --git a/ports/drogon/redis.patch b/ports/drogon/redis.patch new file mode 100644 index 0000000000..1c54e1166f --- /dev/null +++ b/ports/drogon/redis.patch @@ -0,0 +1,66 @@ +diff --git a/nosql_lib/redis/src/RedisClientImpl.cc b/nosql_lib/redis/src/RedisClientImpl.cc +index 15fa74b..b2f9ac1 100644 +--- a/nosql_lib/redis/src/RedisClientImpl.cc ++++ b/nosql_lib/redis/src/RedisClientImpl.cc +@@ -12,6 +12,7 @@ + * + */ + ++#include "RedisConnection.h" + #include "RedisClientImpl.h" + #include "RedisTransactionImpl.h" + #include "../../lib/src/TaskTimeoutFlag.h" +diff --git a/nosql_lib/redis/src/RedisClientImpl.h b/nosql_lib/redis/src/RedisClientImpl.h +index d84cfab..e7c8fab 100644 +--- a/nosql_lib/redis/src/RedisClientImpl.h ++++ b/nosql_lib/redis/src/RedisClientImpl.h +@@ -13,7 +13,6 @@ + */ + #pragma once + +-#include "RedisConnection.h" + #include + #include + #include +@@ -26,6 +25,8 @@ namespace drogon + { + namespace nosql + { ++class RedisConnection; ++using RedisConnectionPtr = std::shared_ptr; + class RedisClientImpl final + : public RedisClient, + public trantor::NonCopyable, +diff --git a/nosql_lib/redis/src/RedisClientLockFree.cc b/nosql_lib/redis/src/RedisClientLockFree.cc +index 2f27b64..fe225b2 100644 +--- a/nosql_lib/redis/src/RedisClientLockFree.cc ++++ b/nosql_lib/redis/src/RedisClientLockFree.cc +@@ -12,6 +12,7 @@ + * + */ + ++#include "RedisConnection.h" + #include "RedisClientLockFree.h" + #include "RedisTransactionImpl.h" + #include "../../lib/src/TaskTimeoutFlag.h" +diff --git a/nosql_lib/redis/src/RedisClientLockFree.h b/nosql_lib/redis/src/RedisClientLockFree.h +index 00bc6c1..136f315 100644 +--- a/nosql_lib/redis/src/RedisClientLockFree.h ++++ b/nosql_lib/redis/src/RedisClientLockFree.h +@@ -13,7 +13,6 @@ + */ + #pragma once + +-#include "RedisConnection.h" + #include + #include + #include +@@ -26,6 +25,8 @@ namespace drogon + { + namespace nosql + { ++class RedisConnection; ++using RedisConnectionPtr = std::shared_ptr; + class RedisClientLockFree final + : public RedisClient, + public trantor::NonCopyable, diff --git a/ports/drogon/static-brotli.patch b/ports/drogon/static-brotli.patch deleted file mode 100644 index a44a40cc59..0000000000 --- a/ports/drogon/static-brotli.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/cmake_modules/FindBrotli.cmake b/cmake_modules/FindBrotli.cmake -index da5b6d2..6b631ab 100755 ---- a/cmake_modules/FindBrotli.cmake -+++ b/cmake_modules/FindBrotli.cmake -@@ -23,9 +23,9 @@ include(FindPackageHandleStandardArgs) - - find_path(BROTLI_INCLUDE_DIR "brotli/decode.h") - --find_library(BROTLICOMMON_LIBRARY NAMES brotlicommon) --find_library(BROTLIDEC_LIBRARY NAMES brotlidec) --find_library(BROTLIENC_LIBRARY NAMES brotlienc) -+find_library(BROTLICOMMON_LIBRARY NAMES brotlicommon brotlicommon-static) -+find_library(BROTLIDEC_LIBRARY NAMES brotlidec brotlidec-static) -+find_library(BROTLIENC_LIBRARY NAMES brotlienc brotlienc-static) - - find_package_handle_standard_args(Brotli - REQUIRED_VARS diff --git a/ports/drogon/use-libmariadb.patch b/ports/drogon/use-libmariadb.patch deleted file mode 100644 index 71ca89892f..0000000000 --- a/ports/drogon/use-libmariadb.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 146d2b8..f180498 100755 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -360,12 +360,8 @@ endif (BUILD_POSTGRESQL) - - if (BUILD_MYSQL) - # Find mysql, only mariadb client library is supported -- find_package(MySQL QUIET) - find_package(unofficial-libmariadb QUIET) -- if (MySQL_FOUND) -- target_link_libraries(${PROJECT_NAME} PRIVATE MySQL_lib) -- set(DROGON_FOUND_MYSQL TRUE) -- elseif (unofficial-libmariadb_FOUND) -+ if (unofficial-libmariadb_FOUND) - target_link_libraries(${PROJECT_NAME} PRIVATE unofficial::libmariadb) - set(DROGON_FOUND_MYSQL TRUE) - endif () -diff --git a/cmake/templates/DrogonConfig.cmake.in b/cmake/templates/DrogonConfig.cmake.in -index 199cfb9..a3fbde0 100644 ---- a/cmake/templates/DrogonConfig.cmake.in -+++ b/cmake/templates/DrogonConfig.cmake.in -@@ -25,7 +25,7 @@ if(@SQLite3_FOUND@) - find_dependency(SQLite3) - endif() - if(@MySQL_FOUND@) --find_dependency(MySQL) -+find_dependency(unofficial-libmariadb CONFIG REQUIRED) - endif() - if(@Boost_FOUND@) - find_dependency(Boost) diff --git a/ports/drogon/vcpkg.json b/ports/drogon/vcpkg.json index f6e70f75dc..a5fd7284ea 100644 --- a/ports/drogon/vcpkg.json +++ b/ports/drogon/vcpkg.json @@ -1,6 +1,6 @@ { "name": "drogon", - "version-semver": "1.7.5", + "version-semver": "1.8.0", "description": "A C++14/17 based HTTP web application framework running on Linux/macOS/Unix/Windows", "homepage": "https://github.com/an-tao/drogon", "documentation": "https://drogon.docsforge.com/master/overview/", diff --git a/ports/drogon/vcpkg.patch b/ports/drogon/vcpkg.patch index 489acd9389..326fcaa990 100644 --- a/ports/drogon/vcpkg.patch +++ b/ports/drogon/vcpkg.patch @@ -39,11 +39,12 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt if (BUILD_MYSQL) diff --git a/drogon_ctl/CMakeLists.txt b/drogon_ctl/CMakeLists.txt +index 9f2f1e7..09871f8 100755 --- a/drogon_ctl/CMakeLists.txt +++ b/drogon_ctl/CMakeLists.txt @@ -19,7 +19,7 @@ add_executable(_drogon_ctl target_link_libraries(_drogon_ctl ${PROJECT_NAME}) - if (WIN32 AND BUILD_DROGON_SHARED) + if (WIN32 AND BUILD_SHARED_LIBS) set(DROGON_FILE $) - set(TRANTOR_FILE $) + set(TRANTOR_FILE $) diff --git a/versions/baseline.json b/versions/baseline.json index bf4a49b766..1158e1a15f 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1993,7 +1993,7 @@ "port-version": 0 }, "drogon": { - "baseline": "1.7.5", + "baseline": "1.8.0", "port-version": 0 }, "dstorage": { diff --git a/versions/d-/drogon.json b/versions/d-/drogon.json index 7e0e9d97fe..fd90e6ffca 100644 --- a/versions/d-/drogon.json +++ b/versions/d-/drogon.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "27ee8227ae9871ffc307380b209f9dbe04de8801", + "version-semver": "1.8.0", + "port-version": 0 + }, { "git-tree": "a66c2bb4632ab86589f1cabed26607d510ae2eba", "version-semver": "1.7.5",