From f9d514aea5da5294a80ab081e84d9bcca1c9939f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viliam=20Lej=C4=8D=C3=ADk?= <34658965+lejcik@users.noreply.github.com> Date: Thu, 11 Feb 2021 09:54:25 +0100 Subject: [restc-cpp] new port (#15739) * [restc-cpp] new port * Updated port's version-string Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * [restc-cpp] added port version * [restc-cpp] new port * Updated port's version-string Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * [restc-cpp] added port version * [restc_cpp] updated MSVC CRT linkage * [restc-cpp] reformated vcpkg.json * [restc-cpp] updated port's version * [restc-cpp] excluded dependency on cmake external projects * [restc-cpp] updated version hash * [rest-cpp] Remove changes about CRT linkage * update version record * Update ports/restc-cpp/portfile.cmake Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * [restc-cpp] added an error message for mutual exclusive logging features * [restc-cpp] updated port version * Updated ports/restc-cpp/vcpkg.json Co-authored-by: Robert Schumacher * Updated ports/restc-cpp/vcpkg.json Co-authored-by: Robert Schumacher * Update ports/restc-cpp/vcpkg.json Co-authored-by: Robert Schumacher * Updated ports/restc-cpp/vcpkg.json Co-authored-by: Robert Schumacher * Updated ports/restc-cpp/vcpkg.json Co-authored-by: Robert Schumacher * Updated ports/restc-cpp/vcpkg.json Co-authored-by: Robert Schumacher * Updated ports/restc-cpp/portfile.cmake Co-authored-by: Robert Schumacher * Updated ports/restc-cpp/portfile.cmake Co-authored-by: Robert Schumacher * Updated ports/restc-cpp/portfile.cmake Co-authored-by: Robert Schumacher * [restc-cpp] updated port version * [restc-cpp] version file has to declare version as 'version-semver' Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> Co-authored-by: JackBoosY Co-authored-by: Robert Schumacher --- .../0001-exclude-cmake-external-projects.patch | 24 +++++++++++++ ports/restc-cpp/portfile.cmake | 37 ++++++++++++++++++++ ports/restc-cpp/vcpkg.json | 40 ++++++++++++++++++++++ versions/baseline.json | 4 +++ versions/r-/restc-cpp.json | 9 +++++ 5 files changed, 114 insertions(+) create mode 100644 ports/restc-cpp/0001-exclude-cmake-external-projects.patch create mode 100644 ports/restc-cpp/portfile.cmake create mode 100644 ports/restc-cpp/vcpkg.json create mode 100644 versions/r-/restc-cpp.json diff --git a/ports/restc-cpp/0001-exclude-cmake-external-projects.patch b/ports/restc-cpp/0001-exclude-cmake-external-projects.patch new file mode 100644 index 000000000..fff79c1f4 --- /dev/null +++ b/ports/restc-cpp/0001-exclude-cmake-external-projects.patch @@ -0,0 +1,24 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index aa690fe..d3ff45d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -16,7 +16,7 @@ if (NOT DEFINED INSTALL_RAPIDJSON_HEADERS) + option(INSTALL_RAPIDJSON_HEADERS "Install rapidjson headers when make install is executed" ON) + endif() + +-include(cmake_scripts/external-projects.cmake) ++#include(cmake_scripts/external-projects.cmake) + + if (EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) + message(STATUS "Using conan configuration: ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +@@ -137,7 +137,9 @@ target_include_directories(${PROJECT_NAME} + + SET_CPP_STANDARD(${PROJECT_NAME}) + +-add_dependencies(${PROJECT_NAME} externalRapidJson) ++#add_dependencies(${PROJECT_NAME} externalRapidJson) ++find_package(RapidJSON CONFIG REQUIRED) ++target_include_directories(${PROJECT_NAME} PRIVATE ${RAPIDJSON_INCLUDE_DIRS}) + + if (NOT EMBEDDED_RESTC_CPP) + diff --git a/ports/restc-cpp/portfile.cmake b/ports/restc-cpp/portfile.cmake new file mode 100644 index 000000000..764f39cfa --- /dev/null +++ b/ports/restc-cpp/portfile.cmake @@ -0,0 +1,37 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO jgaa/restc-cpp + REF v0.10.0 + SHA512 0f74d825d3958810c270748c2810953fe394d0bf1f147d81b9177803e29a86c702715d5995c5966c4fe671b7689f26d9a0fad4e82d111277bbd3ddce1a68f73a + HEAD_REF master + PATCHES + 0001-exclude-cmake-external-projects.patch +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + openssl RESTC_CPP_WITH_TLS + zlib RESTC_CPP_WITH_ZLIB + threaded-ctx RESTC_CPP_THREADED_CTX +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DINSTALL_RAPIDJSON_HEADERS=OFF + -DRESTC_CPP_WITH_EXAMPLES=OFF + -DRESTC_CPP_WITH_UNIT_TESTS=OFF + -DRESTC_CPP_WITH_FUNCTIONALT_TESTS=OFF + ${FEATURE_OPTIONS} +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT}) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share + ${CURRENT_PACKAGES_DIR}/debug/include) + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/restc-cpp/vcpkg.json b/ports/restc-cpp/vcpkg.json new file mode 100644 index 000000000..c50d95e0f --- /dev/null +++ b/ports/restc-cpp/vcpkg.json @@ -0,0 +1,40 @@ +{ + "name": "restc-cpp", + "version-semver": "0.10.0", + "description": "Modern C++ REST Client library", + "homepage": "https://github.com/jgaa/restc-cpp", + "license": "MIT", + "dependencies": [ + "boost-chrono", + "boost-context", + "boost-coroutine", + "boost-date-time", + "boost-filesystem", + "boost-log", + "boost-program-options", + "boost-system", + "boost-uuid", + "rapidjson" + ], + "default-features": [ + "openssl", + "zlib" + ], + "features": { + "openssl": { + "description": "OpenSSL support.", + "dependencies": [ + "openssl" + ] + }, + "threaded-ctx": { + "description": "Allow asio contexts with multiple threads. Enables thread-safe internal access." + }, + "zlib": { + "description": "Use zlib.", + "dependencies": [ + "zlib" + ] + } + } +} diff --git a/versions/baseline.json b/versions/baseline.json index 0cccc0021..c8c47cdcd 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5124,6 +5124,10 @@ "baseline": "4.7", "port-version": 0 }, + "restc-cpp": { + "baseline": "0.10.0", + "port-version": 0 + }, "restclient-cpp": { "baseline": "0.5.2", "port-version": 0 diff --git a/versions/r-/restc-cpp.json b/versions/r-/restc-cpp.json new file mode 100644 index 000000000..5cd8c3ee7 --- /dev/null +++ b/versions/r-/restc-cpp.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "5b6f1ef4d2f26a9053f956fe044300e3d0bed2cd", + "version-semver": "0.10.0", + "port-version": 0 + } + ] +} -- cgit v1.2.3