From 14da8d976f119dfcab9853755f92f6f388dc808b Mon Sep 17 00:00:00 2001 From: Victor Romero Date: Wed, 13 May 2026 15:55:24 -0700 Subject: [PATCH] [picohttpparser] Add new port, devendor from [cinatra] (#51743) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../fix-picohttpparser-include-guard.patch | 27 +++++++++++++++++++ ports/cinatra/portfile.cmake | 2 ++ ports/cinatra/vcpkg.json | 1 + ports/picohttpparser/CMakeLists.txt | 25 +++++++++++++++++ ports/picohttpparser/portfile.cmake | 27 +++++++++++++++++++ ports/picohttpparser/usage | 4 +++ ports/picohttpparser/vcpkg.json | 17 ++++++++++++ versions/baseline.json | 6 ++++- versions/c-/cinatra.json | 5 ++++ versions/p-/picohttpparser.json | 9 +++++++ 10 files changed, 122 insertions(+), 1 deletion(-) create mode 100644 ports/cinatra/fix-picohttpparser-include-guard.patch create mode 100644 ports/picohttpparser/CMakeLists.txt create mode 100644 ports/picohttpparser/portfile.cmake create mode 100644 ports/picohttpparser/usage create mode 100644 ports/picohttpparser/vcpkg.json create mode 100644 versions/p-/picohttpparser.json diff --git a/ports/cinatra/fix-picohttpparser-include-guard.patch b/ports/cinatra/fix-picohttpparser-include-guard.patch new file mode 100644 index 0000000000..2b5fb1f127 --- /dev/null +++ b/ports/cinatra/fix-picohttpparser-include-guard.patch @@ -0,0 +1,27 @@ +From dfdd983a4daed8a12c0283e579d8d2e31a2504fc Mon Sep 17 00:00:00 2001 +From: vcpkg +Date: Wed, 13 May 2026 15:05:10 -0700 +Subject: [PATCH] Use unique include guard for vendored picohttpparser + +--- + include/cinatra/picohttpparser.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/include/cinatra/picohttpparser.h b/include/cinatra/picohttpparser.h +index 30e3b45..dc26bb4 100644 +--- a/include/cinatra/picohttpparser.h ++++ b/include/cinatra/picohttpparser.h +@@ -24,8 +24,8 @@ + * IN THE SOFTWARE. + */ + +-#ifndef picohttpparser_h +-#define picohttpparser_h ++#ifndef cinatra_picohttpparser_h ++#define cinatra_picohttpparser_h + #include + #include + #include +-- +2.54.0.windows.1 + diff --git a/ports/cinatra/portfile.cmake b/ports/cinatra/portfile.cmake index b2a03bfc4d..8c74c2c683 100644 --- a/ports/cinatra/portfile.cmake +++ b/ports/cinatra/portfile.cmake @@ -5,6 +5,8 @@ vcpkg_from_github( REF ${VERSION} SHA512 dfc58ab01ea962f007e8922a4614b3017f4e6da03d5f79edf3b8ee2750a23803b20fc905ffb1600ee7d2440339b84543c61ddae58e13a587d357db8372baf510 HEAD_REF master + PATCHES + fix-picohttpparser-include-guard.patch ) # Install Cinatra’s headers diff --git a/ports/cinatra/vcpkg.json b/ports/cinatra/vcpkg.json index 3ba1b0ad69..cad9e9d910 100644 --- a/ports/cinatra/vcpkg.json +++ b/ports/cinatra/vcpkg.json @@ -1,6 +1,7 @@ { "name": "cinatra", "version": "1.0.0", + "port-version": 1, "description": "Cinatra is a high performance HTTP framework with modern C++ features.", "homepage": "https://github.com/qicosmos/cinatra", "license": "MIT", diff --git a/ports/picohttpparser/CMakeLists.txt b/ports/picohttpparser/CMakeLists.txt new file mode 100644 index 0000000000..648e68652f --- /dev/null +++ b/ports/picohttpparser/CMakeLists.txt @@ -0,0 +1,25 @@ +cmake_minimum_required(VERSION 3.14) +project(picohttpparser C) + +add_library(picohttpparser picohttpparser.c) + +target_include_directories(picohttpparser + PUBLIC + $ + $ +) + +install(TARGETS picohttpparser + EXPORT unofficial-picohttpparser-config + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) + +install(FILES picohttpparser.h DESTINATION include) + +install(EXPORT unofficial-picohttpparser-config + FILE unofficial-picohttpparser-config.cmake + NAMESPACE unofficial::picohttpparser:: + DESTINATION share/unofficial-picohttpparser +) diff --git a/ports/picohttpparser/portfile.cmake b/ports/picohttpparser/portfile.cmake new file mode 100644 index 0000000000..7cc97f3978 --- /dev/null +++ b/ports/picohttpparser/portfile.cmake @@ -0,0 +1,27 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO h2o/picohttpparser + REF f4d94b48b31e0abae029ebeafcfd9ca0680ede58 + SHA512 7d94d107572c0fcf138636fb0693e87b8302adf08265d6361763384d428f979d9c1f5a627ffa8ad2ee855ec29d3b5c39ee8fba63b5e757830c3bad266940cf54 + HEAD_REF master +) + +file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") + +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +endif() + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" +) + +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-picohttpparser) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/picohttpparser.h") diff --git a/ports/picohttpparser/usage b/ports/picohttpparser/usage new file mode 100644 index 0000000000..124c806b3f --- /dev/null +++ b/ports/picohttpparser/usage @@ -0,0 +1,4 @@ +picohttpparser provides CMake targets: + + find_package(unofficial-picohttpparser CONFIG REQUIRED) + target_link_libraries(main PRIVATE unofficial::picohttpparser::picohttpparser) diff --git a/ports/picohttpparser/vcpkg.json b/ports/picohttpparser/vcpkg.json new file mode 100644 index 0000000000..575d05d88e --- /dev/null +++ b/ports/picohttpparser/vcpkg.json @@ -0,0 +1,17 @@ +{ + "name": "picohttpparser", + "version-date": "2026-04-06", + "description": "Tiny, primitive, fast HTTP request/response parser", + "homepage": "https://github.com/h2o/picohttpparser", + "license": "MIT OR Artistic-2.0", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index b88a32339c..4d93f21ffd 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1746,7 +1746,7 @@ }, "cinatra": { "baseline": "1.0.0", - "port-version": 0 + "port-version": 1 }, "cista": { "baseline": "0.16", @@ -7732,6 +7732,10 @@ "baseline": "2.9.0", "port-version": 0 }, + "picohttpparser": { + "baseline": "2026-04-06", + "port-version": 0 + }, "picojson": { "baseline": "1.3.0", "port-version": 3 diff --git a/versions/c-/cinatra.json b/versions/c-/cinatra.json index fd1822246b..9501ca5158 100644 --- a/versions/c-/cinatra.json +++ b/versions/c-/cinatra.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "89f5d9ea7ec5934de0cc2a2ce16c236988e26450", + "version": "1.0.0", + "port-version": 1 + }, { "git-tree": "69d3ae25fd17ae739b6f5cff68a5a12249090182", "version": "1.0.0", diff --git a/versions/p-/picohttpparser.json b/versions/p-/picohttpparser.json new file mode 100644 index 0000000000..2a88d2e1c1 --- /dev/null +++ b/versions/p-/picohttpparser.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "696c1ab34b006932dbe48891f1d46e64e06bef4d", + "version-date": "2026-04-06", + "port-version": 0 + } + ] +}