diff --git a/ports/cpr/001-cpr-config.patch b/ports/cpr/001-cpr-config.patch index 9b9b11352d5372..ab4fdfaa16fdeb 100644 --- a/ports/cpr/001-cpr-config.patch +++ b/ports/cpr/001-cpr-config.patch @@ -1,14 +1,28 @@ diff --git a/cpr/CMakeLists.txt b/cpr/CMakeLists.txt -index a6db5bd..90bec48 100644 +index 563b785..c02d41e 100644 --- a/cpr/CMakeLists.txt +++ b/cpr/CMakeLists.txt -@@ -1,47 +1,46 @@ --message(STATUS "Using CURL_INCLUDE_DIRS: ${CURL_INCLUDE_DIRS}.") --include_directories( -- ${CPR_INCLUDE_DIRS} -- ${CURL_INCLUDE_DIRS}) -- - add_library(${CPR_LIBRARIES} +@@ -1,31 +1,53 @@ + cmake_minimum_required(VERSION 3.15) + +-add_library(cpr +- auth.cpp +- cookies.cpp +- cprtypes.cpp +- curlholder.cpp +- digest.cpp +- error.cpp +- multipart.cpp +- ntlm.cpp +- parameters.cpp +- payload.cpp +- proxies.cpp +- session.cpp +- timeout.cpp +- unix_socket.cpp +- util.cpp +- ) ++add_library(${CPR_LIBRARIES} + auth.cpp + cookies.cpp + cprtypes.cpp @@ -23,11 +37,13 @@ index a6db5bd..90bec48 100644 + util.cpp + ssl_options.cpp +) -+ + +-add_library(cpr::cpr ALIAS cpr) +target_link_libraries( ${CPR_LIBRARIES} + PUBLIC ${CURL_LIBRARIES} +) -+ + +-target_link_libraries(cpr PUBLIC CURL::libcurl) # todo should be private, but first dependencys in ssl_options need to be removed +target_include_directories(${CPR_LIBRARIES} + PUBLIC + $ @@ -35,22 +51,15 @@ index a6db5bd..90bec48 100644 + PRIVATE + $ +) -+ -- # Source files -- auth.cpp -- cookies.cpp -- cprtypes.cpp -- digest.cpp -- error.cpp -- multipart.cpp -- parameters.cpp -- payload.cpp -- proxies.cpp -- session.cpp -- timeout.cpp -- util.cpp -- ssl_options.cpp + # Set version for shared libraries. +-set_target_properties(cpr ++set_target_properties(${CPR_LIBRARIES} + PROPERTIES + VERSION ${${PROJECT_NAME}_VERSION} + SOVERSION ${${PROJECT_NAME}_VERSION_MAJOR}) + +-install(TARGETS cpr) +set(TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets") +install( + TARGETS ${CPR_LIBRARIES} @@ -59,36 +68,13 @@ index a6db5bd..90bec48 100644 + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) - -- # Header files (useful in IDEs) -- "${CPR_INCLUDE_DIRS}/cpr/api.h" -- "${CPR_INCLUDE_DIRS}/cpr/auth.h" -- "${CPR_INCLUDE_DIRS}/cpr/body.h" -- "${CPR_INCLUDE_DIRS}/cpr/cookies.h" -- "${CPR_INCLUDE_DIRS}/cpr/cpr.h" -- "${CPR_INCLUDE_DIRS}/cpr/cprtypes.h" -- "${CPR_INCLUDE_DIRS}/cpr/curlholder.h" -- "${CPR_INCLUDE_DIRS}/cpr/defines.h" -- "${CPR_INCLUDE_DIRS}/cpr/digest.h" -- "${CPR_INCLUDE_DIRS}/cpr/error.h" -- "${CPR_INCLUDE_DIRS}/cpr/max_redirects.h" -- "${CPR_INCLUDE_DIRS}/cpr/multipart.h" -- "${CPR_INCLUDE_DIRS}/cpr/parameters.h" -- "${CPR_INCLUDE_DIRS}/cpr/payload.h" -- "${CPR_INCLUDE_DIRS}/cpr/proxies.h" -- "${CPR_INCLUDE_DIRS}/cpr/response.h" -- "${CPR_INCLUDE_DIRS}/cpr/session.h" -- "${CPR_INCLUDE_DIRS}/cpr/timeout.h" -- "${CPR_INCLUDE_DIRS}/cpr/util.h" -- "${CPR_INCLUDE_DIRS}/cpr/ssl_options.h") ++ +install( + EXPORT ${TARGETS_EXPORT_NAME} + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" +) - --message(STATUS "Using CURL_LIBRARIES: ${CURL_LIBRARIES}.") --target_link_libraries(${CPR_LIBRARIES} -- ${CURL_LIBRARIES}) ++ +if (NOT DISABLE_INSTALL_HEADERS) + install(DIRECTORY ${CPR_INCLUDE_DIRS}/cpr DESTINATION include) +endif() +\ No newline at end of file diff --git a/ports/cpr/002_cpr_fixcase.patch b/ports/cpr/002_cpr_fixcase.patch index 4dbc9711951349..72ac3ff88cd5e0 100644 --- a/ports/cpr/002_cpr_fixcase.patch +++ b/ports/cpr/002_cpr_fixcase.patch @@ -1,13 +1,15 @@ diff --git a/cpr/error.cpp b/cpr/error.cpp -index 713cb10..4143f93 100644 +index 7228b58..860cf8d 100644 --- a/cpr/error.cpp +++ b/cpr/error.cpp -@@ -38,8 +38,6 @@ ErrorCode Error::getErrorCodeForCurlError(std::int32_t curl_code) { - return ErrorCode::SSL_LOCAL_CERTIFICATE_ERROR; - case CURLE_SSL_CIPHER: - return ErrorCode::GENERIC_SSL_ERROR; +@@ -43,10 +43,6 @@ ErrorCode Error::getErrorCodeForCurlError(std::int32_t curl_code) { + #if LIBCURL_VERSION_NUM >= 0x073e00 + case CURLE_PEER_FAILED_VERIFICATION: + return ErrorCode::SSL_REMOTE_CERTIFICATE_ERROR; +-#else - case CURLE_SSL_CACERT: - return ErrorCode::SSL_CACERT_ERROR; +-#endif case CURLE_USE_SSL_FAILED: return ErrorCode::GENERIC_SSL_ERROR; case CURLE_SSL_ENGINE_INITFAILED: diff --git a/ports/cpr/CONTROL b/ports/cpr/CONTROL index 6912c8be6d7908..6f292740f3d9c7 100644 --- a/ports/cpr/CONTROL +++ b/ports/cpr/CONTROL @@ -1,5 +1,5 @@ Source: cpr -Version: 1.3.0-8 +Version: 1.5.1 Homepage: https://github.com/whoshuu/cpr Description: C++ Requests is a simple wrapper around libcurl inspired by the excellent Python Requests project. Build-Depends: curl[core] diff --git a/ports/cpr/fix-install-directory.patch b/ports/cpr/fix-install-directory.patch new file mode 100644 index 00000000000000..85f227d5c9b7c0 --- /dev/null +++ b/ports/cpr/fix-install-directory.patch @@ -0,0 +1,30 @@ +diff --git a/cpr/CMakeLists.txt b/cpr/CMakeLists.txt +index edf77e6..aba4913 100644 +--- a/cpr/CMakeLists.txt ++++ b/cpr/CMakeLists.txt +@@ -13,7 +13,6 @@ add_library(${CPR_LIBRARIES} + session.cpp + timeout.cpp + util.cpp +- ssl_options.cpp + ) + + target_link_libraries( ${CPR_LIBRARIES} +@@ -49,5 +48,5 @@ install( + ) + + if (NOT DISABLE_INSTALL_HEADERS) +- install(DIRECTORY ${CPR_INCLUDE_DIRS}/cpr DESTINATION include) ++ install(DIRECTORY DESTINATION include) + endif() +\ No newline at end of file +diff --git a/cpr/error.cpp b/cpr/error.cpp +index 860cf8d..7117f26 100644 +--- a/cpr/error.cpp ++++ b/cpr/error.cpp +@@ -63,3 +63,4 @@ ErrorCode Error::getErrorCodeForCurlError(std::int32_t curl_code) { + } + + } // namespace cpr ++#endif +\ No newline at end of file diff --git a/ports/cpr/portfile.cmake b/ports/cpr/portfile.cmake index 9e2c40a0dc9201..56a9352582176b 100644 --- a/ports/cpr/portfile.cmake +++ b/ports/cpr/portfile.cmake @@ -1,16 +1,15 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO whoshuu/cpr - REF 1.3.0 - SHA512 fd08f8a592a5e1fb8dc93158a4850b81575983c08527fb415f65bd9284f93c804c8680d16c548744583cd26b9353a7d4838269cfc59ccb6003da8941f620c273 + REF 5e87cb5f45ac99858f0286dc1c35a6cd27c3bcb9 #v1.5.1 + SHA512 1ea6295b5568d8d5d099cb1d89d19b3cae873bd869f64be4495be301561c91893f3c1c375823ce18419c780cda52aab79520293ff63ee529ded5431ec511ce5c HEAD_REF master PATCHES 001-cpr-config.patch 002_cpr_fixcase.patch + fix-install-directory.patch ) vcpkg_configure_cmake( @@ -25,7 +24,7 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/cprConfig.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/lib/cmake/cpr) +file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/cprConfig.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/lib/cmake/${PORT}) vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/cpr) vcpkg_copy_pdbs() @@ -33,5 +32,4 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/cpr) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/cpr/LICENSE ${CURRENT_PACKAGES_DIR}/share/cpr/copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file