aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivysnow <ivy@sgri.net>2019-04-12 23:56:36 +0800
committerGriffin Downs <35574547+grdowns@users.noreply.github.com>2019-04-12 08:56:36 -0700
commite1ae8f62b9ee5de63ae148e08df85fb90965af1d (patch)
treea2bd01a7a44425993e87c67201e004143a97d1b6
parentd00223cbb9f984d5e633c756d898c19e21bbc6cc (diff)
downloadvcpkg-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
-rw-r--r--ports/libbson/CONTROL2
-rw-r--r--ports/libbson/fix-uwp.patch196
-rw-r--r--ports/libbson/portfile.cmake11
-rw-r--r--ports/libbson/static.patch6
-rw-r--r--ports/mongo-c-driver/CONTROL2
-rw-r--r--ports/mongo-c-driver/fix-uwp.patch171
-rw-r--r--ports/mongo-c-driver/portfile.cmake14
-rw-r--r--ports/mongo-c-driver/static.patch6
8 files changed, 257 insertions, 151 deletions
diff --git a/ports/libbson/CONTROL b/ports/libbson/CONTROL
index 2d64c4c1c..541286c50 100644
--- a/ports/libbson/CONTROL
+++ b/ports/libbson/CONTROL
@@ -1,3 +1,3 @@
Source: libbson
-Version: 1.9.5-1
+Version: 1.13.0
Description: libbson is a library providing useful routines related to building, parsing, and iterating BSON documents.
diff --git a/ports/libbson/fix-uwp.patch b/ports/libbson/fix-uwp.patch
index ad916373f..8a793aece 100644
--- a/ports/libbson/fix-uwp.patch
+++ b/ports/libbson/fix-uwp.patch
@@ -1,94 +1,148 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 553f13b..03dc546 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -230,6 +230,9 @@
- ${SOURCE_DIR}/src/bson/bson-writer.h
+--- 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
)
+add_definitions(-D_CRT_SECURE_NO_WARNINGS)
+
-+if (NOT BSON_ENABLE_STATIC)
- add_library(bson_shared SHARED ${SOURCES} ${HEADERS})
- set(CMAKE_CXX_VISIBILITY_PRESET hidden)
- set_target_properties(bson_shared PROPERTIES COMPILE_DEFINITIONS "BSON_COMPILATION;JSONSL_PARSE_NAN")
-@@ -263,16 +266,21 @@
++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_LIBS ${BSON_SYSTEM_LIBS} ws2_32)
- endif()
-+endif()
+ set (BSON_SYSTEM_LIBRARIES ${BSON_SYSTEM_LIBRARIES} ws2_32)
+ endif ()
++endif ()
- if (BSON_ENABLE_STATIC)
- add_library(bson_static STATIC ${SOURCES} ${HEADERS})
+ 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 ${BSON_VERSION})
- set_target_properties(bson_static PROPERTIES OUTPUT_NAME "bson-static-${BSON_API_VERSION}")
+ 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)
+ target_link_libraries (bson_static Threads::Threads)
if (RT_LIBRARY)
target_link_libraries (bson_static ${RT_LIBRARY})
- endif()
+ endif ()
+ find_library(M_LIBRARY m)
if (M_LIBRARY)
target_link_libraries (bson_static ${M_LIBRARY})
- endif()
-@@ -332,7 +340,7 @@
- add_executable (${bin} ${BSON_EXAMPLE_SOURCES})
+ 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)
+ # Link against the shared lib like normal apps
+- target_link_libraries (${bin} bson_shared)
++ target_link_libraries (${bin} bson_shared bson_static)
- set (EXAMPLES ${EXAMPLES} ${bin})
+ set (EXAMPLES ${EXAMPLES} ${bin})
endfunction ()
-@@ -349,6 +357,7 @@
- endif () # ENABLE_EXAMPLES
+@@ -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} ${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} ${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)
- set (BSON_HEADER_INSTALL_DIR "include/libbson-${BSON_API_VERSION}")
-+if (NOT BSON_ENABLE_STATIC)
- install(
- TARGETS bson_shared ${EXAMPLES}
- LIBRARY DESTINATION lib
-@@ -355,6 +364,7 @@
- ARCHIVE DESTINATION lib
- RUNTIME DESTINATION bin
++if (NOT MONGOC_ENABLE_STATIC)
+ 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 (BSON_ENABLE_STATIC)
- install(
- TARGETS bson_static ${EXAMPLES}
-diff --git a/src/bson/bson-compat.h b/src/bson/bson-compat.h
-index 05fc614..e8e2214 100644
---- a/src/bson/bson-compat.h
-+++ b/src/bson/bson-compat.h
-@@ -39,11 +39,11 @@
+ if (MONGOC_ENABLE_STATIC)
+ 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 = NULL;
+ const char *key;
+ bson_iter_t iter;
+ int64_t existing_chunks;
+--- 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;
- #ifdef BSON_OS_WIN32
--#if defined(_WIN32_WINNT) && (_WIN32_WINNT < 0x0600)
-+#if defined(_WIN32_WINNT) && (_WIN32_WINNT < 0x0602)
- #undef _WIN32_WINNT
- #endif
- #ifndef _WIN32_WINNT
--#define _WIN32_WINNT 0x0600
-+#define _WIN32_WINNT 0x0602
- #endif
- #ifndef NOMINMAX
- #define NOMINMAX
-diff --git a/src/bson/bson-iso8601.c b/src/bson/bson-iso8601.c
-index 8beea90..cb4b531 100644
---- a/src/bson/bson-iso8601.c
-+++ b/src/bson/bson-iso8601.c
-@@ -115,8 +115,8 @@ _bson_iso8601_date_parse (const char *str,
- const char *day_ptr;
- const char *hour_ptr;
- const char *min_ptr;
-- const char *sec_ptr;
-- const char *millis_ptr;
-+ const char *sec_ptr = NULL;
-+ const char *millis_ptr = NULL;
- const char *tz_ptr;
+-#ifdef _WIN32
++#if defined (WINAPI_FAMILY_PARTITION) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
++#elif defined (_WIN32)
+ OSVERSIONINFO osvi;
+ ZeroMemory (&osvi, sizeof (OSVERSIONINFO));
+ osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
+--- 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
++#if defined (WINAPI_FAMILY_PARTITION) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
++ if (usec / 1000 > MAXDWORD || usec < 0)
++ __fastfail(-1);
++ Sleep((DWORD)(usec / 1000));
++#elif defined(_WIN32)
+ LARGE_INTEGER ft;
+ HANDLE timer;
- int32_t year_len = 0;
diff --git a/ports/libbson/portfile.cmake b/ports/libbson/portfile.cmake
index 50b6da175..dc4de34dd 100644
--- a/ports/libbson/portfile.cmake
+++ b/ports/libbson/portfile.cmake
@@ -2,9 +2,9 @@ include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
- REPO mongodb/libbson
- REF 1.9.5
- SHA512 14bc75989baac550f42939ea161fa7872b950e5b669dc8f19e897f0783b04e0212e5e722b3fcdf946308b9a68bc066502ed8238dad92e342e5f49b8b2cc8f484
+ REPO mongodb/mongo-c-driver
+ REF 1.13.0
+ SHA512 d2f5b04b3d2dbdeba4547ec1fe8a0da7bad5214de92fff480ef0ff7d97ea45d5e6347c11c249867d4905b1dd81b76c7cfbb9094a58df586dae881955ee246907
HEAD_REF master
PATCHES fix-uwp.patch
)
@@ -19,7 +19,10 @@ vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
+ -DENABLE_MONGOC=OFF
+ -DENABLE_BSON=ON
-DENABLE_TESTS=OFF
+ -DENABLE_EXAMPLES=OFF
-DENABLE_STATIC=${ENABLE_STATIC}
)
@@ -29,6 +32,8 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
else()
vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/libbson-1.0")
endif()
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver)
# This rename is needed because the official examples expect to use #include <bson.h>
# See Microsoft/vcpkg#904
diff --git a/ports/libbson/static.patch b/ports/libbson/static.patch
index e92286aed..7710d5b6d 100644
--- a/ports/libbson/static.patch
+++ b/ports/libbson/static.patch
@@ -1,7 +1,5 @@
-diff --git a/bson-macros.h b/bson-macros.h
-index 909bf6c..0a1f612 100644
---- a/bson-macros.h
-+++ b/bson-macros.h
+--- a/bson/bson-macros.h
++++ b/bson/bson-macros.h
@@ -87,7 +87,7 @@
#elif defined(BSON_COMPILATION)
#define BSON_API __declspec(dllexport)
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)