vcpkg/ports/libressl/portfile.cmake
2024-11-15 15:13:13 -08:00

63 lines
2.2 KiB
CMake

if(EXISTS "${CURRENT_INSTALLED_DIR}/include/openssl/ssl.h")
message(FATAL_ERROR "Can't build libressl if openssl is installed. Please remove openssl, and try install libressl again if you need it.")
endif()
vcpkg_download_distfile(
LIBRESSL_SOURCE_ARCHIVE
URLS "https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/${PORT}-${VERSION}.tar.gz"
"https://github.com/libressl/portable/releases/download/v{VERSION}/${PORT}-${VERSION}.tar.gz"
FILENAME "${PORT}-${VERSION}.tar.gz"
SHA512 b5ec6d1f4e3842ecb487f9a67d86db658d05cbe8cd3fcba61172affa8c65c5d0823aa244065a7233f06c669d04a5a36517c02a2d99d2f2da3c4df729ac243b37
)
vcpkg_download_distfile(WARNINGS_REMOVAL_PATCH
URLS https://github.com/libressl/portable/commit/1996dbc07d129cf2b1d32be384a131b9e6fa5373.diff?full_index=1
FILENAME Disable-additional-MSVC-warnings.patch
SHA512 8e32bd2b14c84a9e7106d5bc0ffc9f6bea712db2087c7b944e9b41a3a6cca0b09adcee2cff9bfd136060d539a34f7dc7d9283ec1c058028cc15410475790f4b6
)
vcpkg_extract_source_archive(
SOURCE_PATH
ARCHIVE "${LIBRESSL_SOURCE_ARCHIVE}"
PATCHES
pkgconfig.diff
${WARNINGS_REMOVAL_PATCH}
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
"tools" LIBRESSL_APPS
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
-DLIBRESSL_INSTALL_CMAKEDIR=share/${PORT}
-DLIBRESSL_TESTS=OFF
OPTIONS_DEBUG
-DLIBRESSL_APPS=OFF
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_fixup_pkgconfig()
vcpkg_cmake_config_fixup()
# libressl as openssl replacement
configure_file("${CURRENT_PORT_DIR}/vcpkg-cmake-wrapper.cmake.in" "${CURRENT_PACKAGES_DIR}/share/openssl/vcpkg-cmake-wrapper.cmake" @ONLY)
if("tools" IN_LIST FEATURES)
vcpkg_copy_tools(TOOL_NAMES ocspcheck openssl DESTINATION "${CURRENT_PACKAGES_DIR}/tools/openssl" AUTO_CLEAN)
endif()
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/etc/ssl/certs"
"${CURRENT_PACKAGES_DIR}/debug/etc/ssl/certs"
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
"${CURRENT_PACKAGES_DIR}/share/man"
)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")