From 2538bdac5a8932c93efe5b87666e373c8c817ca4 Mon Sep 17 00:00:00 2001 From: sdcb Date: Mon, 21 Nov 2016 11:19:08 +0800 Subject: [PATCH 1/6] Upgrade libbson to 1.5.0-rc6 Add support for libbson-static build. Do not use the patch file for libbson. --- ports/libbson/0001_cmake.patch | 35 ----------------------------- ports/libbson/CONTROL | 2 +- ports/libbson/portfile.cmake | 40 +++++++++++++++++++++------------- 3 files changed, 26 insertions(+), 51 deletions(-) delete mode 100644 ports/libbson/0001_cmake.patch diff --git a/ports/libbson/0001_cmake.patch b/ports/libbson/0001_cmake.patch deleted file mode 100644 index af1f1a598f..0000000000 --- a/ports/libbson/0001_cmake.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index d09a298..e64a6cd 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -12,7 +12,6 @@ include(CheckIncludeFile) - include(CheckStructHasMember) - include(CheckSymbolExists) - include(TestBigEndian) --include(InstallRequiredSystemLibraries) - - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/build/cmake) - -@@ -47,13 +46,6 @@ TEST_BIG_ENDIAN(BSON_BIG_ENDIAN) - set (BSON_PTHREAD_ONCE_INIT_NEEDS_BRACES 0) - set (BSON_HAVE_DECIMAL128 0) - --#librt needed on linux for clock_gettime --find_library(RT_LIBRARY rt) --if (RT_LIBRARY) -- #set required libraries for CHECK_FUNCTION_EXISTS -- set(CMAKE_REQUIRED_LIBRARIES ${RT_LIBRARY}) --endif() -- - # See https://public.kitware.com/Bug/view.php?id=15659 - CHECK_SYMBOL_EXISTS(snprintf stdio.h BSON_HAVE_SNPRINTF) - if (NOT BSON_HAVE_SNPRINTF) -@@ -314,7 +306,7 @@ install( - ) - install( - FILES ${HEADERS} -- DESTINATION "include/libbson-${BSON_API_VERSION}" -+ DESTINATION "include" - ) - - set(VERSION "${BSON_VERSION}") diff --git a/ports/libbson/CONTROL b/ports/libbson/CONTROL index 71f48c3546..089e346722 100644 --- a/ports/libbson/CONTROL +++ b/ports/libbson/CONTROL @@ -1,3 +1,3 @@ Source: libbson -Version: 1.4.2 +Version: 1.5.0-rc6 Description: libbson is a library providing useful routines related to building, parsing, and iterating BSON documents. \ No newline at end of file diff --git a/ports/libbson/portfile.cmake b/ports/libbson/portfile.cmake index 71846b6439..7f219a4c78 100644 --- a/ports/libbson/portfile.cmake +++ b/ports/libbson/portfile.cmake @@ -1,28 +1,38 @@ -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(STATUS "Warning: Static building not supported yet. Building dynamic.") - set(VCPKG_LIBRARY_LINKAGE dynamic) -endif() include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libbson-1.4.2) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libbson-1.5.0-rc6) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/mongodb/libbson/releases/download/1.4.2/libbson-1.4.2.tar.gz" - FILENAME "libbson-1.4.2.tar.gz" - SHA512 4cc8f833978483af3dcbc30bede33f2a9b448930fabf7be2d5581c8368e875dc1707d31eae209c747e69be1f82fa525c7362c5ac9c4e0b6b3f3346dd5147860e + URLS "https://github.com/mongodb/libbson/archive/1.5.0-rc6.tar.gz" + FILENAME "libbson-1.5.0-rc6.tar.gz" + SHA512 15cf590b488f7de8d614ddcc2c1536b05b607311f3cd3353418469c7a62177124fb4fb1c53f51b0de4c7491b21051c1ec47fbc12856cc69e37baebb3d65897c5 ) vcpkg_extract_source_archive(${ARCHIVE}) -vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} - PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch -) - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DENABLE_TESTS=OFF + -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON ) vcpkg_install_cmake() + +file(RENAME + ${CURRENT_PACKAGES_DIR}/include/libbson-1.0 + ${CURRENT_PACKAGES_DIR}/temp) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include) +file(RENAME ${CURRENT_PACKAGES_DIR}/temp ${CURRENT_PACKAGES_DIR}/include) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libbson) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/libbson/COPYING ${CURRENT_PACKAGES_DIR}/share/libbson/copyright) \ No newline at end of file +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/bson-1.0.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/bson-1.0.lib) +else() + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/bson-static-1.0.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/bson-static-1.0.lib) +endif() + +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libbson RENAME copyright) \ No newline at end of file From 51a9334d1b16cf00f3e547eb9e6b162ac34c526e Mon Sep 17 00:00:00 2001 From: sdcb Date: Mon, 21 Nov 2016 11:53:06 +0800 Subject: [PATCH 2/6] Fix static build runtime error. --- ports/libbson/portfile.cmake | 7 +++++++ ports/libbson/static.patch | 13 +++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 ports/libbson/static.patch diff --git a/ports/libbson/portfile.cmake b/ports/libbson/portfile.cmake index 7f219a4c78..4f8dc0e25e 100644 --- a/ports/libbson/portfile.cmake +++ b/ports/libbson/portfile.cmake @@ -30,6 +30,13 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/bson-1.0.lib) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/bson-1.0.lib) + + # drop the __declspec(dllimport) when building static + vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/static.patch + ) else() file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/bson-static-1.0.lib) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/bson-static-1.0.lib) diff --git a/ports/libbson/static.patch b/ports/libbson/static.patch new file mode 100644 index 0000000000..adb52fa4fa --- /dev/null +++ b/ports/libbson/static.patch @@ -0,0 +1,13 @@ +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"))) From b63d35b10ba2cc0b0569c7a18509fb71ff6f6ca5 Mon Sep 17 00:00:00 2001 From: sdcb Date: Mon, 21 Nov 2016 13:51:48 +0800 Subject: [PATCH 3/6] [mongo-c-driver] Upgrade to 1.5.0-rc6 Enable building static library. Exclude test and examples. --- ports/libbson/portfile.cmake | 7 +++++ ports/mongo-c-driver/CONTROL | 4 +-- ports/mongo-c-driver/portfile.cmake | 47 ++++++++++++++++++++--------- 3 files changed, 41 insertions(+), 17 deletions(-) diff --git a/ports/libbson/portfile.cmake b/ports/libbson/portfile.cmake index 4f8dc0e25e..7642c3437e 100644 --- a/ports/libbson/portfile.cmake +++ b/ports/libbson/portfile.cmake @@ -31,6 +31,13 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/bson-1.0.lib) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/bson-1.0.lib) + file(RENAME + ${CURRENT_PACKAGES_DIR}/lib/bson-static-1.0.lib + ${CURRENT_PACKAGES_DIR}/lib/bson-1.0.lib) + file(RENAME + ${CURRENT_PACKAGES_DIR}/debug/lib/bson-static-1.0.lib + ${CURRENT_PACKAGES_DIR}/debug/lib/bson-1.0.lib) + # drop the __declspec(dllimport) when building static vcpkg_apply_patches( SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include diff --git a/ports/mongo-c-driver/CONTROL b/ports/mongo-c-driver/CONTROL index b0cec868ce..6288a1fa76 100644 --- a/ports/mongo-c-driver/CONTROL +++ b/ports/mongo-c-driver/CONTROL @@ -1,4 +1,4 @@ Source: mongo-c-driver -Version: 1.4.2 -Build-Depends: libbson +Version: 1.5.0-rc6 +Build-Depends: libbson, openssl Description: Client library written in C for MongoDB. \ No newline at end of file diff --git a/ports/mongo-c-driver/portfile.cmake b/ports/mongo-c-driver/portfile.cmake index 1aa83f6bb1..f9a247499a 100644 --- a/ports/mongo-c-driver/portfile.cmake +++ b/ports/mongo-c-driver/portfile.cmake @@ -1,30 +1,47 @@ -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(STATUS "Warning: Static building not supported yet. Building dynamic.") #Blocked by libbson - set(VCPKG_LIBRARY_LINKAGE dynamic) -endif() include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mongo-c-driver-1.4.2) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mongo-c-driver-1.5.0-rc6) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/mongodb/mongo-c-driver/releases/download/1.4.2/mongo-c-driver-1.4.2.tar.gz" - FILENAME "mongo-c-driver-1.4.2.tar.gz" - SHA512 402b9d0f2ae957a07336c9a6d971440472acef8e17a3ba5e89635ca454a13d4b7cf5f9b71151ed6182c012efb5fac6684acfc00443c6bca07cdd04b9f7eddaeb + URLS "https://github.com/mongodb/mongo-c-driver/archive/1.5.0-rc6.tar.gz" + FILENAME "mongo-c-driver-1.5.0-rc6.tar.gz" + SHA512 708caf4e963bad97b4802456c6f5809a0ba8c24fe5faaf0e91aa889a0690df4324005f8d324b3bfc80ffc76f1594612a8d391d7421dd914c58369c24cf8cc965 ) vcpkg_extract_source_archive(${ARCHIVE}) -vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} - PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch -) - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS -DBSON_ROOT_DIR=${CURRENT_INSTALLED_DIR} + -DENABLE_TESTS=OFF + -DENABLE_EXAMPLES=OFF + -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON ) vcpkg_install_cmake() + +file(RENAME + ${CURRENT_PACKAGES_DIR}/include/libmongoc-1.0 + ${CURRENT_PACKAGES_DIR}/temp) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include) +file(RENAME ${CURRENT_PACKAGES_DIR}/temp ${CURRENT_PACKAGES_DIR}/include) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver/COPYING ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver/copyright) \ No newline at end of file +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/mongoc-1.0.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-1.0.lib) + + file(RENAME + ${CURRENT_PACKAGES_DIR}/lib/mongoc-static-1.0.lib + ${CURRENT_PACKAGES_DIR}/lib/mongoc-1.0.lib) + file(RENAME + ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-static-1.0.lib + ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-1.0.lib) +else() + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/mongoc-static-1.0.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/mongoc-static-1.0.lib) +endif() + +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver RENAME copyright) \ No newline at end of file From 6fc5aeae74b9ccee2c34d2b8e22a8ec73d99e8f1 Mon Sep 17 00:00:00 2001 From: sdcb Date: Mon, 21 Nov 2016 13:59:42 +0800 Subject: [PATCH 4/6] [mongo-c-driver] openssl is optional dependency. --- ports/mongo-c-driver/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/mongo-c-driver/CONTROL b/ports/mongo-c-driver/CONTROL index 6288a1fa76..330ff27aff 100644 --- a/ports/mongo-c-driver/CONTROL +++ b/ports/mongo-c-driver/CONTROL @@ -1,4 +1,4 @@ Source: mongo-c-driver Version: 1.5.0-rc6 -Build-Depends: libbson, openssl +Build-Depends: libbson Description: Client library written in C for MongoDB. \ No newline at end of file From 260f5f20c3eb741e6b4e91eb46cc18253615a56f Mon Sep 17 00:00:00 2001 From: sdcb Date: Mon, 21 Nov 2016 17:41:25 +0800 Subject: [PATCH 5/6] [mongo-cxx-driver] Upgrade to 3.0.3 Enable static build Disable test and example --- ports/mongo-cxx-driver/0001_cmake.patch | 64 -------- ports/mongo-cxx-driver/CONTROL | 2 +- .../disable_test_and_example.patch | 149 ++++++++++++++++++ ports/mongo-cxx-driver/portfile.cmake | 73 +++++++-- 4 files changed, 209 insertions(+), 79 deletions(-) delete mode 100644 ports/mongo-cxx-driver/0001_cmake.patch create mode 100644 ports/mongo-cxx-driver/disable_test_and_example.patch diff --git a/ports/mongo-cxx-driver/0001_cmake.patch b/ports/mongo-cxx-driver/0001_cmake.patch deleted file mode 100644 index 6e93e47555..0000000000 --- a/ports/mongo-cxx-driver/0001_cmake.patch +++ /dev/null @@ -1,64 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 695f64c..87807d6 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -59,7 +59,6 @@ set(CMAKE_CXX_EXTENSIONS OFF) - - # Include the required modules - include(GenerateExportHeader) --include(InstallRequiredSystemLibraries) - - # If the user did not customize the install prefix, - # set it to live under build so we don't inadverently pollute /usr/local -diff --git a/cmake/FindLibBSON.cmake b/cmake/FindLibBSON.cmake -index 52f5de0..7a0be52 100644 ---- a/cmake/FindLibBSON.cmake -+++ b/cmake/FindLibBSON.cmake -@@ -26,7 +26,7 @@ if(LIBBSON_DIR) - # Trust the user's override path by default - set(LIBBSON_LIBRARIES bson-1.0 CACHE INTERNAL "") - set(LIBBSON_LIBRARY_DIRS ${LIBBSON_DIR}/lib CACHE INTERNAL "") -- set(LIBBSON_INCLUDE_DIRS ${LIBBSON_DIR}/include/libbson-1.0 CACHE INTERNAL "") -+ set(LIBBSON_INCLUDE_DIRS ${LIBBSON_DIR}/include CACHE INTERNAL "") - find_package_handle_standard_args(LIBBSON DEFAULT_MSG LIBBSON_LIBRARIES LIBBSON_LIBRARY_DIRS LIBBSON_INCLUDE_DIRS) - elseif (PKG_CONFIG_FOUND) - # The best we can do until libbson starts installing a libbson-config.cmake file -diff --git a/cmake/FindLibMongoC.cmake b/cmake/FindLibMongoC.cmake -index 830de11..7e0bc76 100644 ---- a/cmake/FindLibMongoC.cmake -+++ b/cmake/FindLibMongoC.cmake -@@ -26,7 +26,7 @@ if(LIBMONGOC_DIR) - # Trust the user's override path by default - set(LIBMONGOC_LIBRARIES mongoc-1.0 CACHE INTERNAL "") - set(LIBMONGOC_LIBRARY_DIRS ${LIBMONGOC_DIR}/lib CACHE INTERNAL "") -- set(LIBMONGOC_INCLUDE_DIRS ${LIBMONGOC_DIR}/include/libmongoc-1.0 CACHE INTERNAL "") -+ set(LIBMONGOC_INCLUDE_DIRS ${LIBMONGOC_DIR}/include CACHE INTERNAL "") - find_package_handle_standard_args(LIBMONGOC DEFAULT_MSG LIBMONGOC_LIBRARIES LIBMONGOC_LIBRARY_DIRS LIBMONGOC_INCLUDE_DIRS) - elseif (PKG_CONFIG_FOUND) - # The best we can do until libMONGOC starts installing a libmongoc-config.cmake file -diff --git a/src/bsoncxx/CMakeLists.txt b/src/bsoncxx/CMakeLists.txt -index cea1bc9..481529c 100644 ---- a/src/bsoncxx/CMakeLists.txt -+++ b/src/bsoncxx/CMakeLists.txt -@@ -60,7 +60,7 @@ endif() - - set(BSONCXX_VERSION ${BSONCXX_VERSION_MAJOR}.${BSONCXX_VERSION_MINOR}.${BSONCXX_VERSION_PATCH}${BSONCXX_VERSION_EXTRA}) - set(BSONCXX_INLINE_NAMESPACE "v${BSONCXX_ABI_VERSION}") --set(BSONCXX_HEADER_INSTALL_DIR "include/bsoncxx/${BSONCXX_INLINE_NAMESPACE}" CACHE INTERNAL "") -+set(BSONCXX_HEADER_INSTALL_DIR "include" CACHE INTERNAL "") - - set(LIBBSON_REQUIRED_VERSION 1.3.4) - set(LIBBSON_REQUIRED_ABI_VERSION 1.0) -diff --git a/src/mongocxx/CMakeLists.txt b/src/mongocxx/CMakeLists.txt -index fdbe61a..7d5c2c9 100644 ---- a/src/mongocxx/CMakeLists.txt -+++ b/src/mongocxx/CMakeLists.txt -@@ -32,7 +32,7 @@ set(MONGOCXX_ABI_VERSION _noabi) - - set(MONGOCXX_VERSION ${MONGOCXX_VERSION_MAJOR}.${MONGOCXX_VERSION_MINOR}.${MONGOCXX_VERSION_PATCH}${MONGOCXX_VERSION_EXTRA}) - set(MONGOCXX_INLINE_NAMESPACE "v${MONGOCXX_ABI_VERSION}") --set(MONGOCXX_HEADER_INSTALL_DIR "include/mongocxx/${MONGOCXX_INLINE_NAMESPACE}" CACHE INTERNAL "") -+set(MONGOCXX_HEADER_INSTALL_DIR "include" CACHE INTERNAL "") - - add_subdirectory(config) - diff --git a/ports/mongo-cxx-driver/CONTROL b/ports/mongo-cxx-driver/CONTROL index 1e2611b13d..41c9584007 100644 --- a/ports/mongo-cxx-driver/CONTROL +++ b/ports/mongo-cxx-driver/CONTROL @@ -1,4 +1,4 @@ Source: mongo-cxx-driver -Version: 3.0.2 +Version: 3.0.3 Build-Depends: boost,libbson,mongo-c-driver Description: MongoDB C++ Driver. \ No newline at end of file diff --git a/ports/mongo-cxx-driver/disable_test_and_example.patch b/ports/mongo-cxx-driver/disable_test_and_example.patch new file mode 100644 index 0000000000..d542628f75 --- /dev/null +++ b/ports/mongo-cxx-driver/disable_test_and_example.patch @@ -0,0 +1,149 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4538920..e783ff5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -74,66 +74,66 @@ endif() + + set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +-add_custom_target(hugo_dir +- COMMAND ${CMAKE_COMMAND} -E make_directory hugo +-) +- +-add_custom_target(hugo +- DEPENDS hugo_dir +- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/docs +- COMMAND hugo +- VERBATIM +-) +- +-add_custom_target(hugo-deploy +- DEPENDS hugo +- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +- COMMAND etc/deploy-to-ghpages.pl --hugo git@github.com:mongodb/mongo-cxx-driver +- VERBATIM +-) +- +-add_custom_target(docs_dir_current +- COMMAND ${CMAKE_COMMAND} -E make_directory docs/api/current +-) +- +-add_custom_target(doxygen-current +- DEPENDS docs_dir_current +- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +- COMMAND doxygen ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile +- VERBATIM +-) +- +-add_custom_target(doxygen-all +- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +- COMMAND etc/generate-all-apidocs.pl +- VERBATIM +-) +- +-add_custom_target(doxygen-deploy +- DEPENDS doxygen-all +- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +- COMMAND etc/deploy-to-ghpages.pl --doxygen git@github.com:mongodb/mongo-cxx-driver +- VERBATIM +-) +- +-add_custom_target(format +- python ${CMAKE_SOURCE_DIR}/etc/clang_format.py format +- VERBATIM +-) +- +-add_custom_target(format-lint +- python ${CMAKE_SOURCE_DIR}/etc/clang_format.py lint +- VERBATIM +-) +- +-add_custom_target(docs +- DEPENDS hugo doxygen-current +-) +- +-set(THIRD_PARTY_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/third_party) ++#add_custom_target(hugo_dir ++# COMMAND ${CMAKE_COMMAND} -E make_directory hugo ++#) ++# ++#add_custom_target(hugo ++# DEPENDS hugo_dir ++# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/docs ++# COMMAND hugo ++# VERBATIM ++#) ++# ++#add_custom_target(hugo-deploy ++# DEPENDS hugo ++# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ++# COMMAND etc/deploy-to-ghpages.pl --hugo git@github.com:mongodb/mongo-cxx-driver ++# VERBATIM ++#) ++# ++#add_custom_target(docs_dir_current ++# COMMAND ${CMAKE_COMMAND} -E make_directory docs/api/current ++#) ++# ++#add_custom_target(doxygen-current ++# DEPENDS docs_dir_current ++# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ++# COMMAND doxygen ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile ++# VERBATIM ++#) ++# ++#add_custom_target(doxygen-all ++# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ++# COMMAND etc/generate-all-apidocs.pl ++# VERBATIM ++#) ++# ++#add_custom_target(doxygen-deploy ++# DEPENDS doxygen-all ++# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ++# COMMAND etc/deploy-to-ghpages.pl --doxygen git@github.com:mongodb/mongo-cxx-driver ++# VERBATIM ++#) ++# ++#add_custom_target(format ++# python ${CMAKE_SOURCE_DIR}/etc/clang_format.py format ++# VERBATIM ++#) ++# ++#add_custom_target(format-lint ++# python ${CMAKE_SOURCE_DIR}/etc/clang_format.py lint ++# VERBATIM ++#) ++# ++#add_custom_target(docs ++# DEPENDS hugo doxygen-current ++#) ++# ++#set(THIRD_PARTY_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/third_party) + + enable_testing() + + add_subdirectory(src) + +-add_subdirectory(examples EXCLUDE_FROM_ALL) ++#add_subdirectory(examples EXCLUDE_FROM_ALL) +diff --git a/src/bsoncxx/CMakeLists.txt b/src/bsoncxx/CMakeLists.txt +index 010f5e4..a9a7ada 100644 +--- a/src/bsoncxx/CMakeLists.txt ++++ b/src/bsoncxx/CMakeLists.txt +@@ -202,4 +202,4 @@ install( + DESTINATION lib/cmake/libbsoncxx-${BSONCXX_VERSION} + ) + +-add_subdirectory(test) ++#add_subdirectory(test) +diff --git a/src/mongocxx/CMakeLists.txt b/src/mongocxx/CMakeLists.txt +index 12d188b..2ef54e4 100644 +--- a/src/mongocxx/CMakeLists.txt ++++ b/src/mongocxx/CMakeLists.txt +@@ -209,4 +209,4 @@ install( + DESTINATION lib/cmake/libmongocxx-${MONGOCXX_VERSION} + ) + +-add_subdirectory(test) ++#add_subdirectory(test) diff --git a/ports/mongo-cxx-driver/portfile.cmake b/ports/mongo-cxx-driver/portfile.cmake index 2972f1c5b4..f37913cdcf 100644 --- a/ports/mongo-cxx-driver/portfile.cmake +++ b/ports/mongo-cxx-driver/portfile.cmake @@ -1,20 +1,16 @@ -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(STATUS "Warning: Static building not supported yet. Building dynamic.") #Blocked by libbson - set(VCPKG_LIBRARY_LINKAGE dynamic) -endif() include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mongo-cxx-driver-r3.0.2) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mongo-cxx-driver-r3.0.3) vcpkg_download_distfile(ARCHIVE - URLS "https://codeload.github.com/mongodb/mongo-cxx-driver/zip/r3.0.2" - FILENAME "mongo-cxx-driver-r3.0.2.zip" - SHA512 f3f1902df22ad58090ec2d4f22c9746d32b12552934d0eaf686b7e3b2e65ac9eeff9e28944cde75c5f5834735e8b76f879e1ca0e7095195f22e3ce6dd92b4524 + URLS "https://github.com/mongodb/mongo-cxx-driver/archive/r3.0.3.tar.gz" + FILENAME "mongo-cxx-driver-r3.0.3.tar.gz" + SHA512 29f7ae77dab160c4279eb2eba8e960b25afc7118bf82570d240f5c68e1e17b10dc99910c855888467c304d70399f2d02031463b0c168a95ad0b9323742ccfd35 ) vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} - PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch + PATCHES ${CMAKE_CURRENT_LIST_DIR}/disable_test_and_example.patch ) vcpkg_configure_cmake( @@ -22,13 +18,62 @@ vcpkg_configure_cmake( OPTIONS -DLIBBSON_DIR=${CURRENT_INSTALLED_DIR} -DLIBMONGOC_DIR=${CURRENT_INSTALLED_DIR} + -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON ) vcpkg_install_cmake() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(RENAME + ${CURRENT_PACKAGES_DIR}/include/bsoncxx/v_noabi/bsoncxx + ${CURRENT_PACKAGES_DIR}/temp) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/bsoncxx) +file(RENAME ${CURRENT_PACKAGES_DIR}/temp ${CURRENT_PACKAGES_DIR}/include/bsoncxx) -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/mongo-cxx-driver) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/mongo-cxx-driver/LICENSE ${CURRENT_PACKAGES_DIR}/share/mongo-cxx-driver/copyright) \ No newline at end of file +file(RENAME + ${CURRENT_PACKAGES_DIR}/include/mongocxx/v_noabi/mongocxx + ${CURRENT_PACKAGES_DIR}/temp) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/mongocxx) +file(RENAME ${CURRENT_PACKAGES_DIR}/temp ${CURRENT_PACKAGES_DIR}/include/mongocxx) + +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/lib/cmake + ${CURRENT_PACKAGES_DIR}/debug/lib/cmake + + ${CURRENT_PACKAGES_DIR}/include/bsoncxx/cmake + ${CURRENT_PACKAGES_DIR}/include/bsoncxx/config/private + ${CURRENT_PACKAGES_DIR}/include/bsoncxx/private + ${CURRENT_PACKAGES_DIR}/include/bsoncxx/test + ${CURRENT_PACKAGES_DIR}/include/bsoncxx/third_party + + ${CURRENT_PACKAGES_DIR}/include/mongocxx/cmake + ${CURRENT_PACKAGES_DIR}/include/mongocxx/config/private + ${CURRENT_PACKAGES_DIR}/include/mongocxx/test + ${CURRENT_PACKAGES_DIR}/include/mongocxx/test_util + ${CURRENT_PACKAGES_DIR}/include/mongocxx/private + ${CURRENT_PACKAGES_DIR}/include/mongocxx/exception/private + + ${CURRENT_PACKAGES_DIR}/debug/include) + + +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/bsoncxx.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/bsoncxx.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/mongocxx.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/mongocxx.lib) + + file(RENAME + ${CURRENT_PACKAGES_DIR}/lib/libbsoncxx.lib + ${CURRENT_PACKAGES_DIR}/lib/bsoncxx.lib) + file(RENAME + ${CURRENT_PACKAGES_DIR}/debug/lib/libmongocxx.lib + ${CURRENT_PACKAGES_DIR}/debug/lib/mongocxx.lib) +else() + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libbsoncxx.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/libbsoncxx.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libmongocxx.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/libmongocxx.lib) +endif() + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/mongo-cxx-driver RENAME copyright) \ No newline at end of file From 686fef9bfe27665f7427812529bcb4143afa45ff Mon Sep 17 00:00:00 2001 From: sdcb Date: Mon, 21 Nov 2016 18:04:18 +0800 Subject: [PATCH 6/6] [mongo-cxx-driver] there is a failure on link stage, cannot build static, warn and then build dynamic --- ports/mongo-cxx-driver/portfile.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/mongo-cxx-driver/portfile.cmake b/ports/mongo-cxx-driver/portfile.cmake index f37913cdcf..dc6a13caf0 100644 --- a/ports/mongo-cxx-driver/portfile.cmake +++ b/ports/mongo-cxx-driver/portfile.cmake @@ -1,3 +1,8 @@ +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(STATUS "Warning: Static building not supported yet. Building dynamic.") #Blocked by build failure + set(VCPKG_LIBRARY_LINKAGE dynamic) +endif() + include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mongo-cxx-driver-r3.0.3)