From 74360420458e01b72e519830cb2bc4017a986a90 Mon Sep 17 00:00:00 2001 From: Gregor Jasny Date: Wed, 14 Nov 2018 20:16:07 +0100 Subject: [PATCH] Add prometheus-cpp (and civetweb) (#4694) * [prometheus-cpp] Initial port Closes: jupp0r/prometheus-cpp#130 * [civetweb] Initial port * [prometheus-cpp][civetweb] Cleanup. Update to 0.6.0. --- ports/civetweb/CONTROL | 3 ++ ports/civetweb/portfile.cmake | 36 ++++++++++++++++++++++++ ports/prometheus-cpp/CONTROL | 16 +++++++++++ ports/prometheus-cpp/portfile.cmake | 43 +++++++++++++++++++++++++++++ 4 files changed, 98 insertions(+) create mode 100644 ports/civetweb/CONTROL create mode 100644 ports/civetweb/portfile.cmake create mode 100644 ports/prometheus-cpp/CONTROL create mode 100644 ports/prometheus-cpp/portfile.cmake diff --git a/ports/civetweb/CONTROL b/ports/civetweb/CONTROL new file mode 100644 index 00000000000..a8b0832e047 --- /dev/null +++ b/ports/civetweb/CONTROL @@ -0,0 +1,3 @@ +Source: civetweb +Version: 1.11-1 +Description: Easy to use, powerful, C/C++ embeddable web server. diff --git a/ports/civetweb/portfile.cmake b/ports/civetweb/portfile.cmake new file mode 100644 index 00000000000..8ad7af5381a --- /dev/null +++ b/ports/civetweb/portfile.cmake @@ -0,0 +1,36 @@ +include(vcpkg_common_functions) + +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + message(FATAL_ERROR "${PORT} does not currently support UWP") +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO civetweb/civetweb + REF v1.11 + SHA512 e1520fd2f4a54b6ab4838f4da2ce3f0956e9884059467d196078935a3fce61dad619f3bb1bc2b4c6a757e1a8abfed0e83cba38957c7c52fff235676e9dd1d428 + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DCIVETWEB_BUILD_TESTING=OFF + -DCIVETWEB_ENABLE_ASAN=OFF + -DCIVETWEB_ENABLE_CXX=ON + -DCIVETWEB_ENABLE_IPV6=ON + -DCIVETWEB_ENABLE_SERVER_EXECUTABLE=OFF + -DCIVETWEB_ENABLE_SSL=OFF +) + +vcpkg_install_cmake() + +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Handle copyright +configure_file(${SOURCE_PATH}/LICENSE.md ${CURRENT_PACKAGES_DIR}/share/civetweb/copyright COPYONLY) diff --git a/ports/prometheus-cpp/CONTROL b/ports/prometheus-cpp/CONTROL new file mode 100644 index 00000000000..e89b84cb27d --- /dev/null +++ b/ports/prometheus-cpp/CONTROL @@ -0,0 +1,16 @@ +Source: prometheus-cpp +Version: 0.6.0 +Description: Prometheus Client Library for Modern C++ +Default-Features: compression, pull + +Feature: compression +Build-Depends: zlib +Description: Enable zlib compression + +Feature: pull +Build-Depends: civetweb +Description: Support for regular pull mode + +Feature: push +Build-Depends: curl +Description: Support push gateway diff --git a/ports/prometheus-cpp/portfile.cmake b/ports/prometheus-cpp/portfile.cmake new file mode 100644 index 00000000000..388623d4890 --- /dev/null +++ b/ports/prometheus-cpp/portfile.cmake @@ -0,0 +1,43 @@ +include(vcpkg_common_functions) + +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO jupp0r/prometheus-cpp + REF v0.6.0 + SHA512 a7e6f902f3007007ec68add5ac63e833c6f383ed0ce103e238b7248497f495e664446df7801000e36021adcb7cfb1d461bbb45e1b4fba9ffa4edfcaf5b5957dd + HEAD_REF master +) + +macro(feature FEATURENAME OPTIONNAME) + if("${FEATURENAME}" IN_LIST FEATURES) + list(APPEND FEATURE_OPTIONS -D${OPTIONNAME}=TRUE) + else() + list(APPEND FEATURE_OPTIONS -D${OPTIONNAME}=FALSE) + endif() +endmacro() + +feature(compression ENABLE_COMPRESSION) +feature(pull ENABLE_PULL) +feature(push ENABLE_PUSH) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DUSE_THIRDPARTY_LIBRARIES=OFF # use vcpkg packages + -DENABLE_TESTING=FALSE # need gtest 1.8.1 + ${FEATURE_OPTIONS} +) + +vcpkg_install_cmake() + +vcpkg_copy_pdbs() + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/prometheus-cpp) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Handle copyright +configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/prometheus-cpp/copyright COPYONLY)