diff --git a/ports/json11/CONTROL b/ports/json11/CONTROL index d624f9e7be..34cee37de0 100644 --- a/ports/json11/CONTROL +++ b/ports/json11/CONTROL @@ -1,3 +1,3 @@ Source: json11 -Version: 2017-06-20-1 +Version: 2017-06-20-2 Description: json11 is a tiny JSON library for C++11, providing JSON parsing and serialization. diff --git a/ports/json11/destination.patch b/ports/json11/destination.patch new file mode 100644 index 0000000000..6d16303292 --- /dev/null +++ b/ports/json11/destination.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 819c36f..847489e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -52,6 +52,6 @@ if (JSON11_BUILD_TESTS) + target_link_libraries(json11_test json11) + endif() + +-install(TARGETS json11 DESTINATION lib/${CMAKE_LIBRARY_ARCHITECTURE}) +-install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/json11.hpp" DESTINATION include/${CMAKE_LIBRARY_ARCHITECTURE}) +-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/json11.pc" DESTINATION lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig) ++install(TARGETS json11 DESTINATION lib) ++install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/json11.hpp" DESTINATION include) ++install(FILES "${CMAKE_CURRENT_BINARY_DIR}/json11.pc" DESTINATION lib/pkgconfig) diff --git a/ports/json11/json11-config.cmake b/ports/json11/json11-config.cmake new file mode 100644 index 0000000000..0bc3bb27ca --- /dev/null +++ b/ports/json11/json11-config.cmake @@ -0,0 +1,25 @@ +get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) + +if(NOT JSON11_FIND_COMPONENTS) + set(JSON11_FIND_COMPONENTS json11 json11) + if(JSON11_FIND_REQUIRED) + set(JSON11_FIND_REQUIRED_json11 TRUE) + endif() + + set(JSON11_FOUND TRUE) +endif() + +set(JSON11_INCLUDE_DIRS ${_DIR}/../../include) +set(JSON11_LIBRARIES) +if (EXISTS ${_DIR}/../../lib/libjson11.a) + list(APPEND JSON11_LIBRARIES optimized ${_DIR}/../../lib/libjson11.a) +endif() +if (EXISTS ${_DIR}/../../debug/lib/libjson11.a) + list(APPEND JSON11_LIBRARIES debug ${_DIR}/../../debug/lib/libjson11.a) +endif() +if (EXISTS ${_DIR}/../../lib/json11.lib) + list(APPEND JSON11_LIBRARIES optimized ${_DIR}/../../lib/json11.lib) +endif() +if (EXISTS ${_DIR}/../../debug/lib/json11.lib) + list(APPEND JSON11_LIBRARIES debug ${_DIR}/../../debug/lib/json11.lib) +endif() diff --git a/ports/json11/portfile.cmake b/ports/json11/portfile.cmake index f6592693a2..a3c2b9cabd 100644 --- a/ports/json11/portfile.cmake +++ b/ports/json11/portfile.cmake @@ -8,6 +8,7 @@ vcpkg_from_github( REF ec4e45219af1d7cde3d58b49ed762376fccf1ace SHA512 2129e048d8dee027dc1ba789d9901e017b7d698465e15236802ef68639161e1cc7c8665d5f50079333801717fd41ffbe2cb90fa2165b9a85629e8ced8f2b3cd8 HEAD_REF master + PATCHES destination.patch ) vcpkg_configure_cmake( @@ -20,6 +21,8 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_copy_pdbs() +file(INSTALL ${CURRENT_PORT_DIR}/json11-config.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/json11) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright diff --git a/ports/ppconsul/CONTROL b/ports/ppconsul/CONTROL index 4591b6a015..cc122ecf6d 100644 --- a/ports/ppconsul/CONTROL +++ b/ports/ppconsul/CONTROL @@ -1,5 +1,5 @@ Source: ppconsul -Version: 0.3 +Version: 0.3-1 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] +Build-Depends: boost-core, boost-variant, curl[openssl], json11 diff --git a/ports/ppconsul/cmake_build.patch b/ports/ppconsul/cmake_build.patch index f607e37e42..95c795743b 100644 --- a/ports/ppconsul/cmake_build.patch +++ b/ports/ppconsul/cmake_build.patch @@ -1,37 +1,70 @@ -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/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 962a1ac..6ab7f3b 100644 +--- a/src/s11n.h ++++ b/src/s11n.h +@@ -6,7 +6,7 @@ + + #include "ppconsul/config.h" + #include "ppconsul/error.h" +-#include ++#include + #include + #include + #include diff --git a/ports/ppconsul/portfile.cmake b/ports/ppconsul/portfile.cmake index 43e7eaecad..a1290019fe 100644 --- a/ports/ppconsul/portfile.cmake +++ b/ports/ppconsul/portfile.cmake @@ -9,6 +9,10 @@ vcpkg_from_github( 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_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA