Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libssh/libressl] update to the latest version #20067

Merged
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions ports/libressl/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ endif()

vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp")

set(LIBRESSL_VERSION 3.3.3)
set(LIBRESSL_HASH 2d0b5f4cfe37d573bc64d5967abb77f536dbe581fbad9637d925332bcdfd185fe6810335b2af80a89f92d7e6edaa8ea3ba2492c60a117e47ea1b2d6aacf01f0f)
set(LIBRESSL_VERSION 3.3.4)
set(LIBRESSL_HASH 11defdde8169d3653c24e149e698ffc5a8ead5ac0808111d1986cb11ef72e9912c463d4891d4635877021e73a8a045dbdbe5e83ec785a59150f170d2ca2031de)

vcpkg_download_distfile(
LIBRESSL_SOURCE_ARCHIVE
Expand All @@ -30,26 +30,19 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
"tools" LIBRESSL_APPS
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
-DLIBRESSL_TESTS=OFF
OPTIONS_DEBUG
-DLIBRESSL_APPS=OFF
)

vcpkg_install_cmake()
vcpkg_cmake_install()

if("tools" IN_LIST FEATURES)
if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP)
set(EXECUTABLE_SUFFIX .exe)
endif()
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/openssl")
file(RENAME "${CURRENT_PACKAGES_DIR}/bin/openssl${EXECUTABLE_SUFFIX}" "${CURRENT_PACKAGES_DIR}/tools/openssl/openssl${EXECUTABLE_SUFFIX}")
file(RENAME "${CURRENT_PACKAGES_DIR}/bin/ocspcheck${EXECUTABLE_SUFFIX}" "${CURRENT_PACKAGES_DIR}/tools/openssl/ocspcheck${EXECUTABLE_SUFFIX}")
vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/openssl")
vcpkg_copy_tools(TOOL_NAMES ocspcheck openssl AUTO_CLEAN)
JonLiu1993 marked this conversation as resolved.
Show resolved Hide resolved
endif()

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
Expand Down
12 changes: 11 additions & 1 deletion ports/libressl/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
{
"name": "libressl",
"version": "3.3.3",
"version": "3.3.4",
"description": "LibreSSL is a version of the TLS/crypto stack forked from OpenSSL in 2014, with goals of modernizing the codebase, improving security, and applying best practice development processes.",
"supports": "!(uwp | arm)",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"tools": {
"description": "Build openssl and ocspcheck executables"
Expand Down
13 changes: 5 additions & 8 deletions ports/libssh/0002-mingw_for_Android.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ccf5a33..8e88494 100644
index a576cf7..1f6a048 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -361,9 +361,9 @@ if (WITH_VISIBILITY_HIDDEN)
set_target_properties(ssh PROPERTIES COMPILE_FLAGS "-fvisibility=hidden")
@@ -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)
JonLiu1993 marked this conversation as resolved.
Show resolved Hide resolved
set_target_properties(ssh PROPERTIES LINK_FLAGS "-Wl,--enable-stdcall-fixup")
- set_target_properties(ssh PROPERTIES COMPILE_FLAGS "-D_POSIX_SOURCE")
+ set_property(TARGET ssh APPEND PROPERTY COMPILE_FLAGS "-D_POSIX_SOURCE")
target_link_libraries(ssh PRIVATE "-Wl,--enable-stdcall-fixup")
target_compile_definitions(ssh PRIVATE "_POSIX_SOURCE")
endif ()


11 changes: 6 additions & 5 deletions ports/libssh/0003-create_symlink_unix_only.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1f5b0bf..6559468 100644
index 53e6bd5..51d76c5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -206,9 +206,11 @@ endif (WITH_SYMBOL_VERSIONING AND ABIMAP_FOUND)
add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source DEPENDS ${_SYMBOL_TARGET})
@@ -231,10 +231,11 @@ 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 -E create_symlink
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
"${CMAKE_BINARY_DIR}/compile_commands.json"
"${CMAKE_SOURCE_DIR}/compile_commands.json")
-
+endif()

message(STATUS "********************************************")
message(STATUS "********** ${PROJECT_NAME} build options : **********")

28 changes: 13 additions & 15 deletions ports/libssh/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ vcpkg_fail_port_install(ON_TARGET "UWP")
vcpkg_from_git(
OUT_SOURCE_PATH SOURCE_PATH
URL https://git.libssh.org/projects/libssh.git
REF 9c4af47965d284b2de26407bcd80473aba4ee4c9 # REFERENCE VERSION 0.9.5
SHA512 64e692a0bfa7f73585ea7b7b8b1d4c9a7f9be59565bfd4de32ca8cd9db121f87e7ad51f5c80269fbd99545af34dcf1894374ed8a6d6c1ac5f8601c026572ac18
REF 47fd6e56c1058dca54afee1638c11fb6ec41911d # REFERENCE VERSION 0.9.6
PATCHES
0001-export-pkgconfig-file.patch
0002-mingw_for_Android.patch
Expand All @@ -13,8 +12,8 @@ vcpkg_from_git(

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
mbedtls WITH_MBEDTLS
zlib WITH_ZLIB
mbedtls WITH_MBEDTLS
zlib WITH_ZLIB
)

if (VCPKG_TARGET_IS_ANDROID)
Expand All @@ -23,9 +22,8 @@ if (VCPKG_TARGET_IS_ANDROID)
)
endif ()

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${EXTRA_ARGS}
${FEATURE_OPTIONS}
Expand All @@ -36,8 +34,8 @@ vcpkg_configure_cmake(
-DWITH_NACL=OFF
-DWITH_GSSAPI=OFF)

vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT})
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)
Expand All @@ -49,22 +47,22 @@ endif()
vcpkg_fixup_pkgconfig()

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
vcpkg_replace_string(
${CURRENT_PACKAGES_DIR}/include/libssh/libssh.h
"${CURRENT_PACKAGES_DIR}/include/libssh/libssh.h"
"#ifdef LIBSSH_STATIC"
"#if 1"
)
endif()

if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_replace_string(
${CURRENT_PACKAGES_DIR}/share/libssh/libssh-config.cmake
"${CURRENT_PACKAGES_DIR}/share/libssh/libssh-config.cmake"
".dll"
".lib"
)
endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
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})
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}")
11 changes: 9 additions & 2 deletions ports/libssh/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "libssh",
"version-string": "0.9.5",
"port-version": 6,
"version": "0.9.6",
"description": "libssh is a multiplatform C library implementing the SSHv2 protocol on client and server side",
"homepage": "https://www.libssh.org/",
"supports": "!(uwp | arm)",
Expand All @@ -13,6 +12,14 @@
"mbedtls"
],
"platform": "android"
},
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"default-features": [
Expand Down
18 changes: 10 additions & 8 deletions ports/libssh2/0001-Fix-UWP.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6401acf..64de3e9 100644
index eee1a80..2539607 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -349,7 +349,7 @@ target_include_directories(libssh2 PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
@@ -354,7 +354,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.
Expand All @@ -12,12 +12,12 @@ index 6401acf..64de3e9 100644
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
index 85c3e34..19768d4 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -51,6 +51,10 @@
#include "userauth.h"
#include "session.h"
@@ -55,6 +55,10 @@
#include <stdlib.h>
#endif

+#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP)
+#define IS_UWP 1
Expand All @@ -26,7 +26,7 @@ index c2ba422..f1799f8 100644
/* 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 = {
@@ -245,7 +249,7 @@ struct agent_ops agent_ops_unix = {
};
#endif /* PF_UNIX */

Expand All @@ -35,14 +35,16 @@ index c2ba422..f1799f8 100644
/* Code to talk to Pageant was taken from PuTTY.
*
* Portions copyright Robert de Bath, Joris van Rantwijk, Delian
@@ -362,8 +366,8 @@ static struct {
@@ -354,9 +358,9 @@ static struct {
const char *name;
struct agent_ops *ops;
} supported_backends[] = {
-#ifdef WIN32
- {"Pageant", &agent_ops_pageant},
- {"OpenSSH", &agent_ops_openssh},
+#if defined(WIN32) && !defined(IS_UWP)
+ {"Pageant", &agent_ops_pageant},
+ {"OpenSSH", &agent_ops_openssh},
#endif /* WIN32 */
#ifdef PF_UNIX
{"Unix", &agent_ops_unix},
16 changes: 16 additions & 0 deletions ports/libssh2/fix-dellexport.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d9f3a37..ce9712c 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -354,9 +354,9 @@ 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 PRIVATE LIBSSH2_WIN32 _WINDLL)
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
- target_compile_definitions(libssh2 PRIVATE LIBSSH2_DARWIN)
+ target_compile_definitions(libssh2 PRIVATE LIBSSH2_DARWIN _WINDLL)
endif()

if(MSVC)
13 changes: 13 additions & 0 deletions ports/libssh2/fix-error-c2065.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/agent_win.c b/src/agent_win.c
index a1605a9..81f6881 100644
--- a/src/agent_win.c
+++ b/src/agent_win.c
@@ -36,7 +36,7 @@
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*/
-
+#define HANDLE_FLAG_INHERIT 0x00000001
#include "libssh2_priv.h"
#include "agent.h"
#include "misc.h"
12 changes: 12 additions & 0 deletions ports/libssh2/fix-pkgconfig.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 3965bb8..ce9712c 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -68,7 +68,6 @@ if(CRYPTO_BACKEND STREQUAL "OpenSSL" OR NOT CRYPTO_BACKEND)
list(APPEND PRIVATE_COMPILE_DEFINITIONS LIBSSH2_OPENSSL)
list(APPEND PRIVATE_INCLUDE_DIRECTORIES ${OPENSSL_INCLUDE_DIR})
list(APPEND LIBRARIES ${OPENSSL_LIBRARIES})
- list(APPEND PC_REQUIRES_PRIVATE libssl libcrypto)

if (WIN32)
# Statically linking to OpenSSL requires crypt32 for some Windows APIs.
32 changes: 17 additions & 15 deletions ports/libssh2/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libssh2/libssh2
REF 42d37aa63129a1b2644bf6495198923534322d64
SHA512 e86c0787e2aa7be5e9f19356e543493e53c7d1b51b585c46facfb05f769e6491209f820b207bf594348f4760c492c32dda3fcc94fc0af93cb09c736492a8e231
REF 635caa90787220ac3773c1d5ba11f1236c22eae8 #v1.10.0
SHA512 ccc3328565e6840464345ac4fa093293733f3320e36358e87d18d5eabc7c250e855c03b058703a1c2a7c8e005335c671e3cdf6ee937322edf1c7812026f71534
HEAD_REF master
PATCHES "${CMAKE_CURRENT_LIST_DIR}/0001-Fix-UWP.patch"
PATCHES
0001-Fix-UWP.patch
fix-dellexport.patch
fix-pkgconfig.patch
fix-error-c2065.patch #fix error C2065: 'HANDLE_FLAG_INHERIT': undeclared identifier
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_EXAMPLES=OFF
-DBUILD_TESTING=OFF
Expand All @@ -17,16 +21,14 @@ vcpkg_configure_cmake(
-DENABLE_DEBUG_LOGGING=OFF
)

vcpkg_install_cmake()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/pkgconfig)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share)
vcpkg_cmake_install()
vcpkg_fixup_pkgconfig()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/libssh2)
vcpkg_copy_pdbs()

vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/libssh2)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share")

file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libssh2 RENAME copyright)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

vcpkg_copy_pdbs()
11 changes: 9 additions & 2 deletions ports/libssh2/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
{
"name": "libssh2",
"version-string": "1.9.0",
"port-version": 1,
"version": "1.10.0",
"description": "The SSH library",
"homepage": "https://www.libssh2.org",
"dependencies": [
"openssl",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
"zlib"
]
}
10 changes: 5 additions & 5 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -3673,7 +3673,7 @@
"port-version": 1
},
"libressl": {
"baseline": "3.3.3",
"baseline": "3.3.4",
"port-version": 0
},
"librsvg": {
Expand Down Expand Up @@ -3761,12 +3761,12 @@
"port-version": 1
},
"libssh": {
"baseline": "0.9.5",
"port-version": 6
"baseline": "0.9.6",
"port-version": 0
},
"libssh2": {
"baseline": "1.9.0",
"port-version": 1
"baseline": "1.10.0",
"port-version": 0
},
"libstemmer": {
"baseline": "2017-9",
Expand Down
Loading