aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/ppconsul
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/ppconsul')
-rw-r--r--vcpkg/ports/ppconsul/cmake_build.patch70
-rw-r--r--vcpkg/ports/ppconsul/portfile.cmake28
-rw-r--r--vcpkg/ports/ppconsul/vcpkg.json28
3 files changed, 126 insertions, 0 deletions
diff --git a/vcpkg/ports/ppconsul/cmake_build.patch b/vcpkg/ports/ppconsul/cmake_build.patch
new file mode 100644
index 0000000..a66c8e1
--- /dev/null
+++ b/vcpkg/ports/ppconsul/cmake_build.patch
@@ -0,0 +1,70 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 92e4698..aa643aa 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -52,6 +52,8 @@ endif()
+
+ enable_testing()
+
++find_package(json11 REQUIRED)
++
+ if (${USE_CPPNETLIB})
+ find_package(Boost ${BOOST_MIN_VERSION} REQUIRED COMPONENTS thread filesystem system date_time chrono regex)
+
+@@ -75,6 +77,8 @@ else ()
+ set (CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${CURL_ROOT}/lib")
+ endif ()
+ find_package(CURL REQUIRED)
++ find_package(OpenSSL REQUIRED)
++ find_package(ZLIB REQUIRED)
+ endif ()
+
+ set(LIBB64_DIR "${PROJECT_SOURCE_DIR}/ext/b64")
+@@ -87,9 +91,7 @@ if (WIN32 AND NOT BUILD_STATIC_LIB)
+ message(FATAL_ERROR "Building Ppconsul as dynamic library on Windows is not supported, see https://github.com/oliora/ppconsul/issues/25")
+ endif()
+
+-add_subdirectory(ext/json11)
+ add_subdirectory(src)
+-add_subdirectory(tests)
+
+ install(
+ DIRECTORY "${HEADERS_DIR}"
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index d747100..966c7e2 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -78,7 +78,7 @@ target_include_directories(${PROJECT_NAME}
+
+ target_link_libraries(${PROJECT_NAME}
+ PRIVATE
+- json11
++ ${JSON11_LIBRARIES}
+ ${Boost_LIBRARIES}
+ )
+
+@@ -87,7 +87,10 @@ if (${USE_CPPNETLIB})
+ target_link_libraries(${PROJECT_NAME} PRIVATE ${CPPNETLIB_LIBRARIES})
+ else ()
+ target_include_directories(${PROJECT_NAME} PRIVATE ${CURL_INCLUDE_DIR})
+- target_link_libraries(${PROJECT_NAME} PRIVATE ${CURL_LIBRARIES})
++ target_link_libraries(${PROJECT_NAME} PRIVATE ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES} ZLIB::ZLIB)
++ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
++ target_link_libraries(${PROJECT_NAME} PRIVATE "-framework CoreFoundation" "-framework Security")
++ endif ()
+ endif ()
+
+ source_group(${PROJECT_NAME} FILES ${SOURCES})
+diff --git a/src/s11n.h b/src/s11n.h
+index c317834..3cb03c4 100644
+--- a/src/s11n.h
++++ b/src/s11n.h
+@@ -6,7 +6,7 @@
+
+ #include "ppconsul/config.h"
+ #include "ppconsul/error.h"
+-#include <json11/json11.hpp>
++#include <json11.hpp>
+ #include <vector>
+ #include <chrono>
+ #include <set>
diff --git a/vcpkg/ports/ppconsul/portfile.cmake b/vcpkg/ports/ppconsul/portfile.cmake
new file mode 100644
index 0000000..3f3abe7
--- /dev/null
+++ b/vcpkg/ports/ppconsul/portfile.cmake
@@ -0,0 +1,28 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO oliora/ppconsul
+ REF 8aed30cae0e2df76d920b5cd77933604a4644ee9
+ SHA512 756f07c7c8099868fa181571941f511987088abc110ad5eda517ad591ed10b40532cd7b1541dbdad76c2617ce804a1dc26a121380f20f8e4a40e29063523cbbd
+ HEAD_REF master
+ PATCHES "cmake_build.patch"
+)
+
+# Force the use of the vcpkg installed versions
+file(REMOVE_RECURSE "${SOURCE_PATH}/ext/json11")
+file(REMOVE_RECURSE "${SOURCE_PATH}/ext/catch")
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+)
+vcpkg_cmake_install()
+
+vcpkg_cmake_config_fixup(CONFIG_PATH cmake)
+
+
+file(INSTALL "${SOURCE_PATH}/LICENSE_1_0.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+
+vcpkg_copy_pdbs()
+
+vcpkg_fixup_pkgconfig()
diff --git a/vcpkg/ports/ppconsul/vcpkg.json b/vcpkg/ports/ppconsul/vcpkg.json
new file mode 100644
index 0000000..6812951
--- /dev/null
+++ b/vcpkg/ports/ppconsul/vcpkg.json
@@ -0,0 +1,28 @@
+{
+ "name": "ppconsul",
+ "version": "0.5",
+ "port-version": 5,
+ "description": "A C++ client library for Consul. Consul is a distributed tool for discovering and configuring services in your infrastructure.",
+ "homepage": "https://github.com/oliora/ppconsul",
+ "dependencies": [
+ "boost-core",
+ "boost-fusion",
+ "boost-optional",
+ "boost-variant",
+ {
+ "name": "curl",
+ "features": [
+ "openssl"
+ ]
+ },
+ "json11",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}