diff options
| author | ivysnow <ivy@sgri.net> | 2019-04-12 23:56:36 +0800 |
|---|---|---|
| committer | Griffin Downs <35574547+grdowns@users.noreply.github.com> | 2019-04-12 08:56:36 -0700 |
| commit | e1ae8f62b9ee5de63ae148e08df85fb90965af1d (patch) | |
| tree | a2bd01a7a44425993e87c67201e004143a97d1b6 /ports/mongo-c-driver | |
| parent | d00223cbb9f984d5e633c756d898c19e21bbc6cc (diff) | |
| download | vcpkg-e1ae8f62b9ee5de63ae148e08df85fb90965af1d.tar.gz vcpkg-e1ae8f62b9ee5de63ae148e08df85fb90965af1d.zip | |
[libbson][mongo-c-driver] Update to version 1.13.0. (#4770)
* [libbson][mongo-c-driver] Update to version 1.13.0.
* [mongo-c-driver] don't publish libbson files
Diffstat (limited to 'ports/mongo-c-driver')
| -rw-r--r-- | ports/mongo-c-driver/CONTROL | 2 | ||||
| -rw-r--r-- | ports/mongo-c-driver/fix-uwp.patch | 171 | ||||
| -rw-r--r-- | ports/mongo-c-driver/portfile.cmake | 14 | ||||
| -rw-r--r-- | ports/mongo-c-driver/static.patch | 6 |
4 files changed, 121 insertions, 72 deletions
diff --git a/ports/mongo-c-driver/CONTROL b/ports/mongo-c-driver/CONTROL index de0b8b9f7..4f45aa9b6 100644 --- a/ports/mongo-c-driver/CONTROL +++ b/ports/mongo-c-driver/CONTROL @@ -1,4 +1,4 @@ Source: mongo-c-driver -Version: 1.9.5-3 +Version: 1.13.0 Build-Depends: libbson, openssl (uwp) Description: Client library written in C for MongoDB. diff --git a/ports/mongo-c-driver/fix-uwp.patch b/ports/mongo-c-driver/fix-uwp.patch index b2ec77ab8..973c17b5c 100644 --- a/ports/mongo-c-driver/fix-uwp.patch +++ b/ports/mongo-c-driver/fix-uwp.patch @@ -1,85 +1,127 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 5beb610..7e74ff7 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -55,6 +55,7 @@ - - include(MaintainerFlags) +--- a/src/libbson/CMakeLists.txt ++++ b/src/libbson/CMakeLists.txt +@@ -217,6 +217,9 @@ set (HEADERS_FORWARDING + ${PROJECT_SOURCE_DIR}/src/bson/forwarding/bson.h + ) -+if ((NOT ENABLE_STATIC STREQUAL ON) AND (NOT ENABLE_STATIC STREQUAL AUTO)) - # The input variable BSON_ROOT_DIR is respected for backwards compatibility, - # but you should use the standard CMAKE_PREFIX_PATH instead. - message (STATUS "Searching for libbson CMake packages") -@@ -67,12 +68,14 @@ - message ("-- libbson found version \"${BSON_VERSION}\"") - message ("-- libbson include path \"${BSON_INCLUDE_DIRS}\"") - message ("-- libbson libraries \"${BSON_LIBRARIES}\"") ++add_definitions(-D_CRT_SECURE_NO_WARNINGS) ++ ++if (NOT ENABLE_STATIC MATCHES "ON|AUTO") + add_library (bson_shared SHARED ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING}) + set (CMAKE_CXX_VISIBILITY_PRESET hidden) + set_target_properties (bson_shared PROPERTIES COMPILE_DEFINITIONS "BSON_COMPILATION;JSONSL_PARSE_NAN") +@@ -258,16 +261,21 @@ if (WIN32) + # must be handled specially since we can't resolve them + set (BSON_SYSTEM_LIBRARIES ${BSON_SYSTEM_LIBRARIES} ws2_32) + endif () +endif () - if (ENABLE_STATIC STREQUAL ON OR ENABLE_STATIC STREQUAL AUTO) - find_package (libbson-static-1.0 - "${MONGOC_MAJOR_VERSION}.${MONGOC_MINOR_VERSION}.${MONGOC_MICRO_VERSION}" - HINTS -- ${BSON_ROOT_DIR}) -+ ${BSON_ROOT_DIR} -+ REQUIRED) + if (ENABLE_STATIC MATCHES "ON|AUTO") + add_library (bson_static STATIC ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING}) ++ set(CMAKE_CXX_VISIBILITY_PRESET hidden) + set_target_properties (bson_static PROPERTIES COMPILE_DEFINITIONS "BSON_COMPILATION;BSON_STATIC;JSONSL_PARSE_NAN") + set_target_properties (bson_static PROPERTIES VERSION 0.0.0) + set_target_properties (bson_static PROPERTIES OUTPUT_NAME "bson-static-${BSON_API_VERSION}") ++ set(THREADS_PREFER_PTHREAD_FLAG 1) ++ find_package (Threads REQUIRED) + target_link_libraries (bson_static Threads::Threads) + if (RT_LIBRARY) + target_link_libraries (bson_static ${RT_LIBRARY}) + endif () ++ find_library(M_LIBRARY m) + if (M_LIBRARY) + target_link_libraries (bson_static ${M_LIBRARY}) + endif () +@@ -282,7 +290,7 @@ function (add_example bin src) + add_executable (${bin} ${BSON_EXAMPLE_SOURCES}) + + # Link against the shared lib like normal apps +- target_link_libraries (${bin} bson_shared) ++ target_link_libraries (${bin} bson_shared bson_static) - if (ENABLE_STATIC STREQUAL ON AND NOT BSON_STATIC_LIBRARY) - message (FATAL_ERROR "Static libbson not found. Pass -DENABLE_STATIC=OFF") -@@ -627,6 +630,7 @@ - set (LIBS ${LIBS} ws2_32) - endif() + set (EXAMPLES ${EXAMPLES} ${bin}) + endfunction () +@@ -304,6 +312,7 @@ set (BSON_HEADER_INSTALL_DIR + "${CMAKE_INSTALL_INCLUDEDIR}/libbson-${BSON_API_VERSION}" + ) + ++if (NOT ENABLE_STATIC MATCHES "ON|AUTO") + install ( + TARGETS bson_shared ${EXAMPLES} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +@@ -311,6 +320,7 @@ install ( + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + FRAMEWORK DESTINATION ${CMAKE_INSTALL_BINDIR} + ) ++endif () + if (ENABLE_STATIC MATCHES "ON|AUTO") + install ( + TARGETS bson_static ${EXAMPLES} +--- a/src/libmongoc/CMakeLists.txt ++++ b/src/libmongoc/CMakeLists.txt +@@ -609,6 +609,7 @@ if (WIN32) + set (LIBRARIES ${LIBRARIES} ws2_32) + endif () +if (NOT MONGOC_ENABLE_STATIC) - add_library(mongoc_shared SHARED ${SOURCES} ${HEADERS}) - set_target_properties(mongoc_shared PROPERTIES CMAKE_CXX_VISIBILITY_PRESET hidden) - target_link_libraries (mongoc_shared ${LIBS} ${BSON_LIBRARIES}) -@@ -638,6 +642,7 @@ - # This hack sets up standard symlink, libmongoc-1.0.so -> libmongoc-1.0.0.so - set_target_properties(mongoc_shared PROPERTIES VERSION 0 SOVERSION ${MONGOC_MAJOR_VERSION}) - set_target_properties(mongoc_shared PROPERTIES OUTPUT_NAME "mongoc-${MONGOC_API_VERSION}" PREFIX "lib") + add_library (mongoc_shared SHARED ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING}) + set_target_properties (mongoc_shared PROPERTIES CMAKE_CXX_VISIBILITY_PRESET hidden) + target_link_libraries (mongoc_shared ${LIBRARIES} ${BSON_LIBRARIES}) +@@ -617,6 +618,7 @@ target_compile_definitions (mongoc_shared PUBLIC MONGOC_COMPILATION ${BSON_DEFIN + + set_target_properties (mongoc_shared PROPERTIES VERSION 0.0.0 SOVERSION 0) + set_target_properties (mongoc_shared PROPERTIES OUTPUT_NAME "mongoc-${MONGOC_API_VERSION}" PREFIX "lib") +endif () if (MONGOC_ENABLE_STATIC) - add_library(mongoc_static STATIC ${SOURCES} ${HEADERS}) -@@ -804,6 +809,7 @@ - file(COPY ${SOURCE_DIR}/tests/x509gen DESTINATION ${PROJECT_BINARY_DIR}/tests) - file(COPY ${SOURCE_DIR}/tests/release_files DESTINATION ${PROJECT_BINARY_DIR}/tests) + add_library (mongoc_static STATIC ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING}) +@@ -639,7 +641,11 @@ if (ENABLE_APPLE_FRAMEWORK) + endif () + + add_executable (mongoc-stat ${PROJECT_SOURCE_DIR}/../../src/tools/mongoc-stat.c) ++if (MONGOC_ENABLE_STATIC) ++target_link_libraries (mongoc-stat mongoc_static) ++else () + target_link_libraries (mongoc-stat mongoc_shared) ++endif () + + # mongoc-stat works if shared memory performance counters are enabled. + if (ENABLE_SHM_COUNTERS STREQUAL "ON") +@@ -870,6 +876,7 @@ file (COPY ${PROJECT_SOURCE_DIR}/tests/json DESTINATION ${PROJECT_BINARY_DIR}/te + file (COPY ${PROJECT_SOURCE_DIR}/tests/x509gen DESTINATION ${PROJECT_BINARY_DIR}/tests) + file (COPY ${PROJECT_SOURCE_DIR}/tests/release_files DESTINATION ${PROJECT_BINARY_DIR}/tests) +if (NOT MONGOC_ENABLE_STATIC) - install( - TARGETS mongoc_shared ${EXAMPLES} - LIBRARY DESTINATION lib -@@ -810,10 +816,11 @@ - ARCHIVE DESTINATION lib - RUNTIME DESTINATION bin + install ( + TARGETS mongoc_shared ${EXAMPLES} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +@@ -877,10 +884,11 @@ install ( + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + FRAMEWORK DESTINATION ${CMAKE_INSTALL_BINDIR} ) +endif () if (MONGOC_ENABLE_STATIC) - install( -- TARGETS mongoc_shared mongoc_static ${EXAMPLES} -+ TARGETS mongoc_static ${EXAMPLES} - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - RUNTIME DESTINATION bin -index 5beb610..7e74ff7 100644 ---- a/src/mongoc/mongoc-gridfs-file.c -+++ b/src/mongoc/mongoc-gridfs-file.c -@@ -753,7 +753,7 @@ _mongoc_gridfs_file_refresh_page (mongoc_gridfs_file_t *file) + install ( +- TARGETS mongoc_shared mongoc_static ${EXAMPLES} ++ TARGETS mongoc_static ${EXAMPLES} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +--- a/src/libmongoc/src/mongoc/mongoc-gridfs-file.c ++++ b/src/libmongoc/src/mongoc/mongoc-gridfs-file.c +@@ -765,7 +765,7 @@ _mongoc_gridfs_file_refresh_page (mongoc_gridfs_file_t *file) bson_t query; bson_t child; bson_t opts; - const bson_t *chunk; -+ const bson_t *chunk = 0; ++ const bson_t *chunk = NULL; const char *key; bson_iter_t iter; int64_t existing_chunks; -diff --git a/src/mongoc/mongoc-handshake.c b/src/mongoc/mongoc-handshake.c -index 4e181bd..b274fc1 100644 ---- a/src/mongoc/mongoc-handshake.c -+++ b/src/mongoc/mongoc-handshake.c -@@ -243,7 +243,8 @@ _get_os_version (void) +--- a/src/libmongoc/src/mongoc/mongoc-handshake.c ++++ b/src/libmongoc/src/mongoc/mongoc-handshake.c +@@ -286,7 +286,8 @@ _get_os_version (void) char *ret = bson_malloc (HANDSHAKE_OS_VERSION_MAX); bool found = false; @@ -89,11 +131,10 @@ index 4e181bd..b274fc1 100644 OSVERSIONINFO osvi; ZeroMemory (&osvi, sizeof (OSVERSIONINFO)); osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); -diff --git a/src/mongoc/mongoc-util.c b/src/mongoc/mongoc-util.c -index a4e50ea..4f631e7 100644 ---- a/src/mongoc/mongoc-util.c -+++ b/src/mongoc/mongoc-util.c -@@ -70,6 +70,11 @@ void +--- a/src/libmongoc/src/mongoc/mongoc-util.c ++++ b/src/libmongoc/src/mongoc/mongoc-util.c +@@ -84,7 +84,11 @@ _mongoc_hex_md5 (const char *input) + void _mongoc_usleep (int64_t usec) { #ifdef _WIN32 diff --git a/ports/mongo-c-driver/portfile.cmake b/ports/mongo-c-driver/portfile.cmake index 1ab39a491..2d4c88460 100644 --- a/ports/mongo-c-driver/portfile.cmake +++ b/ports/mongo-c-driver/portfile.cmake @@ -2,8 +2,8 @@ include(vcpkg_common_functions) vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO mongodb/mongo-c-driver
- REF 1.9.5
- SHA512 bee584c83bb317802eb855fececc98f2013d7c3134f063c3146521ab535c8a89c2dfe89ccfa6ebbe2d7c64edec0e53105ead361da83b885c7778b40e4801de62
+ REF 1.13.0
+ SHA512 d2f5b04b3d2dbdeba4547ec1fe8a0da7bad5214de92fff480ef0ff7d97ea45d5e6347c11c249867d4905b1dd81b76c7cfbb9094a58df586dae881955ee246907
HEAD_REF master
PATCHES fix-uwp.patch
)
@@ -25,6 +25,8 @@ vcpkg_configure_cmake( PREFER_NINJA
OPTIONS
-DBSON_ROOT_DIR=${CURRENT_INSTALLED_DIR}
+ -DENABLE_MONGOC=ON
+ -DENABLE_BSON=ON
-DENABLE_TESTS=OFF
-DENABLE_EXAMPLES=OFF
-DENABLE_SSL=${ENABLE_SSL}
@@ -38,6 +40,7 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL "static") else()
vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/libmongoc-1.0")
endif()
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
# This rename is needed because the official examples expect to use #include <mongoc.h>
# See Microsoft/vcpkg#904
@@ -114,3 +117,10 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver/libmongoc-${PORT_POSTFI file(RENAME ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver/libmongoc-${PORT_POSTFIX}-config-version.cmake ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver/mongo-c-driver-config-version.cmake)
vcpkg_copy_pdbs()
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libbson-1.0.pc ${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libbson-1.0.pc)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libbson-static-1.0.pc ${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libbson-static-1.0.pc)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/bson-1.0.lib ${CURRENT_PACKAGES_DIR}/lib/bson-1.0.lib)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/bson-static-1.0.lib ${CURRENT_PACKAGES_DIR}/lib/bson-static-1.0.lib)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/libbson-1.0.dll ${CURRENT_PACKAGES_DIR}/bin/libbson-1.0.dll)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/libbson-1.0.pdb ${CURRENT_PACKAGES_DIR}/bin/libbson-1.0.pdb)
diff --git a/ports/mongo-c-driver/static.patch b/ports/mongo-c-driver/static.patch index 7f348ba82..0f7fa98bb 100644 --- a/ports/mongo-c-driver/static.patch +++ b/ports/mongo-c-driver/static.patch @@ -1,7 +1,5 @@ -diff --git a/mongoc-macros.h b/mongoc-macros.h -index 909bf6c..0a1f612 100644 ---- a/mongoc-macros.h -+++ b/mongoc-macros.h +--- a/mongoc/mongoc-macros.h ++++ b/mongoc/mongoc-macros.h @@ -40,7 +40,7 @@ #elif defined(MONGOC_COMPILATION) #define MONGOC_API __declspec(dllexport) |
