aboutsummaryrefslogtreecommitdiff
path: root/ports/libbson
diff options
context:
space:
mode:
authorAlexander Saprykin <xelfium@gmail.com>2018-05-26 13:27:14 +0200
committerGitHub <noreply@github.com>2018-05-26 13:27:14 +0200
commit4ce5f064282c3a8d8d710aa82af7aa346b0c6dd5 (patch)
treed95c9490352eb73f078d34a33bc4bb44ac9fa48b /ports/libbson
parentfb689bd13dd6ba563a885d71fff1dd2b32a615db (diff)
parent2ac7527b40b1dbeb7856b9f763362c1e139e2ca9 (diff)
downloadvcpkg-4ce5f064282c3a8d8d710aa82af7aa346b0c6dd5.tar.gz
vcpkg-4ce5f064282c3a8d8d710aa82af7aa346b0c6dd5.zip
Merge pull request #1 from Microsoft/master
Update vcpkg from upstream
Diffstat (limited to 'ports/libbson')
-rw-r--r--ports/libbson/CONTROL4
-rw-r--r--ports/libbson/fix-uwp.patch76
-rw-r--r--ports/libbson/portfile.cmake36
-rw-r--r--ports/libbson/static.patch18
4 files changed, 96 insertions, 38 deletions
diff --git a/ports/libbson/CONTROL b/ports/libbson/CONTROL
index 0edf7847c..8ba25697f 100644
--- a/ports/libbson/CONTROL
+++ b/ports/libbson/CONTROL
@@ -1,3 +1,3 @@
Source: libbson
-Version: 1.6.2
-Description: libbson is a library providing useful routines related to building, parsing, and iterating BSON documents. \ No newline at end of file
+Version: 1.9.2
+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 abe11f8a4..ad916373f 100644
--- a/ports/libbson/fix-uwp.patch
+++ b/ports/libbson/fix-uwp.patch
@@ -2,27 +2,63 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
index 553f13b..03dc546 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
-@@ -194,6 +194,8 @@ set (HEADERS
+@@ -230,6 +230,9 @@
${SOURCE_DIR}/src/bson/bson-writer.h
)
+add_definitions(-D_CRT_SECURE_NO_WARNINGS)
+
++if (NOT BSON_ENABLE_STATIC)
add_library(bson_shared SHARED ${SOURCES} ${HEADERS})
- add_library(bson_static STATIC ${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 @@
+ # must be handled specially since we can't resolve them
+ set(BSON_SYSTEM_LIBS ${BSON_SYSTEM_LIBS} ws2_32)
+ endif()
++endif()
-@@ -272,8 +274,10 @@ if (ENABLE_TESTS)
- DESTINATION ${PROJECT_BINARY_DIR}/tests)
- endif () # ENABLE_TESTS
+ if (BSON_ENABLE_STATIC)
+ add_library(bson_static STATIC ${SOURCES} ${HEADERS})
++ 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(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()
+@@ -332,7 +340,7 @@
+ add_executable (${bin} ${BSON_EXAMPLE_SOURCES})
-+set(INSTALL_TARGETS bson_shared bson_static CACHE INTERNAL "List of library targets to install")
-+
+ # 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 ()
+@@ -349,6 +357,7 @@
+ endif () # ENABLE_EXAMPLES
+
+ set (BSON_HEADER_INSTALL_DIR "include/libbson-${BSON_API_VERSION}")
++if (NOT BSON_ENABLE_STATIC)
install(
-- TARGETS bson_shared bson_static
-+ TARGETS ${INSTALL_TARGETS}
+ TARGETS bson_shared ${EXAMPLES}
LIBRARY DESTINATION lib
+@@ -355,6 +364,7 @@
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
+ )
++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
@@ -31,21 +67,21 @@ index 05fc614..e8e2214 100644
#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
+-#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
-@@ -117,8 +117,8 @@ _bson_iso8601_date_parse (const char *str,
+@@ -115,8 +115,8 @@ _bson_iso8601_date_parse (const char *str,
const char *day_ptr;
const char *hour_ptr;
const char *min_ptr;
diff --git a/ports/libbson/portfile.cmake b/ports/libbson/portfile.cmake
index 58513498e..3bc9cd18a 100644
--- a/ports/libbson/portfile.cmake
+++ b/ports/libbson/portfile.cmake
@@ -1,10 +1,10 @@
include(vcpkg_common_functions)
-set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libbson-1.6.2)
+set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libbson-1.9.2)
vcpkg_download_distfile(ARCHIVE
- URLS "https://github.com/mongodb/libbson/archive/1.6.2.tar.gz"
- FILENAME "libbson-1.6.2.tar.gz"
- SHA512 c5848984d5db5ab62e698a0185139b20834d83fd7befef72336997097f639ef13e81053531385e96c7ba1fe3f3fe4ded517f5b8ee58f0914c5c807a9cb43766d
+ URLS "https://github.com/mongodb/libbson/archive/1.9.2.tar.gz"
+ FILENAME "libbson-1.9.2.tar.gz"
+ SHA512 a05f1e8fbabb34e847692397e2e41fc5923ddd18dba861e5ab8a31acdf6738e13ab719eae8f9f8563f08fc43aab5c8d1f53cb6a47c38c96e132fa4a62a48d2bf
)
vcpkg_extract_source_archive(${ARCHIVE})
@@ -14,9 +14,9 @@ vcpkg_apply_patches(
)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
- set(TARGET_TO_INSTALL bson_static)
+ set(ENABLE_STATIC ON)
else()
- set(TARGET_TO_INSTALL bson_shared)
+ set(ENABLE_STATIC OFF)
endif()
vcpkg_configure_cmake(
@@ -24,10 +24,15 @@ vcpkg_configure_cmake(
PREFER_NINJA
OPTIONS
-DENABLE_TESTS=OFF
- -DINSTALL_TARGETS=${TARGET_TO_INSTALL}
+ -DENABLE_STATIC=${ENABLE_STATIC}
)
vcpkg_install_cmake()
+if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
+ vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/libbson-static-1.0")
+else()
+ vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/libbson-1.0")
+endif()
# This rename is needed because the official examples expect to use #include <bson.h>
# See Microsoft/vcpkg#904
@@ -53,9 +58,26 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
PATCHES
${CMAKE_CURRENT_LIST_DIR}/static.patch
)
+
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin ${CURRENT_PACKAGES_DIR}/bin)
endif()
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libbson RENAME copyright)
file(COPY ${SOURCE_PATH}/THIRD_PARTY_NOTICES DESTINATION ${CURRENT_PACKAGES_DIR}/share/libbson)
+if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
+ set(PORT_POSTFIX "static-1.0")
+else()
+ set(PORT_POSTFIX "1.0")
+endif()
+
+file(READ ${CURRENT_PACKAGES_DIR}/share/libbson/libbson-${PORT_POSTFIX}-config.cmake LIBBSON_CONFIG_CMAKE)
+string(REPLACE "/include/libbson-1.0" "/include" LIBBSON_CONFIG_CMAKE "${LIBBSON_CONFIG_CMAKE}")
+string(REPLACE "bson-static-1.0" "bson-1.0" LIBBSON_CONFIG_CMAKE "${LIBBSON_CONFIG_CMAKE}")
+file(WRITE ${CURRENT_PACKAGES_DIR}/share/libbson/libbson-${PORT_POSTFIX}-config.cmake "${LIBBSON_CONFIG_CMAKE}")
+file(COPY ${CURRENT_PACKAGES_DIR}/share/libbson/libbson-${PORT_POSTFIX}-config.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/libbson-${PORT_POSTFIX})
+file(COPY ${CURRENT_PACKAGES_DIR}/share/libbson/libbson-${PORT_POSTFIX}-config-version.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/libbson-${PORT_POSTFIX})
+file(RENAME ${CURRENT_PACKAGES_DIR}/share/libbson/libbson-${PORT_POSTFIX}-config.cmake ${CURRENT_PACKAGES_DIR}/share/libbson/libbson-config.cmake)
+file(RENAME ${CURRENT_PACKAGES_DIR}/share/libbson/libbson-${PORT_POSTFIX}-config-version.cmake ${CURRENT_PACKAGES_DIR}/share/libbson/libbson-config-version.cmake)
+
vcpkg_copy_pdbs() \ No newline at end of file
diff --git a/ports/libbson/static.patch b/ports/libbson/static.patch
index adb52fa4f..e92286aed 100644
--- a/ports/libbson/static.patch
+++ b/ports/libbson/static.patch
@@ -2,12 +2,12 @@ diff --git a/bson-macros.h b/bson-macros.h
index 909bf6c..0a1f612 100644
--- a/bson-macros.h
+++ b/bson-macros.h
-@@ -69,7 +69,7 @@
- # ifdef BSON_COMPILATION
- # define BSON_API __declspec(dllexport)
- # else
--# define BSON_API __declspec(dllimport)
-+# define BSON_API
- # endif
- #elif defined(__GNUC__)
- # define BSON_API __attribute__ ((visibility ("default")))
+@@ -87,7 +87,7 @@
+ #elif defined(BSON_COMPILATION)
+ #define BSON_API __declspec(dllexport)
+ #else
+-#define BSON_API __declspec(dllimport)
++#define BSON_API
+ #endif
+ #define BSON_CALL __cdecl
+