diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-05-14 23:01:53 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-05-14 23:01:53 -0700 |
| commit | 7d17afb681cca16d5d88c0f20898f2619a2b04b5 (patch) | |
| tree | 559b19b76577331436317eb6a0c72fe1b0d5f252 | |
| parent | 74c2c23c13da7889787cb0c1c0bc857bc6122d9e (diff) | |
| parent | 7759a557cbc798be00cc7e1a792bb055c1af49dc (diff) | |
| download | vcpkg-7d17afb681cca16d5d88c0f20898f2619a2b04b5.tar.gz vcpkg-7d17afb681cca16d5d88c0f20898f2619a2b04b5.zip | |
Merge pull request #1078 from KindDragon/grpc
Grpc 1.3.1
| -rw-r--r-- | ports/c-ares/CONTROL | 4 | ||||
| -rw-r--r-- | ports/c-ares/portfile.cmake | 42 | ||||
| -rw-r--r-- | ports/grpc/CONTROL | 4 | ||||
| -rw-r--r-- | ports/grpc/portfile.cmake | 20 | ||||
| -rw-r--r-- | ports/protobuf/CONTROL | 2 | ||||
| -rw-r--r-- | ports/protobuf/portfile.cmake | 54 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_fixup_cmake_targets.cmake | 47 |
7 files changed, 151 insertions, 22 deletions
diff --git a/ports/c-ares/CONTROL b/ports/c-ares/CONTROL new file mode 100644 index 000000000..977066b4c --- /dev/null +++ b/ports/c-ares/CONTROL @@ -0,0 +1,4 @@ +Source: c-ares +Version: 1.12.1-dev-40eb41f +Description: A C library for asynchronous DNS requests +Build-Depends:
\ No newline at end of file diff --git a/ports/c-ares/portfile.cmake b/ports/c-ares/portfile.cmake new file mode 100644 index 000000000..696bb0fbc --- /dev/null +++ b/ports/c-ares/portfile.cmake @@ -0,0 +1,42 @@ +include(vcpkg_common_functions) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO c-ares/c-ares + REF 40eb41f522eb9a86f9397352f10d1e63c89f2c54 + SHA512 901d7da97098f79d13ae8d72c85936bd15fbd6b65399c247462ad5367ac85ff32c90325998c21364f959e1bde2c8b7dbc9d9d7524ea34e6bc48dfb3854c199e1 + HEAD_REF master +) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(CARES_STATIC ON) + set(CARES_SHARED OFF) +else() + set(CARES_STATIC OFF) + set(CARES_SHARED ON) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DCARES_STATIC=${CARES_STATIC} + -DCARES_SHARED=${CARES_SHARED} +) + +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/c-ares") + +file(GLOB RELEASE_EXE_FILES "${CURRENT_PACKAGES_DIR}/bin/*.exe") +file(REMOVE ${RELEASE_EXE_FILES}) +file(GLOB DEBUG_EXE_FILES "${CURRENT_PACKAGES_DIR}/debug/bin/*.exe") +file(REMOVE ${DEBUG_EXE_FILES}) + +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/c-ares) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/c-ares/LICENSE.md ${CURRENT_PACKAGES_DIR}/share/c-ares/copyright) diff --git a/ports/grpc/CONTROL b/ports/grpc/CONTROL index ee0c257de..3b2df7d1f 100644 --- a/ports/grpc/CONTROL +++ b/ports/grpc/CONTROL @@ -1,4 +1,4 @@ Source: grpc -Version: 1.2.3-1 -Build-Depends: zlib, openssl, protobuf +Version: 1.3.1 +Build-Depends: zlib, openssl, protobuf, c-ares Description: An RPC library and framework
\ No newline at end of file diff --git a/ports/grpc/portfile.cmake b/ports/grpc/portfile.cmake index 80cdd480f..816dff17c 100644 --- a/ports/grpc/portfile.cmake +++ b/ports/grpc/portfile.cmake @@ -2,6 +2,7 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) message(STATUS "Warning: Dynamic building not supported yet. Building static.") set(VCPKG_LIBRARY_LINKAGE static) endif() + include(vcpkg_common_functions) if(EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git") @@ -11,27 +12,42 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO grpc/grpc - REF v1.2.3 - SHA512 51e3c2f866fcac861ca007dd022373e63f82c63754001d1182ea14dd2eff2dfba325f8bc130ddf94e4ae35e23299ca337a6c5c6a9cee145f9e5c79e4c46af280 + REF v1.3.1 + SHA512 1c9f35e84995158b75bb8694bb9d8c5ddafccf347c4827213290b221f9fc3ab9071c9f79a10a563e9cdfabae3f4b83d6148907f106066f54093242f818038438 HEAD_REF master ) +# Issue: https://github.com/grpc/grpc/issues/10759 vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES ${CMAKE_CURRENT_LIST_DIR}/revert-c019e05.patch ) +if(VCPKG_CRT_LINKAGE STREQUAL static) + set(gRPC_MSVC_STATIC_RUNTIME ON) +else() + set(gRPC_MSVC_STATIC_RUNTIME OFF) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS -DgRPC_INSTALL=ON + -DgRPC_BUILD_TESTS=OFF + -DgRPC_MSVC_STATIC_RUNTIME=${gRPC_MSVC_STATIC_RUNTIME} -DgRPC_ZLIB_PROVIDER=package -DgRPC_SSL_PROVIDER=package -DgRPC_PROTOBUF_PROVIDER=package + -DgRPC_CARES_PROVIDER=package + -DgRPC_GFLAGS_PROVIDER=none + -DgRPC_BENCHMARK_PROVIDER=none -DCMAKE_INSTALL_CMAKEDIR=share/grpc ) +# gRPC runs built executables during the build, so they need access to the installed DLLs. +set(ENV{PATH} "$ENV{PATH};${CURRENT_INSTALLED_DIR}/bin;${CURRENT_INSTALLED_DIR}/debug/bin") + vcpkg_install_cmake() vcpkg_fixup_cmake_targets() diff --git a/ports/protobuf/CONTROL b/ports/protobuf/CONTROL index 95e7e367c..757d39d6b 100644 --- a/ports/protobuf/CONTROL +++ b/ports/protobuf/CONTROL @@ -1,4 +1,4 @@ Source: protobuf -Version: 3.2.0 +Version: 3.3.0 Build-Depends: zlib Description: Protocol Buffers - Google's data interchange format
\ No newline at end of file diff --git a/ports/protobuf/portfile.cmake b/ports/protobuf/portfile.cmake index 2d7cecf65..c053e1bb5 100644 --- a/ports/protobuf/portfile.cmake +++ b/ports/protobuf/portfile.cmake @@ -1,23 +1,41 @@ -#tool include(vcpkg_common_functions) + +set(PROTOBUF_VERSION 3.3.0) + vcpkg_download_distfile(ARCHIVE_FILE - URLS "https://github.com/google/protobuf/releases/download/v3.2.0/protobuf-cpp-3.2.0.tar.gz" - FILENAME "protobuf-cpp-3.2.0.tar.gz" - SHA512 dd005f5e862ff24bb233b9eaed1d7f44c42f1cc8c647c0839fe2ecc2d91178845195d79776cfa2e31d224c16eed11b05ad824b66b743e685334057d8180f17aa + URLS "https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/protobuf-cpp-${PROTOBUF_VERSION}.tar.gz" + FILENAME "protobuf-cpp-${PROTOBUF_VERSION}.tar.gz" + SHA512 ef01300bdda4a1a33a6056aea1d55e9d66ab1ca644aa2d9d5633cfc0bccfe4c24fdfa1015889b2c1c568e89ad053c701de1aca45196a6439130b7bb8f461595f ) vcpkg_download_distfile(TOOL_ARCHIVE_FILE - URLS "https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-win32.zip" - FILENAME "protoc-3.2.0-win32.zip" - SHA512 985c86a04cebacfba96f3985d1b3d6ef341470171b809c6f6362bc13a07a3df9c8962d912857bb764bf8634cf676c5f8453c43b4e0a6398f2ff314708975d1e4 + URLS "https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/protoc-${PROTOBUF_VERSION}-win32.zip" + FILENAME "protoc-${PROTOBUF_VERSION}-win32.zip" + SHA512 9b4902b3187fb978a8153aaf050314a3ca9ca161b0712a3672ccdfabb7f5a57035e71c2dfde9a0b99f9417e159dcbdedaf9a2b1917d712dc3d9d554bba0d4ee8 ) + +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/protobuf-${PROTOBUF_VERSION}) +set(TOOL_PATH ${CURRENT_BUILDTREES_DIR}/src/protobuf-${PROTOBUF_VERSION}-win32) + vcpkg_extract_source_archive(${ARCHIVE_FILE}) -vcpkg_extract_source_archive(${TOOL_ARCHIVE_FILE} ${CURRENT_BUILDTREES_DIR}/src/protobuf-3.2.0-win32) +vcpkg_extract_source_archive(${TOOL_ARCHIVE_FILE} ${TOOL_PATH}) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(protobuf_BUILD_SHARED_LIBS ON) +else() + set(protobuf_BUILD_SHARED_LIBS OFF) +endif() + +if(VCPKG_CRT_LINKAGE STREQUAL static) + set(protobuf_MSVC_STATIC_RUNTIME ON) +else() + set(protobuf_MSVC_STATIC_RUNTIME OFF) +endif() vcpkg_configure_cmake( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/protobuf-3.2.0/cmake + SOURCE_PATH ${SOURCE_PATH}/cmake OPTIONS - -Dprotobuf_BUILD_SHARED_LIBS=OFF - -Dprotobuf_MSVC_STATIC_RUNTIME=OFF + -Dprotobuf_BUILD_SHARED_LIBS=${protobuf_BUILD_SHARED_LIBS} + -Dprotobuf_MSVC_STATIC_RUNTIME=${protobuf_MSVC_STATIC_RUNTIME} -Dprotobuf_WITH_ZLIB=ON -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_INSTALL_CMAKEDIR=share/protobuf @@ -49,9 +67,15 @@ string(REPLACE "\${_IMPORT_PREFIX}/debug/bin/protoc.exe" "\${_IMPORT_PREFIX}/too file(WRITE ${CURRENT_PACKAGES_DIR}/share/protobuf/protobuf-targets-debug.cmake "${DEBUG_MODULE}") protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/debug/share) -protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/bin) -protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/debug/bin) -file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/protobuf-3.2.0/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/protobuf RENAME copyright) -file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/protobuf-3.2.0-win32/bin/protoc.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/bin) + protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/debug/bin) +else() + protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/bin/protoc.exe) + protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/debug/bin/protoc.exe) +endif() + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/protobuf RENAME copyright) +file(INSTALL ${TOOL_PATH}/bin/protoc.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools) vcpkg_copy_pdbs() diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index f753f6396..7c1891584 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -7,15 +7,58 @@ # Transform all references matching /bin/*.exe to /tools/<port>/*.exe # # :: -# vcpkg_fixup_cmake_targets() +# vcpkg_fixup_cmake_targets([CONFIG_PATH <config_path>]) +# +# ``CONFIG_PATH`` +# *.cmake files subdirectory (like "lib/cmake/${PORT}"). # function(vcpkg_fixup_cmake_targets) - cmake_parse_arguments(_vfct "" "" "" ${ARGN}) + cmake_parse_arguments(_vfct "" "CONFIG_PATH" "" ${ARGN}) set(DEBUG_SHARE ${CURRENT_PACKAGES_DIR}/debug/share/${PORT}) set(RELEASE_SHARE ${CURRENT_PACKAGES_DIR}/share/${PORT}) + if(NOT ${_vfct_CONFIG_PATH} STREQUAL "") + set(DEBUG_CONFIG ${CURRENT_PACKAGES_DIR}/debug/${_vfct_CONFIG_PATH}) + set(RELEASE_CONFIG ${CURRENT_PACKAGES_DIR}/${_vfct_CONFIG_PATH}) + + if(NOT EXISTS ${DEBUG_CONFIG}) + message(FATAL_ERROR "'${DEBUG_CONFIG}' does not exist.") + endif() + + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/share) + file(RENAME ${DEBUG_CONFIG} ${DEBUG_SHARE}) + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) + file(RENAME ${RELEASE_CONFIG} ${RELEASE_SHARE}) + + get_filename_component(DEBUG_CONFIG_DIR_NAME ${DEBUG_CONFIG} NAME) + string(TOLOWER "${DEBUG_CONFIG_DIR_NAME}" DEBUG_CONFIG_DIR_NAME) + if(${DEBUG_CONFIG_DIR_NAME} STREQUAL "cmake") + file(REMOVE_RECURSE ${DEBUG_CONFIG}) + else() + get_filename_component(DEBUG_CONFIG_PARENT_DIR ${DEBUG_CONFIG} DIRECTORY) + get_filename_component(DEBUG_CONFIG_DIR_NAME ${DEBUG_CONFIG_PARENT_DIR} NAME) + string(TOLOWER "${DEBUG_CONFIG_DIR_NAME}" DEBUG_CONFIG_DIR_NAME) + if(${DEBUG_CONFIG_DIR_NAME} STREQUAL "cmake") + file(REMOVE_RECURSE ${DEBUG_CONFIG_PARENT_DIR}) + endif() + endif() + + get_filename_component(RELEASE_CONFIG_DIR_NAME ${RELEASE_CONFIG} NAME) + string(TOLOWER "${RELEASE_CONFIG_DIR_NAME}" RELEASE_CONFIG_DIR_NAME) + if(${RELEASE_CONFIG_DIR_NAME} STREQUAL "cmake") + file(REMOVE_RECURSE ${RELEASE_CONFIG}) + else() + get_filename_component(RELEASE_CONFIG_PARENT_DIR ${RELEASE_CONFIG} DIRECTORY) + get_filename_component(RELEASE_CONFIG_DIR_NAME ${RELEASE_CONFIG_PARENT_DIR} NAME) + string(TOLOWER "${RELEASE_CONFIG_DIR_NAME}" RELEASE_CONFIG_DIR_NAME) + if(${RELEASE_CONFIG_DIR_NAME} STREQUAL "cmake") + file(REMOVE_RECURSE ${RELEASE_CONFIG_PARENT_DIR}) + endif() + endif() + endif() + if(NOT EXISTS ${DEBUG_SHARE}) message(FATAL_ERROR "'${DEBUG_SHARE}' does not exist.") endif() |
