diff --git a/ports/cpp-httplib/fix-find-brotli.patch b/ports/cpp-httplib/fix-find-brotli.patch new file mode 100644 index 00000000000..e6471268929 --- /dev/null +++ b/ports/cpp-httplib/fix-find-brotli.patch @@ -0,0 +1,39 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 709390a..3fd83aa 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -127,9 +127,9 @@ endif() + # Adds our cmake folder to the search path for find_package + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + if(HTTPLIB_REQUIRE_BROTLI) +- find_package(Brotli COMPONENTS encoder decoder common REQUIRED) ++ find_package(unofficial-brotli CONFIG REQUIRED) + elseif(HTTPLIB_USE_BROTLI_IF_AVAILABLE) +- find_package(Brotli COMPONENTS encoder decoder common QUIET) ++ find_package(unofficial-brotli CONFIG QUIET) + endif() + # Just setting this variable here for people building in-tree + if(Brotli_FOUND) +@@ -206,9 +206,9 @@ target_link_libraries(${PROJECT_NAME} ${_INTERFACE_OR_PUBLIC} + $<$:crypt32> + $<$:cryptui> + # Can't put multiple targets in a single generator expression or it bugs out. +- $<$:Brotli::common> +- $<$:Brotli::encoder> +- $<$:Brotli::decoder> ++ $<$:unofficial::brotli::brotlicommon> ++ $<$:unofficial::brotli::brotlienc> ++ $<$:unofficial::brotli::brotlidec> + $<$:ZLIB::ZLIB> + $<$:OpenSSL::SSL> + $<$:OpenSSL::Crypto> +@@ -265,9 +265,6 @@ install(FILES "${_httplib_build_includedir}/httplib.h" TYPE INCLUDE) + install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" +- # Install it so it can be used later by the httplibConfig.cmake file. +- # Put it in the same dir as our config file instead of a global path so we don't potentially stomp on other packages. +- "${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindBrotli.cmake" + DESTINATION ${_TARGET_INSTALL_CMAKEDIR} + ) + diff --git a/ports/cpp-httplib/portfile.cmake b/ports/cpp-httplib/portfile.cmake index ceebea35db2..a1fe9c3ed96 100644 --- a/ports/cpp-httplib/portfile.cmake +++ b/ports/cpp-httplib/portfile.cmake @@ -5,9 +5,19 @@ vcpkg_from_github( REF v0.11.3 SHA512 b0c46bf11c8bc84ab52143559ff1c4682b02504921855e5cd7e82bc65a04b192281ef7a124c7c7dfe928ae3842d5065097b6a4608be1c74dc51b563b15b93d0f HEAD_REF master + PATCHES + fix-find-brotli.patch ) -file(COPY "${SOURCE_PATH}/httplib.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include") +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" +) +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup(PACKAGE_NAME httplib CONFIG_PATH lib/cmake/httplib) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib" "${CURRENT_PACKAGES_DIR}/lib") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug") # Handle copyright file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/cpp-httplib/vcpkg.json b/ports/cpp-httplib/vcpkg.json index 1a349c30018..dbd31d85fc2 100644 --- a/ports/cpp-httplib/vcpkg.json +++ b/ports/cpp-httplib/vcpkg.json @@ -1,7 +1,19 @@ { "name": "cpp-httplib", "version": "0.11.3", + "port-version": 1, "description": "A single file C++11 header-only HTTP/HTTPS server and client library", "homepage": "https://github.com/yhirose/cpp-httplib", - "license": "MIT" + "license": "MIT", + "dependencies": [ + "brotli", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] } diff --git a/versions/baseline.json b/versions/baseline.json index e8e48862b8d..f209dfd407a 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1618,7 +1618,7 @@ }, "cpp-httplib": { "baseline": "0.11.3", - "port-version": 0 + "port-version": 1 }, "cpp-ipc": { "baseline": "1.2.0", diff --git a/versions/c-/cpp-httplib.json b/versions/c-/cpp-httplib.json index 8b8125b1c16..7bc87a99924 100644 --- a/versions/c-/cpp-httplib.json +++ b/versions/c-/cpp-httplib.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "d5bea8aab6eaa201dfd01b054327e3c379ab0864", + "version": "0.11.3", + "port-version": 1 + }, { "git-tree": "dc844acd2ec9e3519c5fc73ee5cefc473e912820", "version": "0.11.3",