Skip to content

Commit

Permalink
ngtcp2.sh: replace local build hack with upstream curl patch [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
vszakats committed Jul 14, 2022
1 parent 40470bb commit b4d886e
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 8 deletions.
47 changes: 47 additions & 0 deletions curl.patch
Expand Up @@ -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.
8 changes: 0 additions & 8 deletions ngtcp2.sh
Expand Up @@ -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}"
)

0 comments on commit b4d886e

Please sign in to comment.