Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[liblsquic] Add new port #24310

Merged
merged 4 commits into from
Jul 13, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions ports/liblsquic/disable-asan.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 65c4776..5d4086a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -60,12 +60,12 @@ ENDIF()

IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} -O0 -g3")
- IF(CMAKE_C_COMPILER MATCHES "clang" AND
- NOT "$ENV{TRAVIS}" MATCHES "^true$" AND
- NOT "$ENV{EXTRA_CFLAGS}" MATCHES "-fsanitize")
- SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} -fsanitize=address")
- SET(LIBS ${LIBS} -fsanitize=address)
- ENDIF()
+ # IF(CMAKE_C_COMPILER MATCHES "clang" AND
+ # NOT "$ENV{TRAVIS}" MATCHES "^true$" AND
+ # NOT "$ENV{EXTRA_CFLAGS}" MATCHES "-fsanitize")
+ # SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} -fsanitize=address")
+ # SET(LIBS ${LIBS} -fsanitize=address)
+ # ENDIF()
# Uncomment to enable cleartext protocol mode (no crypto):
#SET (MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} -DLSQUIC_ENABLE_HANDSHAKE_DISABLE=1")
ELSE()
76 changes: 76 additions & 0 deletions ports/liblsquic/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
if(WIN32)
# The lib uses CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS, at least until
# https://github.com/litespeedtech/lsquic/pull/371 or similar is merged
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
endif()

vcpkg_from_github(OUT_SOURCE_PATH SOURCE_PATH
REPO litespeedtech/lsquic
REF v3.1.1
SHA512 b4675be355703fea12f4b7d24812b93e739b2dbef04e3d8108b6fbe45dd16c129c9e04e58cdcfdf2a4448ee2edea68565dbd2445a76515bbdc8d9980f4210bee
HEAD_REF master
PATCHES disable-asan.patch)

# Submodules
vcpkg_from_github(OUT_SOURCE_PATH LSQPACK_SOURCE_PATH
REPO litespeedtech/ls-qpack
REF v2.3.0
HEAD_REF master
SHA512 7f5a9dd15bcd32c1bfafbecc5cea4da30f50a852c02d2bd140a2baaafd80ccb822c1701b0d20699af6367e9c712f4fe019741507c44156e9897d25162de0b8b4
)
if(NOT EXISTS "${SOURCE_PATH}/src/ls-hpack/CMakeLists.txt")
file(REMOVE_RECURSE "${SOURCE_PATH}/src/liblsquic/ls-qpack")
file(RENAME "${LSQPACK_SOURCE_PATH}" "${SOURCE_PATH}/src/liblsquic/ls-qpack")
endif()

vcpkg_from_github(OUT_SOURCE_PATH LSHPACK_SOURCE_PATH
REPO litespeedtech/ls-hpack
REF v2.3.0
HEAD_REF master
SHA512 45866b18042125cbbd008eed2935a938a42e1682030aa52ff4a324ddbad7bf9bd483161352cc8988bae668e132ee8b4b043ddc09d9e0316a66aaefd927ae2d76
)
if(NOT EXISTS "${SOURCE_PATH}/src/lshpack/CMakeLists.txt")
file(REMOVE_RECURSE "${SOURCE_PATH}/src/lshpack")
file(RENAME "${LSHPACK_SOURCE_PATH}" "${SOURCE_PATH}/src/lshpack")
endif()

# Configuration
vcpkg_find_acquire_program(PERL)
rpavlik marked this conversation as resolved.
Show resolved Hide resolved

string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" LSQUIC_SHARED_LIB)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
"-DPERL=${PERL}"
rpavlik marked this conversation as resolved.
Show resolved Hide resolved
"-DPERL_EXECUTABLE=${PERL}"
"-DLSQUIC_SHARED_LIB=${LSQUIC_SHARED_LIB}"
"-DBORINGSSL_INCLUDE=${CURRENT_INSTALLED_DIR}/include"
-DLSQUIC_BIN=OFF
-DLSQUIC_TESTS=OFF
OPTIONS_RELEASE
"-DBORINGSSL_LIB=${CURRENT_INSTALLED_DIR}/lib"
OPTIONS_DEBUG
"-DBORINGSSL_LIB=${CURRENT_INSTALLED_DIR}/debug/lib"
-DLSQUIC_DEVEL=ON
)

vcpkg_cmake_install()
if(VCPKG_TARGET_IS_WINDOWS)
# Upstream removed installation of this header after merging changes
file(INSTALL "${SOURCE_PATH}/wincompat/vc_compat.h" DESTINATION "${CURRENT_INSTALLED_DIR}/include/lsquic")
endif()

vcpkg_cmake_config_fixup(PACKAGE_NAME lsquic)

# Concatenate license files and install
vicroms marked this conversation as resolved.
Show resolved Hide resolved
file(READ "${SOURCE_PATH}/LICENSE" LICENSE)
file(WRITE "${CURRENT_BUILDTREES_DIR}/copyright" "${LICENSE}")
file(READ "${SOURCE_PATH}/LICENSE.chrome" LICENSE_CHROME)
file(APPEND "${CURRENT_BUILDTREES_DIR}/copyright" "${LICENSE_CHROME}")

file(INSTALL "${CURRENT_BUILDTREES_DIR}/copyright" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")

# Remove duplicated include directory
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

24 changes: 24 additions & 0 deletions ports/liblsquic/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "liblsquic",
"version": "3.1.1",
"description": "An implementation of the QUIC and HTTP/3 protocols.",
"homepage": "https://github.com/litespeedtech/lsquic",
"license": "MIT AND BSD-3-Clause",
"supports": "!x86",
"dependencies": [
"boringssl",
rpavlik marked this conversation as resolved.
Show resolved Hide resolved
{
"name": "getopt",
"platform": "windows"
},
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
"zlib"
]
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -3780,6 +3780,10 @@
"baseline": "1.16.0",
"port-version": 0
},
"liblsquic": {
"baseline": "3.1.1",
"port-version": 0
},
"liblzma": {
"baseline": "5.2.5",
"port-version": 6
Expand Down
9 changes: 9 additions & 0 deletions versions/l-/liblsquic.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "132c01233d5cc2f1768f383e789496a141f14044",
"version": "3.1.1",
"port-version": 0
}
]
}