From 8346836471a672d536d7a41fd8a0814073c9848f Mon Sep 17 00:00:00 2001 From: Raphael Gozzo Date: Fri, 30 Nov 2018 22:37:54 -0200 Subject: [PATCH] [curl] Build openssl and schannel backends by default (#3932) * [curl] Split the OpenSSL and SChannel backends into separate features * [curl] Add mbedTLS backend as a feature * [curl] Make winssl the default for Windows. Remove need for compatibility workaround. * [curl] Continue to use openssl in UWP because PSecurityFunctionTableA is not available. --- ports/curl/CONTROL | 19 +++++++++++++++---- ports/curl/portfile.cmake | 31 ++++++++++++++++++++----------- 2 files changed, 35 insertions(+), 15 deletions(-) diff --git a/ports/curl/CONTROL b/ports/curl/CONTROL index 95040eba1f2..f76c9912451 100644 --- a/ports/curl/CONTROL +++ b/ports/curl/CONTROL @@ -1,9 +1,8 @@ Source: curl -Version: 7.61.1-1 +Version: 7.61.1-2 Build-Depends: zlib Description: A library for transferring data with URLs Default-Features: ssl -# For WINSSL add set(CURL_USE_WINSSL ON) to your triplet file Feature: tool Description: Builds curl executable @@ -16,9 +15,21 @@ Build-Depends: nghttp2, curl[ssl] Description: HTTP2 support Feature: ssl -Build-Depends: openssl -Description: SSL support +Build-Depends: curl[openssl] (!windows), curl[winssl] (windows) +Description: Default SSL backend Feature: ssh Build-Depends: libssh2, curl[non-http] Description: SSH support via libssh2 + +# SSL backends +Feature: openssl +Build-Depends: openssl +Description: SSL support (OpenSSL) + +Feature: winssl +Description: SSL support (Secure Channel / "WinSSL") + +Feature: mbedtls +Build-Depends: mbedtls +Description: SSL support (mbedTLS) diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index 0b156c4d081..534a54aea00 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -7,15 +7,15 @@ vcpkg_from_github( SHA512 09fa3c87f8d516eabe3241247a5094c32ee0481961cf85bf78ecb13acdf23bb2ec82f113d2660271d22742c79e76d73fb122730fa28e34c7f5477c05a4a6534c HEAD_REF master PATCHES - ${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch - ${CMAKE_CURRENT_LIST_DIR}/0002_fix_uwp.patch - ${CMAKE_CURRENT_LIST_DIR}/0003_fix_libraries.patch - ${CMAKE_CURRENT_LIST_DIR}/0004_nghttp2_staticlib.patch + 0001_cmake.patch + 0002_fix_uwp.patch + 0003_fix_libraries.patch + 0004_nghttp2_staticlib.patch ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" CURL_STATICLIB) -# Support HTTP2 TSL Download https://curl.haxx.se/ca/cacert.pem rename to curl-ca-bundle.crt, copy it to libcurl.dll location. +# Support HTTP2 TLS Download https://curl.haxx.se/ca/cacert.pem rename to curl-ca-bundle.crt, copy it to libcurl.dll location. set(HTTP2_OPTIONS) if("http2" IN_LIST FEATURES) set(HTTP2_OPTIONS -DUSE_NGHTTP2=ON) @@ -23,13 +23,21 @@ endif() # SSL set(USE_OPENSSL OFF) +if("openssl" IN_LIST FEATURES) + set(USE_OPENSSL ON) +endif() + set(USE_WINSSL OFF) -if("ssl" IN_LIST FEATURES) - if(CURL_USE_WINSSL) - set(USE_WINSSL ON) - else() - set(USE_OPENSSL ON) +if("winssl" IN_LIST FEATURES) + if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + message(FATAL_ERROR "winssl is not supported on non-Windows platforms") endif() + set(USE_WINSSL ON) +endif() + +set(USE_MBEDTLS OFF) +if("mbedtls" IN_LIST FEATURES) + set(USE_MBEDTLS ON) endif() # SSH @@ -64,7 +72,7 @@ endif() vcpkg_find_acquire_program(PERL) get_filename_component(PERL_PATH ${PERL} DIRECTORY) -set(ENV{PATH} "$ENV{PATH};${PERL_PATH}") +vcpkg_add_to_path(${PERL_PATH}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} @@ -78,6 +86,7 @@ vcpkg_configure_cmake( -DCURL_STATICLIB=${CURL_STATICLIB} -DCMAKE_USE_OPENSSL=${USE_OPENSSL} -DCMAKE_USE_WINSSL=${USE_WINSSL} + -DCMAKE_USE_MBEDTLS=${USE_MBEDTLS} -DCMAKE_USE_LIBSSH2=${USE_LIBSSH2} -DHTTP_ONLY=${USE_HTTP_ONLY} OPTIONS_RELEASE