[libressl] Fail if openssl is installed (#40924)

This commit is contained in:
Kai Pastor 2024-09-14 00:58:18 +02:00 committed by GitHub
parent 1c9985b48b
commit 86fba13068
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 57 additions and 4 deletions

View File

@ -1,7 +1,5 @@
if(EXISTS "${CURRENT_INSTALLED_DIR}/include/openssl/ssl.h")
message(WARNING "Can't build libressl if openssl is installed. Please remove openssl, and try install libressl again if you need it. Build will continue since libressl is a subset of openssl")
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
return()
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(

View File

@ -1,6 +1,7 @@
{
"name": "libressl",
"version": "3.9.2",
"port-version": 1,
"description": "LibreSSL is a version of the TLS/crypto stack forked from OpenSSL in 2014, with goals of modernizing the codebase, improving security, and applying best practice development processes.",
"license": "ISC",
"dependencies": [

View File

@ -0,0 +1,4 @@
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
vcpkg_cmake_configure(SOURCE_PATH "${CURRENT_PORT_DIR}/project")
vcpkg_cmake_build()

View File

@ -0,0 +1,33 @@
cmake_minimum_required(VERSION 3.7)
project(libressl-test CXX)
# libressl promises openssl compatibility
# NB: The port doesn't provide a wrapper, so there is no support
# for multi-config and for transitive usage requirements.
find_package(OpenSSL MODULE REQUIRED)
foreach(target IN ITEMS OpenSSL::SSL OpenSSL::Crypto)
set(location_found FALSE)
foreach(property IN ITEMS IMPORTED_LOCATION IMPORTED_LOCATION_DEBUG IMPORTED_LOCATION_RELEASE)
get_target_property(location ${target} ${property})
if(NOT location)
continue()
endif()
set(location_found TRUE)
message(STATUS "${target} ${property}: ${location}")
string(FIND "${location}" "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" index)
if(NOT index STREQUAL "0")
message(SEND_ERROR "${target} ${property} is not from vcpkg.")
endif()
endforeach()
if(NOT location_found)
message(SEND_ERROR "No location for ${target} binary")
endif()
endforeach()
# libressl provides cmake config
find_package(LibreSSL CONFIG REQUIRED)
message(STATUS "LibreSSL CONFIG: ${LibreSSL_DIR}")
string(FIND "${LibreSSL_DIR}" "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" index)
if(NOT index STREQUAL "0")
message(SEND_ERROR "LibreSSL CONFIG is not from vcpkg.")
endif()

View File

@ -0,0 +1,12 @@
{
"name": "vcpkg-ci-libressl",
"version-string": "ci",
"description": "Validates libressl",
"dependencies": [
"libressl",
{
"name": "vcpkg-cmake",
"host": true
}
]
}

View File

@ -4986,7 +4986,7 @@
},
"libressl": {
"baseline": "3.9.2",
"port-version": 0
"port-version": 1
},
"librsvg": {
"baseline": "2.40.20",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "f9e56b0af8f93ed5c5adc5e2ba1696e5c16420be",
"version": "3.9.2",
"port-version": 1
},
{
"git-tree": "212859e945d993b860716eaa47b8f83ef52efbb2",
"version": "3.9.2",