aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwangli28 <47812810+wangli28@users.noreply.github.com>2019-07-19 04:54:45 +0800
committerPhil Christensen <philc@microsoft.com>2019-07-18 13:54:45 -0700
commit505eae9f6a2e63fb89f3c858a223fec095f01d57 (patch)
tree9b6d0aab1cf1d63adcf85647a18ffce78cb187e5
parentef48500ac6ec3f9e0f494329365452d3ad9e1271 (diff)
downloadvcpkg-505eae9f6a2e63fb89f3c858a223fec095f01d57.tar.gz
vcpkg-505eae9f6a2e63fb89f3c858a223fec095f01d57.zip
[restbed] Add openssl feature (#7232)
-rw-r--r--ports/restbed/CONTROL8
-rw-r--r--ports/restbed/add_openssl_support.patch37
-rw-r--r--ports/restbed/portfile.cmake11
3 files changed, 53 insertions, 3 deletions
diff --git a/ports/restbed/CONTROL b/ports/restbed/CONTROL
index d0eab13ce..53f6ea0de 100644
--- a/ports/restbed/CONTROL
+++ b/ports/restbed/CONTROL
@@ -1,4 +1,8 @@
Source: restbed
-Version: 4.16-07-28-2018
+Version: 4.16-07-28-2018-1
Description: Corvusoft's Restbed framework brings asynchronous RESTful functionality to C++11 applications.
-Build-Depends: asio \ No newline at end of file
+Build-Depends: asio
+
+Feature: openssl
+Build-Depends: openssl
+Description: Secure over the wire communication allowing you to transmit private data online. \ No newline at end of file
diff --git a/ports/restbed/add_openssl_support.patch b/ports/restbed/add_openssl_support.patch
new file mode 100644
index 000000000..72d4dc406
--- /dev/null
+++ b/ports/restbed/add_openssl_support.patch
@@ -0,0 +1,37 @@
+diff --git a/cmake/Findopenssl.cmake b/cmake/Findopenssl.cmake
+index 8db9799..626ff55 100644
+--- a/cmake/Findopenssl.cmake
++++ b/cmake/Findopenssl.cmake
+@@ -1,24 +1,7 @@
+-find_library( ssl_LIBRARY_STATIC libssl.a ssleay32.lib HINTS "${PROJECT_SOURCE_DIR}/dependency/openssl/out32dll" "${PROJECT_SOURCE_DIR}/dependency/openssl" "/usr/local/opt/openssl/lib" "/usr/lib" "/usr/local/lib" "/opt/local/lib" )
+-find_library( crypto_LIBRARY_STATIC libcrypto.a libeay32.lib HINTS "${PROJECT_SOURCE_DIR}/dependency/openssl/out32dll" "${PROJECT_SOURCE_DIR}/dependency/openssl" "/usr/local/opt/openssl/lib" "/usr/lib" "/usr/local/lib" "/opt/local/lib" )
+-
+-find_library( ssl_LIBRARY_SHARED libssl.so libssl.dylib ssleay32.dll HINTS "${PROJECT_SOURCE_DIR}/dependency/openssl/out32dll" "${PROJECT_SOURCE_DIR}/dependency/openssl" "/usr/local/opt/openssl/lib" "/usr/lib" "/usr/local/lib" "/opt/local/lib" )
+-find_library( crypto_LIBRARY_SHARED libcrypto.so libcrypto.dylib libeay32.dll HINTS "${PROJECT_SOURCE_DIR}/dependency/openssl/out32dll" "${PROJECT_SOURCE_DIR}/dependency/openssl" "/usr/local/opt/openssl/lib" "/usr/lib" "/usr/local/lib" "/opt/local/lib" )
+-
+-find_path( ssl_INCLUDE openssl/ssl.h HINTS "${PROJECT_SOURCE_DIR}/dependency/openssl/inc32" "${PROJECT_SOURCE_DIR}/dependency/openssl/include" "/usr/local/opt/openssl/include" "/usr/include" "/usr/local/include" "/opt/local/include" )
+-
+-if ( ssl_LIBRARY_STATIC AND ssl_LIBRARY_SHARED AND crypto_LIBRARY_STATIC AND crypto_LIBRARY_SHARED )
+- set( OPENSSL_FOUND TRUE )
+- add_definitions( -DBUILD_SSL=TRUE )
+-
+- if ( APPLE AND BUILD_SSL )
+- set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations" )
+- endif( )
+-
+- message( STATUS "Found OpenSSL include at: ${ssl_INCLUDE}" )
+- message( STATUS "Found OpenSSL library at: ${ssl_LIBRARY_STATIC}" )
+- message( STATUS "Found OpenSSL library at: ${ssl_LIBRARY_SHARED}" )
+- message( STATUS "Found Crypto library at: ${crypto_LIBRARY_STATIC}" )
+- message( STATUS "Found Crypto library at: ${crypto_LIBRARY_SHARED}" )
+-else ( )
+- message( FATAL_ERROR "Failed to locate OpenSSL dependency. see restbed/dependency/openssl; ./config shared; make all" )
+-endif ( )
++if (BUILD_SSL)
++ set( OPENSSL_FOUND TRUE )
++ add_definitions( -DBUILD_SSL=TRUE )
++ if ( APPLE AND BUILD_SSL )
++ set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations" )
++ endif( )
++endif()
+\ No newline at end of file
diff --git a/ports/restbed/portfile.cmake b/ports/restbed/portfile.cmake
index 60f1247d8..7b4a2d944 100644
--- a/ports/restbed/portfile.cmake
+++ b/ports/restbed/portfile.cmake
@@ -11,11 +11,20 @@ vcpkg_from_github(
PATCHES cmake.patch
)
+set(USE_OPENSSL OFF)
+if("openssl" IN_LIST FEATURES)
+ vcpkg_apply_patches(
+ SOURCE_PATH ${SOURCE_PATH}
+ PATCHES add_openssl_support.patch
+ )
+ set(USE_OPENSSL ON)
+endif()
+
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
- -DBUILD_SSL=OFF
+ -DBUILD_SSL=${USE_OPENSSL}
-DDISABLE_TESTS=ON
)