From b4d886e38dec20f2363ab771b08a0e23083a6edd Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 14 Jul 2022 04:37:02 +0000 Subject: [PATCH] ngtcp2.sh: replace local build hack with upstream curl patch [ci skip] Ref: https://github.com/curl/curl/commit/7f8b36b074b953ecf133b64c63caaaaf8017739a Ref: https://github.com/curl/curl/pull/9065 --- curl.patch | 47 +++++++++++++++++++++++++++++++++++++++++++++++ ngtcp2.sh | 8 -------- 2 files changed, 47 insertions(+), 8 deletions(-) diff --git a/curl.patch b/curl.patch index faf34d48f..1e2c1cfbf 100644 --- a/curl.patch +++ b/curl.patch @@ -345,3 +345,50 @@ index 932515667f916..25e81cf190061 100644 /* Name of package */ #define PACKAGE "curl" +diff --git a/CMake/FindNGTCP2.cmake b/CMake/FindNGTCP2.cmake +index 37b060ea0..61e54c2d6 100644 +--- a/CMake/FindNGTCP2.cmake ++++ b/CMake/FindNGTCP2.cmake +@@ -71,7 +71,7 @@ endif() + if(NGTCP2_FIND_COMPONENTS) + set(NGTCP2_CRYPTO_BACKEND "") + foreach(component IN LISTS NGTCP2_FIND_COMPONENTS) +- if(component MATCHES "^(OpenSSL|GnuTLS)") ++ if(component MATCHES "^(BoringSSL|OpenSSL|GnuTLS)") + if(NGTCP2_CRYPTO_BACKEND) + message(FATAL_ERROR "NGTCP2: Only one crypto library can be selected") + endif() +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5350e8798..5ecb944c7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -451,6 +451,7 @@ if(CURL_USE_OPENSSL) + check_symbol_exists(RAND_status "${CURL_INCLUDES}" HAVE_RAND_STATUS) + check_symbol_exists(RAND_screen "${CURL_INCLUDES}" HAVE_RAND_SCREEN) + check_symbol_exists(RAND_egd "${CURL_INCLUDES}" HAVE_RAND_EGD) ++ check_symbol_exists(OPENSSL_IS_BORINGSSL "openssl/base.h" HAVE_BORINGSSL) + + add_definitions(-DOPENSSL_SUPPRESS_DEPRECATED) + endif() +@@ -506,7 +507,7 @@ function(CheckQuicSupportInOpenSSL) + set(CMAKE_REQUIRED_LIBRARIES "${OPENSSL_LIBRARIES}") + check_symbol_exists(SSL_CTX_set_quic_method "openssl/ssl.h" HAVE_SSL_CTX_SET_QUIC_METHOD) + if(NOT HAVE_SSL_CTX_SET_QUIC_METHOD) +- message(FATAL_ERROR "QUIC support is missing in OpenSSL/boringssl. Try setting -DOPENSSL_ROOT_DIR") ++ message(FATAL_ERROR "QUIC support is missing in OpenSSL/BoringSSL. Try setting -DOPENSSL_ROOT_DIR") + endif() + cmake_pop_check_state() + endfunction() +@@ -514,7 +515,11 @@ endfunction() + option(USE_NGTCP2 "Use ngtcp2 and nghttp3 libraries for HTTP/3 support" OFF) + if(USE_NGTCP2) + if(USE_OPENSSL) +- find_package(NGTCP2 REQUIRED OpenSSL) ++ if(HAVE_BORINGSSL) ++ find_package(NGTCP2 REQUIRED BoringSSL) ++ else() ++ find_package(NGTCP2 REQUIRED OpenSSL) ++ endif() + CheckQuicSupportInOpenSSL() + elseif(USE_GNUTLS) + # TODO add GnuTLS support as vtls library. diff --git a/ngtcp2.sh b/ngtcp2.sh index 802489ffc..9a460865c 100755 --- a/ngtcp2.sh +++ b/ngtcp2.sh @@ -81,13 +81,5 @@ _VER="$1" cp -f -p COPYING "${_DST}/COPYING.txt" cp -f -p README.rst "${_DST}/" - # curl-cmake recognizes BoringSSL as OpenSSL. Make sure it finds this - # crypto library as well: - if [ -d ../boringssl ]; then - cp -p \ - "${_pkg}"/lib/libngtcp2_crypto_boringssl.a \ - "${_pkg}"/lib/libngtcp2_crypto_openssl.a # FIXME - fi - ../_pkg.sh "$(pwd)/${_ref}" )