From b63d35b10ba2cc0b0569c7a18509fb71ff6f6ca5 Mon Sep 17 00:00:00 2001 From: sdcb Date: Mon, 21 Nov 2016 13:51:48 +0800 Subject: [PATCH] [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