aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Marks <807580+SamuelMarks@users.noreply.github.com>2019-06-18 03:46:34 +1000
committerPhil Christensen <philc@microsoft.com>2019-06-17 10:46:34 -0700
commit783fa14d0bfb90ec608e92f9e4cacdcfb5fbe955 (patch)
tree40a518d182f428d981f8a35b7e5dfa7066eb99ba
parentf00fbcb2e55fb518cdd16d5917275acffdc40a6a (diff)
downloadvcpkg-783fa14d0bfb90ec608e92f9e4cacdcfb5fbe955.tar.gz
vcpkg-783fa14d0bfb90ec608e92f9e4cacdcfb5fbe955.zip
[ppconsul] Add new port (#6911)
-rw-r--r--ports/ppconsul/CONTROL5
-rw-r--r--ports/ppconsul/cmake_build.patch37
-rw-r--r--ports/ppconsul/portfile.cmake25
3 files changed, 67 insertions, 0 deletions
diff --git a/ports/ppconsul/CONTROL b/ports/ppconsul/CONTROL
new file mode 100644
index 000000000..4591b6a01
--- /dev/null
+++ b/ports/ppconsul/CONTROL
@@ -0,0 +1,5 @@
+Source: ppconsul
+Version: 0.3
+Homepage: https://github.com/oliora/ppconsul
+Description: A C++ client library for Consul. Consul is a distributed tool for discovering and configuring services in your infrastructure.
+Build-Depends: boost-core, boost-variant, curl[openssl]
diff --git a/ports/ppconsul/cmake_build.patch b/ports/ppconsul/cmake_build.patch
new file mode 100644
index 000000000..f607e37e4
--- /dev/null
+++ b/ports/ppconsul/cmake_build.patch
@@ -0,0 +1,37 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 92e4698..002981e 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -75,6 +75,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")
+@@ -89,7 +91,6 @@ 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 8e24aab..beaac68 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -85,7 +85,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/ports/ppconsul/portfile.cmake b/ports/ppconsul/portfile.cmake
new file mode 100644
index 000000000..43e7eaeca
--- /dev/null
+++ b/ports/ppconsul/portfile.cmake
@@ -0,0 +1,25 @@
+include(vcpkg_common_functions)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO oliora/ppconsul
+ REF fd3a22eba03a49623832a8f8c990fee499e3f8fb
+ SHA512 098f2fa0fdc3f219f5958d0d5b2a620231e3cd94dc3110cfbedb87e787e8402a7b0294f7ffa4fcb4169b0428b4f65376b621e5840706ff7cc8f02ac7fc1d7757
+ HEAD_REF master
+ PATCHES "cmake_build.patch"
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+)
+vcpkg_install_cmake()
+
+vcpkg_fixup_cmake_targets(CONFIG_PATH cmake)
+
+
+file(INSTALL ${SOURCE_PATH}/LICENSE_1_0.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/ppconsul RENAME copyright)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+
+
+vcpkg_copy_pdbs()