[libssh2] Update to 0.11.0 (#32232)

* [libssh2] Update to 1.11.0

* Control usage
This commit is contained in:
Kai Pastor 2023-06-26 22:07:06 +02:00 committed by GitHub
parent 8f3e8d6e95
commit 23fa37729d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 19 additions and 109 deletions

View File

@ -1,64 +0,0 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6401acf..64de3e9 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -349,7 +349,7 @@ target_include_directories(libssh2 PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
# Check for the OS.
# Daniel's note: this should not be necessary and we need to work to
# get this removed.
-if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
+if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows" OR ${CMAKE_SYSTEM_NAME} STREQUAL "WindowsStore")
target_compile_definitions(libssh2 PRIVATE LIBSSH2_WIN32)
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
target_compile_definitions(libssh2 PRIVATE LIBSSH2_DARWIN)
diff --git a/src/agent.c b/src/agent.c
index c2ba422..f1799f8 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -55,6 +55,10 @@
#include <stdlib.h>
#endif
+#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP)
+#define IS_UWP 1
+#endif /* #if defined(WINAPI_FAMILY) */
+
/* Requests from client to agent for protocol 1 key operations */
#define SSH_AGENTC_REQUEST_RSA_IDENTITIES 1
#define SSH_AGENTC_RSA_CHALLENGE 3
@@ -254,7 +258,7 @@ struct agent_ops agent_ops_unix = {
};
#endif /* PF_UNIX */
-#ifdef WIN32
+#if defined(WIN32) && !defined(IS_UWP)
/* Code to talk to Pageant was taken from PuTTY.
*
* Portions copyright Robert de Bath, Joris van Rantwijk, Delian
@@ -362,8 +366,8 @@ static struct {
const char *name;
struct agent_ops *ops;
} supported_backends[] = {
-#ifdef WIN32
- {"Pageant", &agent_ops_pageant},
+#if defined(WIN32) && !defined(IS_UWP)
+ {"Pageant", &agent_ops_pageant},
{"OpenSSH", &agent_ops_openssh},
#endif /* WIN32 */
#ifdef PF_UNIX
diff --git a/src/agent_win.c b/src/agent_win.c
--- a/src/agent_win.c
+++ b/src/agent_win.c
@@ -55,7 +55,11 @@
#include <stdlib.h>
#endif
-#ifdef WIN32
+#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP)
+#define IS_UWP 1
+#endif /* #if defined(WINAPI_FAMILY) */
+
+#if defined(WIN32) && !defined(IS_UWP)
/* Code to talk to OpenSSH was taken and modified from the Win32 port of
* Portable OpenSSH by the PowerShell team. Commit
* 8ab565c53f3619d6a1f5ac229e212cad8a52852c of

View File

@ -1,19 +0,0 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 2539607..eceb5a0 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -355,9 +355,12 @@ target_include_directories(libssh2 PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
# Daniel's note: this should not be necessary and we need to work to
# get this removed.
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows" OR ${CMAKE_SYSTEM_NAME} STREQUAL "WindowsStore")
- target_compile_definitions(libssh2 PRIVATE LIBSSH2_WIN32)
+ target_compile_definitions(libssh2 PUBLIC LIBSSH2_WIN32)
+ if (BUILD_SHARED_LIBS)
+ target_compile_definitions(libssh2 PUBLIC _WINDLL PRIVATE LIBSSH2_LIBRARY)
+ endif()
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
- target_compile_definitions(libssh2 PRIVATE LIBSSH2_DARWIN)
+ target_compile_definitions(libssh2 PUBLIC LIBSSH2_DARWIN)
endif()
if(MSVC)

View File

@ -1,13 +0,0 @@
diff --git a/cmake/max_warnings.cmake b/cmake/max_warnings.cmake
index b176d30..e986461 100644
--- a/cmake/max_warnings.cmake
+++ b/cmake/max_warnings.cmake
@@ -13,6 +13,8 @@ if(MSVC)
# Disable broken warnings
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4996")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4996")
elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
if(NOT CMAKE_CXX_FLAGS MATCHES "-Wall")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")

View File

@ -1,19 +1,18 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libssh2/libssh2
REF libssh2-1.10.0
SHA512 615E28880695911F5700CC7AC3DDA6B894384C0B1D8B02B53C2EB58F1839F47211934A292F490AD7DDEF7E63F332E0EBF44F8E6334F64BE8D143C72032356C1F
REF "libssh2-${VERSION}"
SHA512 8ae38d76e7fae82843c7c6990760ad5827cb55e2aba096f684b832016614d76983d1871ae0857ba28efcb9fd65018ae0b34420f6841da6bb6c6ccebd9689ec0f
HEAD_REF master
PATCHES
0001-Fix-UWP.patch
0002-fix-macros.patch
0003-fix-openssl3.patch
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
zlib ENABLE_ZLIB_COMPRESSION
)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
list(APPEND FEATURE_OPTIONS "-DBUILD_STATIC_LIBS:BOOL=OFF")
endif()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
@ -27,6 +26,7 @@ vcpkg_cmake_configure(
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_fixup_pkgconfig()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/libssh2)
@ -41,10 +41,8 @@ endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
# Do not delete the entire share directory as it contains the *-config.cmake files
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/doc")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/man")
vcpkg_fixup_pkgconfig()
file(INSTALL "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

4
ports/libssh2/usage Normal file
View File

@ -0,0 +1,4 @@
libssh2 provides CMake targets:
find_package(Libssh2 CONFIG REQUIRED)
target_link_libraries(main PRIVATE $<IF:$<TARGET_EXISTS:Libssh2::libssh2_shared>,Libssh2::libssh2_shared,Libssh2::libssh2_static>)

View File

@ -1,7 +1,6 @@
{
"name": "libssh2",
"version": "1.10.0",
"port-version": 4,
"version": "1.11.0",
"description": "libssh2 is a client-side C library implementing the SSH2 protocol.",
"homepage": "https://www.libssh2.org",
"license": "BSD-3-Clause",

View File

@ -4605,8 +4605,8 @@
"port-version": 4
},
"libssh2": {
"baseline": "1.10.0",
"port-version": 4
"baseline": "1.11.0",
"port-version": 0
},
"libstemmer": {
"baseline": "2017-9",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "e57c6157ce67a01ce0b98152d9ccfd544e32b381",
"version": "1.11.0",
"port-version": 0
},
{
"git-tree": "5d6f965bcf911a4750731aad9785a4b40686a2b3",
"version": "1.10.0",