[ls-qpack] Update, revise (#42767)

This commit is contained in:
Kai Pastor 2024-12-23 17:12:22 +01:00 committed by GitHub
parent 16a03c88aa
commit 20c95969d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 126 additions and 15 deletions

View File

@ -0,0 +1,44 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 86510b3..acca8be 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -36,10 +36,9 @@ if(LSQPACK_XXH)
target_sources(ls-qpack PRIVATE deps/xxhash/xxhash.c)
set(LSQPACK_DEPENDS "")
else()
- find_package(PkgConfig REQUIRED)
- pkg_check_modules(XXH REQUIRED IMPORTED_TARGET libxxhash)
- target_link_libraries(ls-qpack PUBLIC PkgConfig::XXH)
- set(LSQPACK_DEPENDS "libxxhash")
+ find_package(xxHash CONFIG REQUIRED)
+ target_link_libraries(ls-qpack PRIVATE xxHash::xxhash)
+ set(LSQPACK_DEPENDS "libxxhash")
endif()
if(WIN32)
@@ -125,10 +124,14 @@ endif()
include(GNUInstallDirs)
configure_file(lsqpack.pc.in lsqpack.pc @ONLY)
+configure_file(ls-qpack-config.cmake.in ls-qpack-config.cmake @ONLY)
install(TARGETS ls-qpack EXPORT ls-qpack-config
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ls-qpack-config.cmake"
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ls-qpack)
install(
EXPORT ls-qpack-config
+ FILE ls-qpack-targets.cmake
NAMESPACE ls-qpack::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ls-qpack
)
diff --git a/ls-qpack-config.cmake.in b/ls-qpack-config.cmake.in
new file mode 100644
index 0000000..533e076
--- /dev/null
+++ b/ls-qpack-config.cmake.in
@@ -0,0 +1,5 @@
+if(NOT "@BUILD_SHARED_LIBS@" AND NOT "@LSQPACK_XXH@")
+ include(CMakeFindDependencyMacro)
+ find_dependency(xxHash CONFIG)
+endif()
+include("${CMAKE_CURRENT_LIST_DIR}/ls-qpack-targets.cmake")

View File

@ -0,0 +1,21 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bcb58e3..320144b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -41,7 +41,7 @@ else()
set(LSQPACK_DEPENDS "libxxhash")
endif()
-if(WIN32)
+if(WIN32 OR EMSCRIPTEN)
target_include_directories(ls-qpack PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/wincompat>
$<INSTALL_INTERFACE:include>
@@ -149,6 +149,6 @@ if(LSQPACK_BIN)
DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
-if(WIN32)
+if(WIN32 OR EMSCRIPTEN)
install(DIRECTORY wincompat/sys DESTINATION include)
endif()

13
ports/ls-qpack/mingw.diff Normal file
View File

@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1369bd1..bcb58e3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -48,7 +48,7 @@ if(WIN32)
)
endif()
-if(WIN32)
+if(MSVC)
target_compile_options(ls-qpack PRIVATE
/Wall
/wd4100 # unreffed parameter

View File

@ -0,0 +1,34 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 32eed1c..1369bd1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -123,6 +123,8 @@ endif()
include(GNUInstallDirs)
configure_file(lsqpack.pc.in lsqpack.pc @ONLY)
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/lsqpack.pc"
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
configure_file(ls-qpack-config.cmake.in ls-qpack-config.cmake @ONLY)
install(TARGETS ls-qpack EXPORT ls-qpack-config
@@ -149,7 +151,4 @@ endif()
if(WIN32)
install(DIRECTORY wincompat/sys DESTINATION include)
-else()
- install(FILES "${CMAKE_CURRENT_BINARY_DIR}/lsqpack.pc"
- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
endif()
diff --git a/lsqpack.pc.in b/lsqpack.pc.in
index 7eac772..7c65072 100644
--- a/lsqpack.pc.in
+++ b/lsqpack.pc.in
@@ -7,6 +7,6 @@ Name: @PROJECT_NAME@
Description: @CMAKE_PROJECT_DESCRIPTION@
URL: @CMAKE_PROJECT_HOMEPAGE_URL@
Version: @PROJECT_VERSION@
-Requires: @LSQPACK_DEPENDS@
+Requires.private: @LSQPACK_DEPENDS@
Cflags: -I"${includedir}"
-Libs: -L"${libdir}" -llsqpack
+Libs: -L"${libdir}" -lls-qpack

View File

@ -6,16 +6,19 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO litespeedtech/ls-qpack
REF "v${VERSION}"
SHA512 74d4b2ea96bf0de43009cc121c8e57caff83be53c613236b01dce4ac4c12505d0d9fec07d9152ca62166947a160de2ab3f7bf19fb203a60b44507516a927ecb8
SHA512 951056564be6f2a2562001ad1a83731df41a1c8b8d91bf44e138c962befe2af1919daf0d94b57b05b49bb83656334c00ed2c642d81075f1e0cece1a46b31006b
HEAD_REF master
PATCHES
cmake-config.diff
pkgconfig.diff
mingw.diff
emscripten.diff
)
vcpkg_find_acquire_program(PKGCONFIG)
file(REMOVE_RECURSE "${SOURCE_PATH}/deps")
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
"-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}"
-DLSQPACK_TESTS=OFF
-DLSQPACK_BIN=OFF
-DLSQPACK_XXH=OFF
@ -31,12 +34,4 @@ file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/share"
)
file(READ "${CURRENT_PACKAGES_DIR}/share/ls-qpack/ls-qpack-config.cmake" cmake_config)
file(WRITE "${CURRENT_PACKAGES_DIR}/share/ls-qpack/ls-qpack-config.cmake"
"include(CMakeFindDependencyMacro)
find_dependency(PkgConfig)
pkg_check_modules(XXH REQUIRED IMPORTED_TARGET libxxhash)
${cmake_config}
")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

View File

@ -1,10 +1,9 @@
{
"name": "ls-qpack",
"version": "2.5.5",
"version": "2.6.0",
"description": "QPACK compression library for use with HTTP/3",
"homepage": "https://github.com/litespeedtech/ls-qpack",
"license": "MIT",
"supports": "!uwp",
"dependencies": [
{
"name": "vcpkg-cmake",

View File

@ -5625,7 +5625,7 @@
"port-version": 1
},
"ls-qpack": {
"baseline": "2.5.5",
"baseline": "2.6.0",
"port-version": 0
},
"ltla-aarand": {

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "a175da89c13971ab88cd103a62804aa15934ab83",
"version": "2.6.0",
"port-version": 0
},
{
"git-tree": "73e7312699ae28db63ff0171b70283b694c46bd7",
"version": "2.5.5",