From 896800c86f430d0cc22a42850ee6b711e5043a48 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Wed, 28 Jun 2023 10:06:03 +0200 Subject: [PATCH] [libssh] Update to 0.10.5 (#32231) * [libssh] Update to 0.10.5 * Fix pc file for mingw on linux * Fix exported config * Update ci baseline * Update usage * Revert "Update ci baseline" --------- Co-authored-by: Cheney-Wang <850426846@qq.com> --- ports/libssh/0001-export-pkgconfig-file.patch | 4 +-- ports/libssh/portfile.cmake | 30 +++++++++++-------- ports/libssh/usage | 2 +- ports/libssh/vcpkg.json | 3 +- versions/baseline.json | 4 +-- versions/l-/libssh.json | 5 ++++ 6 files changed, 29 insertions(+), 19 deletions(-) diff --git a/ports/libssh/0001-export-pkgconfig-file.patch b/ports/libssh/0001-export-pkgconfig-file.patch index 368ba83b8c..9e325b84ef 100644 --- a/ports/libssh/0001-export-pkgconfig-file.patch +++ b/ports/libssh/0001-export-pkgconfig-file.patch @@ -18,7 +18,7 @@ index 741dc61..42f0e8f 100644 + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc "\nLibs.private: -lmbedcrypto -lpthread") + else () + if (WIN32) -+ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc "\nLibs.private: -llibcrypto -lUser32 -lCrypt32") ++ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc "\nLibs.private: -llibcrypto -luser32 -lcrypt32") + else () + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc " libcrypto\nLibs.private:") + endif () @@ -27,7 +27,7 @@ index 741dc61..42f0e8f 100644 + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc " -lpthread") + endif () + if (WIN32) -+ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc " -lws2_32 -lShell32 -lAdvapi32") ++ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc " -lws2_32 -lshell32 -ladvapi32") + endif () install( FILES diff --git a/ports/libssh/portfile.cmake b/ports/libssh/portfile.cmake index 7117211348..21747388a5 100644 --- a/ports/libssh/portfile.cmake +++ b/ports/libssh/portfile.cmake @@ -1,8 +1,10 @@ -vcpkg_from_git( - OUT_SOURCE_PATH SOURCE_PATH - URL https://git.libssh.org/projects/libssh.git - REF 9941e89f307e73352d887cac14e4e26b481a0a82 # Latest commit on 2022-11-23 - FETCH_REF master +vcpkg_download_distfile(distfile + URLS https://www.libssh.org/files/0.10/libssh-${VERSION}.tar.xz + FILENAME libssh-${VERSION}.tar.xz + SHA512 2b758f9df2b5937865d4aee775ffeafafe3ae6739a89dfc470e38c7394e3c3cb5fcf8f842fdae04929890ee7e47bf8f50e3a38e82dfd26a009f3aae009d589e0 +) +vcpkg_extract_source_archive(SOURCE_PATH + ARCHIVE "${distfile}" PATCHES 0001-export-pkgconfig-file.patch 0002-mingw_for_Android.patch @@ -35,7 +37,6 @@ vcpkg_cmake_configure( -DWITH_SYMBOL_VERSIONING=OFF) vcpkg_cmake_install() -vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT}) vcpkg_copy_pdbs() #Fixup pthread naming if(NOT VCPKG_TARGET_IS_MINGW AND VCPKG_TARGET_IS_WINDOWS) @@ -55,14 +56,19 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") ) endif() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/libssh) +file(READ "${CURRENT_PACKAGES_DIR}/share/libssh/libssh-config.cmake" cmake_config) if(VCPKG_TARGET_IS_WINDOWS) - vcpkg_replace_string( - "${CURRENT_PACKAGES_DIR}/share/libssh/libssh-config.cmake" - ".dll" - ".lib" - ) + string(REPLACE ".dll" ".lib" cmake_config "${cmake_config}") endif() +file(WRITE "${CURRENT_PACKAGES_DIR}/share/libssh/libssh-config.cmake" +"include(CMakeFindDependencyMacro) +set(THREADS_PREFER_PTHREAD_FLAG ON) +find_dependency(Threads) +${cmake_config} +") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") -file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) file(INSTALL "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING") diff --git a/ports/libssh/usage b/ports/libssh/usage index 39cb551c35..12998496cb 100644 --- a/ports/libssh/usage +++ b/ports/libssh/usage @@ -1,4 +1,4 @@ -The package libssh is compatible with built-in CMake targets: +libssh provides CMake targets: find_package(libssh CONFIG REQUIRED) target_link_libraries(main PRIVATE ssh) diff --git a/ports/libssh/vcpkg.json b/ports/libssh/vcpkg.json index dfdc88278f..3d756a52af 100644 --- a/ports/libssh/vcpkg.json +++ b/ports/libssh/vcpkg.json @@ -1,7 +1,6 @@ { "name": "libssh", - "version": "0.10.4+20221123", - "port-version": 4, + "version": "0.10.5", "description": "libssh is a multiplatform C library implementing the SSHv2 protocol on client and server side", "homepage": "https://www.libssh.org/", "license": "LGPL-2.1-only", diff --git a/versions/baseline.json b/versions/baseline.json index f447de2c05..e4787152e2 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4605,8 +4605,8 @@ "port-version": 3 }, "libssh": { - "baseline": "0.10.4+20221123", - "port-version": 4 + "baseline": "0.10.5", + "port-version": 0 }, "libssh2": { "baseline": "1.11.0", diff --git a/versions/l-/libssh.json b/versions/l-/libssh.json index b2e799dd00..fe66450574 100644 --- a/versions/l-/libssh.json +++ b/versions/l-/libssh.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "d6af07ebaeb4ab52ff509bc7637ad1d278d3d16b", + "version": "0.10.5", + "port-version": 0 + }, { "git-tree": "d2f4d398d1b82025b8aec8dba4e844f867286d38", "version": "0.10.4+20221123",