From 20c95969d8bc7b4d44d5fbe18e2359cd1fa9894e Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Mon, 23 Dec 2024 17:12:22 +0100 Subject: [PATCH] [ls-qpack] Update, revise (#42767) --- ports/ls-qpack/cmake-config.diff | 44 ++++++++++++++++++++++++++++++++ ports/ls-qpack/emscripten.diff | 21 +++++++++++++++ ports/ls-qpack/mingw.diff | 13 ++++++++++ ports/ls-qpack/pkgconfig.diff | 34 ++++++++++++++++++++++++ ports/ls-qpack/portfile.cmake | 19 +++++--------- ports/ls-qpack/vcpkg.json | 3 +-- versions/baseline.json | 2 +- versions/l-/ls-qpack.json | 5 ++++ 8 files changed, 126 insertions(+), 15 deletions(-) create mode 100644 ports/ls-qpack/cmake-config.diff create mode 100644 ports/ls-qpack/emscripten.diff create mode 100644 ports/ls-qpack/mingw.diff create mode 100644 ports/ls-qpack/pkgconfig.diff diff --git a/ports/ls-qpack/cmake-config.diff b/ports/ls-qpack/cmake-config.diff new file mode 100644 index 0000000000..cecde59574 --- /dev/null +++ b/ports/ls-qpack/cmake-config.diff @@ -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") diff --git a/ports/ls-qpack/emscripten.diff b/ports/ls-qpack/emscripten.diff new file mode 100644 index 0000000000..57ef1a0964 --- /dev/null +++ b/ports/ls-qpack/emscripten.diff @@ -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 + $ + $ +@@ -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() diff --git a/ports/ls-qpack/mingw.diff b/ports/ls-qpack/mingw.diff new file mode 100644 index 0000000000..b356029510 --- /dev/null +++ b/ports/ls-qpack/mingw.diff @@ -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 diff --git a/ports/ls-qpack/pkgconfig.diff b/ports/ls-qpack/pkgconfig.diff new file mode 100644 index 0000000000..7141ad8724 --- /dev/null +++ b/ports/ls-qpack/pkgconfig.diff @@ -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 diff --git a/ports/ls-qpack/portfile.cmake b/ports/ls-qpack/portfile.cmake index c97fda3b4b..2717fd7403 100644 --- a/ports/ls-qpack/portfile.cmake +++ b/ports/ls-qpack/portfile.cmake @@ -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") diff --git a/ports/ls-qpack/vcpkg.json b/ports/ls-qpack/vcpkg.json index eac85cee64..50e5e0c66c 100644 --- a/ports/ls-qpack/vcpkg.json +++ b/ports/ls-qpack/vcpkg.json @@ -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", diff --git a/versions/baseline.json b/versions/baseline.json index bb5554520f..2bdfda2506 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5625,7 +5625,7 @@ "port-version": 1 }, "ls-qpack": { - "baseline": "2.5.5", + "baseline": "2.6.0", "port-version": 0 }, "ltla-aarand": { diff --git a/versions/l-/ls-qpack.json b/versions/l-/ls-qpack.json index 2dbc370576..068c57264c 100644 --- a/versions/l-/ls-qpack.json +++ b/versions/l-/ls-qpack.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "a175da89c13971ab88cd103a62804aa15934ab83", + "version": "2.6.0", + "port-version": 0 + }, { "git-tree": "73e7312699ae28db63ff0171b70283b694c46bd7", "version": "2.5.5",