vcpkg/ports/openssl/portfile.cmake
Billy O'Neal 09adfdc8cd
[OpenSSL] Update to 3.0.7. (#27594)
* [OpenSSL] Update to 3.0.7.

Fixes critical security vulnerability https://twitter.com/iamamoose/status/1584908434855628800

flags.patch part already applied by upstream removed.

Download location changed to openssl.org while a github tag is still missing.

* Revert unintentional boringssl change.

* Add vcpkg_minimum_required and switch back to GitHub now that a tag is available.
2022-11-01 18:58:59 -07:00

43 lines
1.8 KiB
CMake

vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION}
if(EXISTS "${CURRENT_INSTALLED_DIR}/share/libressl/copyright"
OR EXISTS "${CURRENT_INSTALLED_DIR}/share/boringssl/copyright")
message(FATAL_ERROR "Can't build openssl if libressl/boringssl is installed. Please remove libressl/boringssl, and try install openssl again if you need it.")
endif()
if (VCPKG_TARGET_IS_LINUX)
message(WARNING
[[openssl currently requires the following library from the system package manager:
linux-headers
It can be installed on alpine systems via apk add linux-headers.]]
)
endif()
if (VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_UWP)
set(OPENSSL_PATCHES "${CMAKE_CURRENT_LIST_DIR}/windows/flags.patch")
endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO openssl/openssl
REF openssl-${VERSION}
SHA512 27dd3ef0c1827a74ec880d20232acb818c7d05e004ad7389c355e200a01e899f1b1ba5c34dcce44ecf7c8767c5e1bfbb2c795e3fa5461346087e7e3b95c8a51f
PATCHES ${OPENSSL_PATCHES}
)
vcpkg_find_acquire_program(PERL)
get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY)
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()
configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")