From 3f2dfb8d7633577884e998e3e16a98f9e7c09bab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jack=C2=B7Boos=C2=B7Yu?= <47264268+JackBoosY@users.noreply.github.com> Date: Thu, 21 Apr 2022 16:06:18 +0000 Subject: [PATCH] [vcpkg baseline][qpid-proton] Fix dependencies (#24267) * [vcpkg baseline][qpid-proton] Fix dependencies * version * Re-fix jsoncpp * version * typo * version * okay fix for reals Co-authored-by: nicole mazzuca --- ports/qpid-proton/fix-dependencies.patch | 117 ++++++++++++++++++++++ ports/qpid-proton/portfile.cmake | 48 ++++----- ports/qpid-proton/qpid-protonConfig.cmake | 4 - ports/qpid-proton/vcpkg.json | 3 +- versions/baseline.json | 2 +- versions/q-/qpid-proton.json | 5 + 6 files changed, 150 insertions(+), 29 deletions(-) create mode 100644 ports/qpid-proton/fix-dependencies.patch delete mode 100644 ports/qpid-proton/qpid-protonConfig.cmake diff --git a/ports/qpid-proton/fix-dependencies.patch b/ports/qpid-proton/fix-dependencies.patch new file mode 100644 index 00000000000000..3c679af0bb8e17 --- /dev/null +++ b/ports/qpid-proton/fix-dependencies.patch @@ -0,0 +1,117 @@ +diff --git a/c/CMakeLists.txt b/c/CMakeLists.txt +index 27b40e7..1931b65 100644 +--- a/c/CMakeLists.txt ++++ b/c/CMakeLists.txt +@@ -727,11 +727,6 @@ install (FILES + ${CMAKE_CURRENT_BINARY_DIR}/ProtonConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/ProtonConfigVersion.cmake + DESTINATION ${LIB_INSTALL_DIR}/cmake/Proton) +-install (FILES +- ../tools/cmake/Modules/FindCyrusSASL.cmake +- ../tools/cmake/Modules/FindOpenSSL.cmake +- ../tools/cmake/Modules/FindThreads.cmake +- DESTINATION ${LIB_INSTALL_DIR}/cmake/Proton) + + if (ENABLE_BENCHMARKS) + add_subdirectory(benchmarks) +diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt +index 03fe80a..fd6a31d 100644 +--- a/cpp/CMakeLists.txt ++++ b/cpp/CMakeLists.txt +@@ -26,12 +26,15 @@ find_package(Threads) + include(versions.cmake) + + # Check for JSON-CPP support for connection configuration +-find_package(JsonCpp) +-option(ENABLE_JSONCPP "Use jsoncpp parser for connection configuration" ${JsonCpp_FOUND}) ++option(ENABLE_JSONCPP "Use jsoncpp parser for connection configuration" OFF) + if (ENABLE_JSONCPP) +- include_directories(${JsonCpp_INCLUDE_DIRS}) ++ find_package(jsoncpp CONFIG REQUIRED) + set(CONNECT_CONFIG_SRC src/connect_config.cpp) +- set(CONNECT_CONFIG_LIBS ${JsonCpp_LIBRARY}) ++ if (TARGET jsoncpp_lib) ++ set(CONNECT_CONFIG_LIBS jsoncpp_lib) ++ elseif (TARGET jsoncpp_static) ++ set(CONNECT_CONFIG_LIBS jsoncpp_static) ++ endif() + else() + set(CONNECT_CONFIG_SRC src/connect_config_dummy.cpp) + endif() + +--- a/c/src/ProtonConfig.cmake.in ++++ b/c/src/ProtonConfig.cmake.in +@@ -20,39 +20,40 @@ + # Name: Proton + # Description: Qpid Proton C library + # Version: @PN_VERSION@ + # URL: http://qpid.apache.org/proton/ + + @PACKAGE_INIT@ +-if (NOT Proton_USE_STATIC_LIBS) ++include(CMakeFindDependencyMacro) ++if (1) + include("${CMAKE_CURRENT_LIST_DIR}/ProtonTargets.cmake") + else() + include("${CMAKE_CURRENT_LIST_DIR}/ProtonTargetsStatic.cmake") + endif() + + set(Proton_VERSION @PN_VERSION@) + + # find dependencies, because static libs don't transitively pull them +-if (Proton_USE_STATIC_LIBS) +- set(CMAKE_MODULE_PATH_OLD ${CMAKE_MODULE_PATH}) +- set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") ++if (1) ++ #set(CMAKE_MODULE_PATH_OLD ${CMAKE_MODULE_PATH}) ++ #set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") + + set(CyrusSASL_FOUND @CyrusSASL_FOUND@) + if (CyrusSASL_FOUND) +- find_package (CyrusSASL REQUIRED) ++ find_dependency (CyrusSASL) + endif() + + set(OPENSSL_FOUND @OPENSSL_FOUND@) + set(OpenSSL_FOUND @OpenSSL_FOUND@) + if (OPENSSL_FOUND OR OpenSSL_FOUND) +- find_package (OpenSSL REQUIRED) ++ find_dependency (OpenSSL) + endif() + +- find_package (Threads REQUIRED) ++ find_dependency (Threads) + +- set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH_OLD}) ++ #set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH_OLD}) + endif() + + set (Proton_INCLUDE_DIRS @PACKAGE_INCLUDE_INSTALL_DIR@) + set (Proton_LIBRARIES Proton::qpid-proton) + set (Proton_FOUND True) + +--- a/cpp/ProtonCppConfig.cmake.in ++++ b/cpp/ProtonCppConfig.cmake.in +@@ -20,19 +20,21 @@ + # Name: Proton + # Description: Qpid Proton C library + # Version: @PN_VERSION@ + # URL: http://qpid.apache.org/proton/ + + @PACKAGE_INIT@ +-if (NOT ProtonCpp_USE_STATIC_LIBS) ++include(CMakeFindDependencyMacro) ++find_dependency(Proton CONFIG) ++if (1) + include("${CMAKE_CURRENT_LIST_DIR}/ProtonCppTargets.cmake") + else() + include("${CMAKE_CURRENT_LIST_DIR}/ProtonCppTargetsStatic.cmake") + endif() + + set (ProtonCpp_VERSION @PN_VERSION@) + + set (ProtonCpp_INCLUDE_DIRS @PACKAGE_INCLUDE_INSTALL_DIR@) + set (ProtonCpp_LIBRARIES Proton::cpp) + set (ProtonCpp_FOUND True) + + check_required_components(ProtonCpp) diff --git a/ports/qpid-proton/portfile.cmake b/ports/qpid-proton/portfile.cmake index 388580f109fc48..347d89883f824c 100644 --- a/ports/qpid-proton/portfile.cmake +++ b/ports/qpid-proton/portfile.cmake @@ -1,17 +1,23 @@ vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) -vcpkg_find_acquire_program(PYTHON3) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO apache/qpid-proton REF fee5e94afb83b92ffa60a6f815d5102a67915166 # 0.37.0 SHA512 e9fbd02444dd073908186e6873b4e230e0a5971929e9b1a49758240d166f6da4e6c88d701c66d5e5539bea0beca380c763bffcef5b0e1ed5f9fc2691f5f86559 HEAD_REF next + PATCHES fix-dependencies.patch ) +file(REMOVE "${SOURCE_PATH}/tools/cmake/Modules/FindPython.cmake") +file(REMOVE "${SOURCE_PATH}/tools/cmake/Modules/FindOpenSSL.cmake") +file(REMOVE "${SOURCE_PATH}/tools/cmake/Modules/FindJsonCpp.cmake") + +vcpkg_find_acquire_program(PYTHON3) + vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" + DISABLE_PARALLEL_CONFIGURE # It may cause call CHECK_LIBRARY_EXISTS before call project to set the language OPTIONS -DBUILD_GO=no -DCMAKE_DISABLE_FIND_PACKAGE_CyrusSASL=ON @@ -22,36 +28,32 @@ vcpkg_cmake_configure( -DENABLE_BENCHMARKS=OFF -DENABLE_FUZZ_TESTING=OFF -DBUILD_TESTING=OFF - -DPYTHON_EXECUTABLE=${PYTHON3} + -DPython_EXECUTABLE=${PYTHON3} ) vcpkg_cmake_install() +# qpid-proton installs tests into share/proton; this is not desireable +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/proton") + vcpkg_copy_pdbs() -vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake) -set(configFiles - "${CURRENT_PACKAGES_DIR}/share/${PORT}/Proton/ProtonConfig.cmake" - "${CURRENT_PACKAGES_DIR}/share/${PORT}/ProtonCpp/ProtonCppConfig.cmake" +vcpkg_cmake_config_fixup( + PACKAGE_NAME Proton + CONFIG_PATH lib/cmake/Proton + DO_NOT_DELETE_PARENT_CONFIG_PATH +) +vcpkg_cmake_config_fixup( + PACKAGE_NAME ProtonCpp + CONFIG_PATH lib/cmake/ProtonCpp ) -foreach(configFile IN LISTS configFiles) - vcpkg_replace_string("${configFile}" - "IMPORTED_LOCATION_DEBUG \"\${_IMPORT_PREFIX}/lib" - "IMPORTED_LOCATION_DEBUG \"\${_IMPORT_PREFIX}/debug/lib" - ) - vcpkg_replace_string("${configFile}" - "debug \${_IMPORT_PREFIX}/lib" - "debug \${_IMPORT_PREFIX}/debug/lib" - ) -endforeach() vcpkg_fixup_pkgconfig() -configure_file(${CMAKE_CURRENT_LIST_DIR}/qpid-protonConfig.cmake - ${CURRENT_PACKAGES_DIR}/share/${PORT}/qpid-protonConfig.cmake COPYONLY) -file(RENAME "${CURRENT_PACKAGES_DIR}/share/proton/LICENSE.txt" - "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright") - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/proton") vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/proton/version.h" "#define PN_INSTALL_PREFIX \"${CURRENT_PACKAGES_DIR}\"" "") + +file(INSTALL "${SOURCE_PATH}/LICENSE.txt" + DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" + RENAME copyright +) diff --git a/ports/qpid-proton/qpid-protonConfig.cmake b/ports/qpid-proton/qpid-protonConfig.cmake deleted file mode 100644 index 3ad039bd6f9138..00000000000000 --- a/ports/qpid-proton/qpid-protonConfig.cmake +++ /dev/null @@ -1,4 +0,0 @@ -get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../" ABSOLUTE) -set(_IMPORT_PREFIX "${PACKAGE_PREFIX_DIR}") -include(${CMAKE_CURRENT_LIST_DIR}/Proton/ProtonConfig.cmake) -include(${CMAKE_CURRENT_LIST_DIR}/ProtonCpp/ProtonCppConfig.cmake) diff --git a/ports/qpid-proton/vcpkg.json b/ports/qpid-proton/vcpkg.json index 5285646cc308d4..604cb1df4db42d 100644 --- a/ports/qpid-proton/vcpkg.json +++ b/ports/qpid-proton/vcpkg.json @@ -1,6 +1,7 @@ { "name": "qpid-proton", "version": "0.37.0", + "port-version": 1, "description": "Qpid Proton is a high-performance, lightweight messaging library.", "homepage": "https://github.com/apache/qpid-proton", "license": "Apache-2.0", @@ -12,7 +13,7 @@ }, { "name": "openssl", - "platform": "!windows & !uwp" + "platform": "!windows" }, { "name": "vcpkg-cmake", diff --git a/versions/baseline.json b/versions/baseline.json index 706db365506569..de6fc7f9047262 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5650,7 +5650,7 @@ }, "qpid-proton": { "baseline": "0.37.0", - "port-version": 0 + "port-version": 1 }, "qscintilla": { "baseline": "2.12.0", diff --git a/versions/q-/qpid-proton.json b/versions/q-/qpid-proton.json index a7a727c359d93c..2b30ab71e1571f 100644 --- a/versions/q-/qpid-proton.json +++ b/versions/q-/qpid-proton.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "543baa82530f5eb5ed9b3d6348a14b5e24ccda64", + "version": "0.37.0", + "port-version": 1 + }, { "git-tree": "720cc65a7b408878662ce7c749211fa7edaf25fd", "version": "0.37.0",