early-access version 2853
This commit is contained in:
15
externals/vcpkg/ports/libbson/disable-source-write.patch
vendored
Executable file
15
externals/vcpkg/ports/libbson/disable-source-write.patch
vendored
Executable file
@@ -0,0 +1,15 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 7ff8bbf..32c2e00 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -114,8 +114,8 @@ if (BUILD_VERSION STREQUAL "0.0.0")
|
||||
file (WRITE ${PROJECT_SOURCE_DIR}/VERSION_CURRENT ${BUILD_VERSION})
|
||||
endif ()
|
||||
else ()
|
||||
- message ("storing BUILD_VERSION ${BUILD_VERSION} in file VERSION_CURRENT for later use")
|
||||
- file (WRITE ${PROJECT_SOURCE_DIR}/VERSION_CURRENT ${BUILD_VERSION})
|
||||
+ #message ("storing BUILD_VERSION ${BUILD_VERSION} in file VERSION_CURRENT for later use")
|
||||
+ #file (WRITE ${PROJECT_SOURCE_DIR}/VERSION_CURRENT ${BUILD_VERSION})
|
||||
endif ()
|
||||
|
||||
include (LoadVersion)
|
||||
13
externals/vcpkg/ports/libbson/fix-include-directory.patch
vendored
Executable file
13
externals/vcpkg/ports/libbson/fix-include-directory.patch
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
diff --git a/src/libbson/CMakeLists.txt b/src/libbson/CMakeLists.txt
|
||||
index 0197af0..422b051 100644
|
||||
--- a/src/libbson/CMakeLists.txt
|
||||
+++ b/src/libbson/CMakeLists.txt
|
||||
@@ -341,7 +341,7 @@ if (ENABLE_EXAMPLES)
|
||||
endif () # ENABLE_EXAMPLES
|
||||
|
||||
set (BSON_HEADER_INSTALL_DIR
|
||||
- "${CMAKE_INSTALL_INCLUDEDIR}/libbson-${BSON_API_VERSION}"
|
||||
+ "${CMAKE_INSTALL_INCLUDEDIR}"
|
||||
)
|
||||
|
||||
if (MONGOC_ENABLE_STATIC_INSTALL)
|
||||
13
externals/vcpkg/ports/libbson/fix-static-cmake-2.patch
vendored
Executable file
13
externals/vcpkg/ports/libbson/fix-static-cmake-2.patch
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
diff --git a/src/libbson/build/cmake/libbson-static-1.0-config.cmake.in b/src/libbson/build/cmake/libbson-static-1.0-config.cmake.in
|
||||
index 92933fe..90eb16f 100644
|
||||
--- a/src/libbson/build/cmake/libbson-static-1.0-config.cmake.in
|
||||
+++ b/src/libbson/build/cmake/libbson-static-1.0-config.cmake.in
|
||||
@@ -27,7 +27,7 @@ set_and_check (BSON_STATIC_INCLUDE_DIRS "@PACKAGE_INCLUDE_INSTALL_DIRS@")
|
||||
# directory and the base name, but not the suffix, so we use CMake's
|
||||
# find_library () to pick that up. Users can override this by configuring
|
||||
# BSON_STATIC_LIBRARY themselves.
|
||||
-find_library (BSON_STATIC_LIBRARY bson-static-1.0 PATHS "@PACKAGE_LIBRARY_INSTALL_DIRS@" NO_DEFAULT_PATH)
|
||||
+find_library (BSON_STATIC_LIBRARY bson-1.0 PATHS "@PACKAGE_LIBRARY_INSTALL_DIRS@" NO_DEFAULT_PATH)
|
||||
|
||||
set (BSON_STATIC_LIBRARIES ${BSON_STATIC_LIBRARY})
|
||||
|
||||
13
externals/vcpkg/ports/libbson/fix-static-cmake.patch
vendored
Executable file
13
externals/vcpkg/ports/libbson/fix-static-cmake.patch
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
diff --git a/src/libbson/build/cmake/libbson-static-1.0-config.cmake.in b/src/libbson/build/cmake/libbson-static-1.0-config.cmake.in
|
||||
index 92933fe01..931a829ae 100644
|
||||
--- a/src/libbson/build/cmake/libbson-static-1.0-config.cmake.in
|
||||
+++ b/src/libbson/build/cmake/libbson-static-1.0-config.cmake.in
|
||||
@@ -36,3 +36,7 @@ foreach (LIB @LIBBSON_LIBRARIES@)
|
||||
endforeach ()
|
||||
|
||||
set (BSON_STATIC_DEFINITIONS BSON_STATIC)
|
||||
+
|
||||
+set (BSON_LIBRARIES ${BSON_STATIC_LIBRARIES})
|
||||
+set (BSON_INCLUDE_DIRS ${BSON_STATIC_INCLUDE_DIRS})
|
||||
+set (BSON_DEFINITIONS BSON_STATIC)
|
||||
\ No newline at end of file
|
||||
139
externals/vcpkg/ports/libbson/fix-uwp.patch
vendored
Executable file
139
externals/vcpkg/ports/libbson/fix-uwp.patch
vendored
Executable file
@@ -0,0 +1,139 @@
|
||||
diff --git a/src/libbson/CMakeLists.txt b/src/libbson/CMakeLists.txt
|
||||
index bb8259b85..0197af068 100644
|
||||
--- a/src/libbson/CMakeLists.txt
|
||||
+++ b/src/libbson/CMakeLists.txt
|
||||
@@ -230,6 +230,9 @@ set (HEADERS_FORWARDING
|
||||
${PROJECT_SOURCE_DIR}/src/bson/forwarding/bson.h
|
||||
)
|
||||
|
||||
+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)
|
||||
target_compile_definitions (bson_shared PRIVATE BSON_COMPILATION JSONSL_PARSE_NAN)
|
||||
@@ -279,9 +282,13 @@ if (WIN32)
|
||||
# must be handled specially since we can't resolve them
|
||||
set (BSON_SYSTEM_LIBRARIES ${BSON_SYSTEM_LIBRARIES} ws2_32)
|
||||
endif ()
|
||||
+endif ()
|
||||
|
||||
if (MONGOC_ENABLE_STATIC_BUILD)
|
||||
add_library (bson_static STATIC ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING})
|
||||
+ set(CMAKE_CXX_VISIBILITY_PRESET hidden)
|
||||
+ set(THREADS_PREFER_PTHREAD_FLAG 1)
|
||||
+ find_package(Threads REQUIRED)
|
||||
target_compile_definitions (bson_static
|
||||
PUBLIC BSON_STATIC
|
||||
PRIVATE BSON_COMPILATION JSONSL_PARSE_NAN
|
||||
@@ -299,6 +306,7 @@ if (MONGOC_ENABLE_STATIC_BUILD)
|
||||
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 ()
|
||||
@@ -313,7 +321,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)
|
||||
|
||||
set (EXAMPLES ${EXAMPLES} ${bin})
|
||||
endfunction ()
|
||||
@@ -337,7 +345,7 @@ set (BSON_HEADER_INSTALL_DIR
|
||||
)
|
||||
|
||||
if (MONGOC_ENABLE_STATIC_INSTALL)
|
||||
- set (TARGETS_TO_INSTALL bson_shared bson_static)
|
||||
+ set (TARGETS_TO_INSTALL bson_static)
|
||||
else ()
|
||||
set (TARGETS_TO_INSTALL bson_shared)
|
||||
endif ()
|
||||
diff --git a/src/libmongoc/CMakeLists.txt b/src/libmongoc/CMakeLists.txt
|
||||
index af5a398a9..78d02bdee 100644
|
||||
--- a/src/libmongoc/CMakeLists.txt
|
||||
+++ b/src/libmongoc/CMakeLists.txt
|
||||
@@ -725,6 +725,7 @@ if (MONGOC_ENABLE_MONGODB_AWS_AUTH)
|
||||
endif()
|
||||
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 PRIVATE ${LIBRARIES} PUBLIC ${BSON_LIBRARIES})
|
||||
@@ -744,6 +745,7 @@ target_compile_definitions (mongoc_shared PRIVATE MONGOC_COMPILATION ${KMS_MSG_D
|
||||
|
||||
set_target_properties (mongoc_shared PROPERTIES VERSION 0.0.0 SOVERSION 0)
|
||||
set_target_properties (mongoc_shared PROPERTIES OUTPUT_NAME "${MONGOC_OUTPUT_BASENAME}-${MONGOC_API_VERSION}")
|
||||
+endif ()
|
||||
|
||||
if (MONGOC_ENABLE_STATIC_BUILD)
|
||||
add_library (mongoc_static STATIC ${SOURCES} ${HEADERS} ${HEADERS_FORWARDING})
|
||||
@@ -778,7 +780,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 ${LIBRARIES})
|
||||
+endif ()
|
||||
|
||||
# mongoc-stat works if shared memory performance counters are enabled.
|
||||
if (ENABLE_SHM_COUNTERS STREQUAL "ON")
|
||||
@@ -1040,7 +1046,7 @@ file (COPY ${PROJECT_SOURCE_DIR}/tests/x509gen DESTINATION ${PROJECT_BINARY_DIR}
|
||||
file (COPY ${PROJECT_SOURCE_DIR}/tests/release_files DESTINATION ${PROJECT_BINARY_DIR}/tests)
|
||||
|
||||
if (MONGOC_ENABLE_STATIC_INSTALL)
|
||||
- set (TARGETS_TO_INSTALL mongoc_shared mongoc_static)
|
||||
+ set (TARGETS_TO_INSTALL mongoc_static)
|
||||
else ()
|
||||
set (TARGETS_TO_INSTALL mongoc_shared)
|
||||
endif ()
|
||||
diff --git a/src/libmongoc/src/mongoc/mongoc-gridfs-file.c b/src/libmongoc/src/mongoc/mongoc-gridfs-file.c
|
||||
index 0690b8680..98721df86 100644
|
||||
--- 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;
|
||||
diff --git a/src/libmongoc/src/mongoc/mongoc-handshake.c b/src/libmongoc/src/mongoc/mongoc-handshake.c
|
||||
index 5378015b8..c8e6dd6a7 100644
|
||||
--- a/src/libmongoc/src/mongoc/mongoc-handshake.c
|
||||
+++ b/src/libmongoc/src/mongoc/mongoc-handshake.c
|
||||
@@ -290,7 +290,8 @@ _get_os_version (void)
|
||||
char *ret = bson_malloc (HANDSHAKE_OS_VERSION_MAX);
|
||||
bool found = false;
|
||||
|
||||
-#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);
|
||||
diff --git a/src/libmongoc/src/mongoc/mongoc-util.c b/src/libmongoc/src/mongoc/mongoc-util.c
|
||||
index 0bbee03ef..6b66da741 100644
|
||||
--- a/src/libmongoc/src/mongoc/mongoc-util.c
|
||||
+++ b/src/libmongoc/src/mongoc/mongoc-util.c
|
||||
@@ -85,7 +85,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;
|
||||
|
||||
76
externals/vcpkg/ports/libbson/portfile.cmake
vendored
Executable file
76
externals/vcpkg/ports/libbson/portfile.cmake
vendored
Executable file
@@ -0,0 +1,76 @@
|
||||
# This port needs to be updated at the same time as mongo-c-driver
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO mongodb/mongo-c-driver
|
||||
REF 00c59aa4a1f72e49e55b211f28650c66c542739e # 1.17.6
|
||||
SHA512 9191c64def45ff268cb5d2ce08782265fb8e0567237c8d3311b91e996bd938d629578a7b50e8db29c4b3aa5bc96f93361f6d918e9cfd4861e5f5c5554cf4616d
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
fix-uwp.patch
|
||||
fix-static-cmake.patch
|
||||
disable-source-write.patch
|
||||
fix-include-directory.patch
|
||||
fix-static-cmake-2.patch
|
||||
)
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
set(ENABLE_STATIC ON)
|
||||
else()
|
||||
set(ENABLE_STATIC OFF)
|
||||
endif()
|
||||
|
||||
file(READ "${CMAKE_CURRENT_LIST_DIR}/vcpkg.json" _contents)
|
||||
string(JSON BUILD_VERSION GET "${_contents}" version)
|
||||
file(WRITE "${SOURCE_PATH}/VERSION_CURRENT" "${BUILD_VERSION}")
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
-DENABLE_MONGOC=OFF
|
||||
-DENABLE_BSON=ON
|
||||
-DENABLE_TESTS=OFF
|
||||
-DENABLE_EXAMPLES=OFF
|
||||
-DENABLE_STATIC=${ENABLE_STATIC}
|
||||
-DBUILD_VERSION=${BUILD_VERSION}
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_PythonInterp=ON
|
||||
MAYBE_UNUSED_VARIABLES
|
||||
CMAKE_DISABLE_FIND_PACKAGE_PythonInterp
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME bson-1.0 CONFIG_PATH "lib/cmake/bson-1.0" DO_NOT_DELETE_PARENT_CONFIG_PATH)
|
||||
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME libbson-1.0 CONFIG_PATH "lib/cmake/libbson-static-1.0")
|
||||
else()
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME libbson-1.0 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")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
|
||||
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
||||
# drop the __declspec(dllimport) when building static
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/bson/bson-macros.h"
|
||||
"define BSON_API __declspec(dllimport)" "define BSON_API")
|
||||
|
||||
file(RENAME
|
||||
"${CURRENT_PACKAGES_DIR}/share/libbson-1.0/libbson-static-1.0-config.cmake"
|
||||
"${CURRENT_PACKAGES_DIR}/share/libbson-1.0/libbson-1.0-config.cmake")
|
||||
file(RENAME
|
||||
"${CURRENT_PACKAGES_DIR}/share/libbson-1.0/libbson-static-1.0-config-version.cmake"
|
||||
"${CURRENT_PACKAGES_DIR}/share/libbson-1.0/libbson-1.0-config-version.cmake")
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin" "${CURRENT_PACKAGES_DIR}/bin")
|
||||
endif()
|
||||
|
||||
file(COPY "${SOURCE_PATH}/THIRD_PARTY_NOTICES" DESTINATION "${CURRENT_PACKAGES_DIR}/share/libbson")
|
||||
|
||||
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
file(INSTALL "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
|
||||
vcpkg_fixup_pkgconfig()
|
||||
9
externals/vcpkg/ports/libbson/usage
vendored
Executable file
9
externals/vcpkg/ports/libbson/usage
vendored
Executable file
@@ -0,0 +1,9 @@
|
||||
The package libbson is compatible with built-in CMake targets:
|
||||
|
||||
find_package(bson-1.0 CONFIG REQUIRED)
|
||||
target_link_libraries(main PRIVATE mongo::bson_static)
|
||||
|
||||
or:
|
||||
|
||||
find_package(bson-1.0 CONFIG REQUIRED)
|
||||
target_link_libraries(main PRIVATE mongo::bson_shared)
|
||||
17
externals/vcpkg/ports/libbson/vcpkg.json
vendored
Executable file
17
externals/vcpkg/ports/libbson/vcpkg.json
vendored
Executable file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "libbson",
|
||||
"version": "1.17.6",
|
||||
"port-version": 1,
|
||||
"description": "libbson is a library providing useful routines related to building, parsing, and iterating BSON documents.",
|
||||
"homepage": "https://github.com/mongodb/libbson",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user