From 9c5b59bd4282b112776b4b391fd59e122c504f2e Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sat, 6 Jul 2024 17:18:38 +0200 Subject: [PATCH 1/5] [libssh] Update to 0.10.6 --- ports/libssh/portfile.cmake | 2 +- ports/libssh/vcpkg.json | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ports/libssh/portfile.cmake b/ports/libssh/portfile.cmake index 61807fa1f481ae..a83267db3d0528 100644 --- a/ports/libssh/portfile.cmake +++ b/ports/libssh/portfile.cmake @@ -1,7 +1,7 @@ vcpkg_download_distfile(distfile URLS https://www.libssh.org/files/0.10/libssh-${VERSION}.tar.xz FILENAME libssh-${VERSION}.tar.xz - SHA512 2b758f9df2b5937865d4aee775ffeafafe3ae6739a89dfc470e38c7394e3c3cb5fcf8f842fdae04929890ee7e47bf8f50e3a38e82dfd26a009f3aae009d589e0 + SHA512 40c62d63c44e882999b71552c237d73fc7364313bd00b15a211a34aeff1b73693da441d2c8d4e40108d00fb7480ec7c5b6d472f9c0784b2359a179632ab0d6c1 ) vcpkg_extract_source_archive(SOURCE_PATH ARCHIVE "${distfile}" diff --git a/ports/libssh/vcpkg.json b/ports/libssh/vcpkg.json index 1d1c3c58dca569..d2a2692ffa4578 100644 --- a/ports/libssh/vcpkg.json +++ b/ports/libssh/vcpkg.json @@ -1,7 +1,6 @@ { "name": "libssh", - "version": "0.10.5", - "port-version": 2, + "version": "0.10.6", "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", From ff219fdff67b0050cb5188431e591373877fc12d Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sat, 6 Jul 2024 17:19:52 +0200 Subject: [PATCH 2/5] [libssh] Add pcap and server features --- ports/libssh/portfile.cmake | 8 ++------ ports/libssh/vcpkg.json | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/ports/libssh/portfile.cmake b/ports/libssh/portfile.cmake index a83267db3d0528..765ff3d9d6bf9d 100644 --- a/ports/libssh/portfile.cmake +++ b/ports/libssh/portfile.cmake @@ -14,18 +14,14 @@ vcpkg_extract_source_archive(SOURCE_PATH vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES + pcap WITH_PCAP + server WITH_SERVER zlib WITH_ZLIB ) -if (VCPKG_TARGET_IS_ANDROID) - set(EXTRA_ARGS "-DWITH_SERVER=FALSE" - "-DWITH_PCAP=FALSE") -endif () - vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS - ${EXTRA_ARGS} ${FEATURE_OPTIONS} -DWITH_EXAMPLES=OFF -DUNIT_TESTING=OFF diff --git a/ports/libssh/vcpkg.json b/ports/libssh/vcpkg.json index d2a2692ffa4578..49c1f760b2504f 100644 --- a/ports/libssh/vcpkg.json +++ b/ports/libssh/vcpkg.json @@ -19,9 +19,25 @@ "host": true } ], + "default-features": [ + { + "name": "pcap", + "platform": "!android" + }, + { + "name": "server", + "platform": "!android" + } + ], "features": { + "pcap": { + "description": "SSH server support" + }, + "server": { + "description": "Pcap generation support" + }, "zlib": { - "description": "libssh with zlib", + "description": "zlib compression support", "dependencies": [ "zlib" ] From dc3698844f0800236d8bf3288297cc648b25bba7 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sat, 6 Jul 2024 17:33:31 +0200 Subject: [PATCH 3/5] [libssh] Cleanup --- ports/libssh/portfile.cmake | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ports/libssh/portfile.cmake b/ports/libssh/portfile.cmake index 765ff3d9d6bf9d..e6da95001f3c43 100644 --- a/ports/libssh/portfile.cmake +++ b/ports/libssh/portfile.cmake @@ -23,13 +23,12 @@ vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS ${FEATURE_OPTIONS} + -DCMAKE_REQUIRE_FIND_PACKAGE_OpenSSL=ON -DWITH_EXAMPLES=OFF - -DUNIT_TESTING=OFF - -DCLIENT_TESTING=OFF - -DSERVER_TESTING=OFF - -DWITH_NACL=OFF -DWITH_GSSAPI=OFF - -DWITH_SYMBOL_VERSIONING=OFF) + -DWITH_NACL=OFF + -DWITH_SYMBOL_VERSIONING=OFF +) vcpkg_cmake_install() vcpkg_copy_pdbs() From 04b212165e2f89f2b7475c3a8f16e0d70632fde0 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sat, 6 Jul 2024 17:33:49 +0200 Subject: [PATCH 4/5] [libssh] Update pkgconfig --- ports/libssh/0001-export-pkgconfig-file.patch | 83 +++++++++++++------ ports/libssh/portfile.cmake | 7 -- 2 files changed, 58 insertions(+), 32 deletions(-) diff --git a/ports/libssh/0001-export-pkgconfig-file.patch b/ports/libssh/0001-export-pkgconfig-file.patch index 9e325b84ef899d..bd4e4c03d59b25 100644 --- a/ports/libssh/0001-export-pkgconfig-file.patch +++ b/ports/libssh/0001-export-pkgconfig-file.patch @@ -1,38 +1,47 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 741dc61..42f0e8f 100644 +index a64b770..716bb34 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -124,8 +124,28 @@ add_subdirectory(include) +@@ -43,8 +43,12 @@ macro_ensure_out_of_source_build("${PROJECT_NAME} requires an out of source buil + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") + + # search for libraries ++set(PC_LIBS_PRIVATE "") ++set(PC_REQUIRES_PRIVATE "") ++ + if (WITH_ZLIB) + find_package(ZLIB REQUIRED) ++ string(APPEND PC_REQUIRES_PRIVATE "zlib") + endif (WITH_ZLIB) + + if (WITH_GCRYPT) +@@ -60,6 +64,7 @@ elseif(WITH_MBEDTLS) + else (WITH_GCRYPT) + find_package(OpenSSL 1.0.1) + if (OPENSSL_FOUND) ++ string(APPEND PC_REQUIRES_PRIVATE " libcrypto") + # On CMake < 3.16, OPENSSL_CRYPTO_LIBRARIES is usually a synonym for OPENSSL_CRYPTO_LIBRARY, but is not defined + # when building on Windows outside of Cygwin. We provide the synonym here, if FindOpenSSL didn't define it already. + if (NOT DEFINED OPENSSL_CRYPTO_LIBRARIES) +@@ -84,6 +89,9 @@ endif () + set(CMAKE_THREAD_PREFER_PTHREADS ON) + set(THREADS_PREFER_PTHREAD_FLAG ON) + find_package(Threads) ++if(Threads_FOUND) ++ string(APPEND PC_LIBS_PRIVATE " ${CMAKE_THREAD_LIBS_INIT}") ++endif() + + if (WITH_GSSAPI) + find_package(GSSAPI) +@@ -122,7 +130,6 @@ add_subdirectory(include) add_subdirectory(src) # pkg-config file -if (UNIX OR MINGW) configure_file(libssh.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc @ONLY) -+ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc "Requires:") -+ if (WITH_ZLIB) -+ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc " zlib") -+ endif () -+ if (WITH_GCRYPT) -+ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc "\nLibs.private: -lgcrypt") -+ elseif (WITH_MBEDTLS) -+ 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") -+ else () -+ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc " libcrypto\nLibs.private:") -+ endif () -+ endif () -+ if (CMAKE_USE_PTHREADS_INIT) -+ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc " -lpthread") -+ endif () -+ if (WIN32) -+ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc " -lws2_32 -lshell32 -ladvapi32") -+ endif () install( FILES - ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc -@@ -134,7 +154,6 @@ install( +@@ -132,7 +139,6 @@ install( COMPONENT pkgconfig ) @@ -40,3 +49,27 @@ index 741dc61..42f0e8f 100644 # CMake config files include(CMakePackageConfigHelpers) +diff --git a/libssh.pc.cmake b/libssh.pc.cmake +index f288b94..759525c 100644 +--- a/libssh.pc.cmake ++++ b/libssh.pc.cmake +@@ -7,4 +7,6 @@ Name: @PROJECT_NAME@ + Description: The SSH Library + Version: @PROJECT_VERSION@ + Libs: -L${libdir} -lssh ++Libs.private: @PC_LIBS_PRIVATE@ ++Requires.private: @PC_REQUIRES_PRIVATE@ + Cflags: -I${includedir} +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 807313b..72ef059 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -94,6 +94,8 @@ if (WIN32) + iphlpapi + ws2_32 + ) ++ string(APPEND PC_LIBS_PRIVATE " -liphlpapi -lws2_32 -lshell32 -ladvapi32") ++ set(PC_LIBS_PRIVATE "${PC_LIBS_PRIVATE}" PARENT_SCOPE) + endif (WIN32) + + if (BUILD_STATIC_LIB) diff --git a/ports/libssh/portfile.cmake b/ports/libssh/portfile.cmake index e6da95001f3c43..a6e8aa42eaab9c 100644 --- a/ports/libssh/portfile.cmake +++ b/ports/libssh/portfile.cmake @@ -32,13 +32,6 @@ vcpkg_cmake_configure( vcpkg_cmake_install() vcpkg_copy_pdbs() -#Fixup pthread naming -if(NOT VCPKG_TARGET_IS_MINGW AND VCPKG_TARGET_IS_WINDOWS) - if(NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libssh.pc" "-lpthread" "-lpthreadVC3d" IGNORE_UNCHANGED) - endif() - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libssh.pc" "-lpthread" "-lpthreadVC3" IGNORE_UNCHANGED) -endif() vcpkg_fixup_pkgconfig() if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") From 2c1abf71dcf82af6b43bb07fd38b8b9f49f1457b Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sat, 6 Jul 2024 17:47:10 +0200 Subject: [PATCH 5/5] [libssh] More cleanup --- ports/libssh/0002-mingw_for_Android.patch | 13 ------------ ..._only.patch => 0003-no-source-write.patch} | 15 ++++++-------- ports/libssh/portfile.cmake | 20 +++++++------------ ports/libssh/usage | 4 ---- versions/baseline.json | 4 ++-- versions/l-/libssh.json | 5 +++++ 6 files changed, 20 insertions(+), 41 deletions(-) delete mode 100644 ports/libssh/0002-mingw_for_Android.patch rename ports/libssh/{0003-create_symlink_unix_only.patch => 0003-no-source-write.patch} (54%) delete mode 100644 ports/libssh/usage diff --git a/ports/libssh/0002-mingw_for_Android.patch b/ports/libssh/0002-mingw_for_Android.patch deleted file mode 100644 index 963eb6f61a4b64..00000000000000 --- a/ports/libssh/0002-mingw_for_Android.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index a576cf7..1f6a048 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -359,7 +359,7 @@ if (WITH_VISIBILITY_HIDDEN) - set_target_properties(ssh PROPERTIES C_VISIBILITY_PRESET hidden) - endif (WITH_VISIBILITY_HIDDEN) - --if (MINGW) -+if (MINGW AND NOT ANDROID) - target_link_libraries(ssh PRIVATE "-Wl,--enable-stdcall-fixup") - target_compile_definitions(ssh PRIVATE "_POSIX_SOURCE") - endif () diff --git a/ports/libssh/0003-create_symlink_unix_only.patch b/ports/libssh/0003-no-source-write.patch similarity index 54% rename from ports/libssh/0003-create_symlink_unix_only.patch rename to ports/libssh/0003-no-source-write.patch index 20b2b646233e62..865fd0d2b7e6f3 100644 --- a/ports/libssh/0003-create_symlink_unix_only.patch +++ b/ports/libssh/0003-no-source-write.patch @@ -1,17 +1,14 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 53e6bd5..51d76c5 100644 +index d066cde..d2a11cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -231,10 +231,11 @@ endif (WITH_SYMBOL_VERSIONING AND ABIMAP_FOUND) +@@ -224,9 +224,6 @@ endif (WITH_SYMBOL_VERSIONING AND ABIMAP_FOUND) add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source DEPENDS ${_SYMBOL_TARGET} VERBATIM) # Link compile database for clangd -+if(UNIX) - execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink - "${CMAKE_BINARY_DIR}/compile_commands.json" - "${CMAKE_SOURCE_DIR}/compile_commands.json") -- -+endif() +-execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink +- "${CMAKE_BINARY_DIR}/compile_commands.json" +- "${CMAKE_SOURCE_DIR}/compile_commands.json") + message(STATUS "********************************************") message(STATUS "********** ${PROJECT_NAME} build options : **********") - diff --git a/ports/libssh/portfile.cmake b/ports/libssh/portfile.cmake index a6e8aa42eaab9c..6886bba903c5c1 100644 --- a/ports/libssh/portfile.cmake +++ b/ports/libssh/portfile.cmake @@ -7,8 +7,7 @@ vcpkg_extract_source_archive(SOURCE_PATH ARCHIVE "${distfile}" PATCHES 0001-export-pkgconfig-file.patch - 0002-mingw_for_Android.patch - 0003-create_symlink_unix_only.patch + 0003-no-source-write.patch 0004-file-permissions-constants.patch ) @@ -35,27 +34,22 @@ vcpkg_copy_pdbs() vcpkg_fixup_pkgconfig() if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") - vcpkg_replace_string( - "${CURRENT_PACKAGES_DIR}/include/libssh/libssh.h" + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/libssh/libssh.h" "#ifdef LIBSSH_STATIC" "#if 1" ) 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) - string(REPLACE ".dll" ".lib" cmake_config "${cmake_config}") -endif() -file(WRITE "${CURRENT_PACKAGES_DIR}/share/libssh/libssh-config.cmake" -"include(CMakeFindDependencyMacro) +file(WRITE "${CURRENT_PACKAGES_DIR}/share/libssh/libssh-config.cmake" " +include(CMakeFindDependencyMacro) set(THREADS_PREFER_PTHREAD_FLAG ON) find_dependency(Threads) -${cmake_config} -") +${cmake_config}" +) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") -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 deleted file mode 100644 index 12998496cb6ed9..00000000000000 --- a/ports/libssh/usage +++ /dev/null @@ -1,4 +0,0 @@ -libssh provides CMake targets: - - find_package(libssh CONFIG REQUIRED) - target_link_libraries(main PRIVATE ssh) diff --git a/versions/baseline.json b/versions/baseline.json index 277d918c117b38..9202e7a9086faa 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5037,8 +5037,8 @@ "port-version": 1 }, "libssh": { - "baseline": "0.10.5", - "port-version": 2 + "baseline": "0.10.6", + "port-version": 0 }, "libssh2": { "baseline": "1.11.0", diff --git a/versions/l-/libssh.json b/versions/l-/libssh.json index 81ddc5675641aa..1728c9d7477ad9 100644 --- a/versions/l-/libssh.json +++ b/versions/l-/libssh.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "0e899f7f2836ea17c95413604158205e5afb8378", + "version": "0.10.6", + "port-version": 0 + }, { "git-tree": "ceea3a79b4ab71a4cb342b33b1c9f95137b87a1b", "version": "0.10.5",