diff options
| author | Markus87 <Markus87@users.noreply.github.com> | 2020-10-14 00:50:53 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-13 15:50:53 -0700 |
| commit | 98c5261b40b830ac969f062f1569fe75be3e281c (patch) | |
| tree | fa552fa45e0574ac99a317ed535cf581c9840493 | |
| parent | 26279b79d07fd850f61fc5144965994255aff008 (diff) | |
| download | vcpkg-98c5261b40b830ac969f062f1569fe75be3e281c.tar.gz vcpkg-98c5261b40b830ac969f062f1569fe75be3e281c.zip | |
Fixed port of mongo-c-driver/mongo-cxx-driver for android (#13850)
* Fixed port of mongo-c-driver/mongo-cxx-driver for android
* mongo-c-driver - Default value of ENABLE_SHM_COUNTERS is AUTO
* Use vcpkg provided variable VCPKG_TARGET_IS_ANDROID to detect android
Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
* Increased port-version of mongo-c-driver
* Increased port-version of mongo-cxx-driver
Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
| -rw-r--r-- | ports/mongo-c-driver/CONTROL | 1 | ||||
| -rw-r--r-- | ports/mongo-c-driver/portfile.cmake | 10 | ||||
| -rw-r--r-- | ports/mongo-cxx-driver/CONTROL | 1 | ||||
| -rw-r--r-- | ports/mongo-cxx-driver/fix-android.patch | 13 | ||||
| -rw-r--r-- | ports/mongo-cxx-driver/portfile.cmake | 1 |
5 files changed, 26 insertions, 0 deletions
diff --git a/ports/mongo-c-driver/CONTROL b/ports/mongo-c-driver/CONTROL index 17df29f60..7bbddb172 100644 --- a/ports/mongo-c-driver/CONTROL +++ b/ports/mongo-c-driver/CONTROL @@ -1,5 +1,6 @@ Source: mongo-c-driver Version: 1.16.1-1 +Port-Version: 1 Build-Depends: libbson, openssl (!windows), zlib Description: Client library written in C for MongoDB. Homepage: https://github.com/mongodb/mongo-c-driver diff --git a/ports/mongo-c-driver/portfile.cmake b/ports/mongo-c-driver/portfile.cmake index 3516886b1..74a1d8c0d 100644 --- a/ports/mongo-c-driver/portfile.cmake +++ b/ports/mongo-c-driver/portfile.cmake @@ -28,6 +28,14 @@ else() set(ENABLE_SSL "OPENSSL") endif() +if(VCPKG_TARGET_IS_ANDROID) + set(ENABLE_SRV OFF) + set(ENABLE_SHM_COUNTERS OFF) +else() + set(ENABLE_SRV AUTO) + set(ENABLE_SHM_COUNTERS AUTO) +endif() + file(READ ${CMAKE_CURRENT_LIST_DIR}/CONTROL _contents) string(REGEX MATCH "\nVersion:[ ]*[^ \n]+" _contents "${_contents}") string(REGEX REPLACE ".+Version:[ ]*([\\.0-9]+).*" "\\1" BUILD_VERSION "${_contents}") @@ -41,6 +49,8 @@ vcpkg_configure_cmake( -DENABLE_BSON=SYSTEM -DENABLE_TESTS=OFF -DENABLE_EXAMPLES=OFF + -DENABLE_SRV=${ENABLE_SRV} + -DENABLE_SHM_COUNTERS=${ENABLE_SHM_COUNTERS} -DENABLE_SSL=${ENABLE_SSL} -DENABLE_ZLIB=SYSTEM -DENABLE_STATIC=${ENABLE_STATIC} diff --git a/ports/mongo-cxx-driver/CONTROL b/ports/mongo-cxx-driver/CONTROL index ecd41b43c..0f5676012 100644 --- a/ports/mongo-cxx-driver/CONTROL +++ b/ports/mongo-cxx-driver/CONTROL @@ -1,5 +1,6 @@ Source: mongo-cxx-driver Version: 3.4.0-5 +Port-Version: 1 Build-Depends: libbson, mongo-c-driver, boost-smart-ptr, boost-optional, boost-utility Homepage: https://github.com/mongodb/mongo-cxx-driver Description: MongoDB C++ Driver. diff --git a/ports/mongo-cxx-driver/fix-android.patch b/ports/mongo-cxx-driver/fix-android.patch new file mode 100644 index 000000000..01527392f --- /dev/null +++ b/ports/mongo-cxx-driver/fix-android.patch @@ -0,0 +1,13 @@ +diff --git "a/src/mongocxx/options/change_stream.cpp" "b/src/mongocxx/options/change_stream.cpp" +index 2c651a7e0..2e9c34eb6 100644 +--- "a/src/mongocxx/options/change_stream.cpp" ++++ "b/src/mongocxx/options/change_stream.cpp" +@@ -108,7 +108,7 @@ bsoncxx::document::value change_stream::as_bson() const { + if ((count < 0) || (count >= std::numeric_limits<std::uint32_t>::max())) { + throw mongocxx::logic_error{mongocxx::error_code::k_invalid_parameter}; + } +- out.append(bsoncxx::builder::basic::kvp("maxAwaitTimeMS", count)); ++ out.append(bsoncxx::builder::basic::kvp("maxAwaitTimeMS", static_cast<int64_t>(count))); + } + + return out.extract(); diff --git a/ports/mongo-cxx-driver/portfile.cmake b/ports/mongo-cxx-driver/portfile.cmake index 695843e28..dc409fcfd 100644 --- a/ports/mongo-cxx-driver/portfile.cmake +++ b/ports/mongo-cxx-driver/portfile.cmake @@ -16,6 +16,7 @@ vcpkg_from_github( fix-dependency-libbson.patch
fix-dependency-mongocdriver.patch
github-654.patch
+ fix-android.patch
)
if ("mnmlstc" IN_LIST FEATURES)
|
