Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions ports/openssl/install-pc-files.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
function(install_pc_file name pc_data)
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
configure_file("${CMAKE_CURRENT_LIST_DIR}/openssl.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/${name}.pc" @ONLY)
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
configure_file("${CMAKE_CURRENT_LIST_DIR}/openssl.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/${name}.pc" @ONLY)
endif()
endfunction()

install_pc_file(openssl [[
Name: OpenSSL
Description: Secure Sockets Layer and cryptography libraries and tools
Requires: libssl libcrypto
]])

install_pc_file(libssl [[
Name: OpenSSL-libssl
Description: Secure Sockets Layer and cryptography libraries
Libs: -L"${libdir}" -llibssl
Requires: libcrypto
Cflags: -I"${includedir}"
]])

install_pc_file(libcrypto [[
Name: OpenSSL-libcrypto
Description: OpenSSL cryptography library
Libs: -L"${libdir}" -llibcrypto
Libs.private: -lcrypt32 -lws2_32
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't MinGW need these too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mingw already gets pc files, as it is using the unix branch of the port. libcrypto.pc for mingw-dynamic has:

Libs.private: -lws2_32 -lgdi32 -lcrypt32

But my change for windows is based on consuming ports.

Cflags: -I"${includedir}"
]])

vcpkg_fixup_pkgconfig()
6 changes: 6 additions & 0 deletions ports/openssl/openssl.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
prefix=${pcfiledir}/../..
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Version: @OPENSSL_VERSION@
@pc_data@
2 changes: 2 additions & 0 deletions ports/openssl/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ vcpkg_add_to_path("${PERL_EXE_PATH}")

if(VCPKG_TARGET_IS_UWP)
include("${CMAKE_CURRENT_LIST_DIR}/uwp/portfile.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/install-pc-files.cmake")
elseif(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
include("${CMAKE_CURRENT_LIST_DIR}/windows/portfile.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/install-pc-files.cmake")
else()
include("${CMAKE_CURRENT_LIST_DIR}/unix/portfile.cmake")
endif()
Expand Down
1 change: 1 addition & 0 deletions ports/openssl/unix/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ else()
set(SHARED no-shared)
set(LIB_EXTS a)
endif()
set(INSTALL_PKG_CONFIGS "${BUILDDIR}/openssl.pc")
foreach(lib ssl crypto)
foreach(ext ${LIB_EXTS})
list(APPEND INSTALL_LIBS "${BUILDDIR}/lib${lib}.${ext}")
Expand Down
6 changes: 3 additions & 3 deletions ports/openssl/vcpkg-cmake-wrapper.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ set(OPENSSL_ROOT_DIR ${OPENSSL_ROOT_DIR_BAK})

if(OPENSSL_FOUND AND "@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static")
if(WIN32)
list(APPEND OPENSSL_LIBRARIES Crypt32.lib ws2_32.lib)
list(APPEND OPENSSL_LIBRARIES crypt32 ws2_32)
if(TARGET OpenSSL::Crypto)
set_property(TARGET OpenSSL::Crypto APPEND PROPERTY INTERFACE_LINK_LIBRARIES "Crypt32.lib;ws2_32.lib")
set_property(TARGET OpenSSL::Crypto APPEND PROPERTY INTERFACE_LINK_LIBRARIES "crypt32;ws2_32")
endif()
if(TARGET OpenSSL::SSL)
set_property(TARGET OpenSSL::SSL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "Crypt32.lib;ws2_32.lib")
set_property(TARGET OpenSSL::SSL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "crypt32;ws2_32")
endif()
else()
cmake_policy(PUSH)
Expand Down
2 changes: 1 addition & 1 deletion ports/openssl/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "openssl",
"version-string": "1.1.1l",
"port-version": 2,
"port-version": 3,
"description": "OpenSSL is an open source project that provides a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library.",
"homepage": "https://www.openssl.org"
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4906,7 +4906,7 @@
},
"openssl": {
"baseline": "1.1.1l",
"port-version": 2
"port-version": 3
},
"openssl-unix": {
"baseline": "1.1.1h",
Expand Down
5 changes: 5 additions & 0 deletions versions/o-/openssl.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "83369bdefab234d8570ac2c0f3b616b0c4ab6cdf",
"version-string": "1.1.1l",
"port-version": 3
},
{
"git-tree": "d5310e60291032390ab8c893794f6044a7b9ae04",
"version-string": "1.1.1l",
Expand Down