Merge pull request #4983 from cryptomilk/master-libssh

[libssh] Update libssh to version 0.9.3
This commit is contained in:
Robert Schumacher 2020-02-05 18:19:25 -08:00 committed by GitHub
commit 53b4fba444
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 31 additions and 136 deletions

View File

@ -1,10 +1,22 @@
Source: libssh
Version: 0.9.0
Version: 0.9.3
Homepage: https://www.libssh.org/
Description: libssh is a multiplatform C library implementing the SSHv2 and SSHv1 protocol on client and server side
Build-Depends: openssl
Description: libssh is a multiplatform C library implementing the SSHv2 protocol on client and server side
Default-Features: crypto
Supports: !uwp
Feature: crypto
Build-Depends: libssh[mbedtls]
Description: Default crypto backend
Feature: mbedtls
Build-Depends: mbedtls
Description: Crypto support (mbedTLS)
Feature: openssl
Build-Depends: openssl
Description: Crypto support (OpenSSL)
Feature: zlib
Description: libssh with zlib
Build-Depends: zlib

View File

@ -1,62 +0,0 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 1012ddf..612f0ba 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -313,6 +313,7 @@ if (WITH_SYMBOL_VERSIONING AND HAVE_LD_VERSION_SCRIPT AND ABIMAP_FOUND)
)
endif (WITH_SYMBOL_VERSIONING AND HAVE_LD_VERSION_SCRIPT AND ABIMAP_FOUND)
+if (NOT WITH_STATIC_LIB)
add_library(${LIBSSH_SHARED_LIBRARY} SHARED ${libssh_SRCS})
target_compile_options(${LIBSSH_SHARED_LIBRARY}
PRIVATE
@@ -362,7 +363,7 @@ install(
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
COMPONENT libraries
)
-
+endif()
if (BUILD_STATIC_LIB)
add_library(${LIBSSH_STATIC_LIBRARY} STATIC ${libssh_SRCS})
target_compile_options(${LIBSSH_STATIC_LIBRARY}
@@ -370,11 +371,7 @@ if (BUILD_STATIC_LIB)
${DEFAULT_C_COMPILE_FLAGS}
-D_GNU_SOURCE)
- if (MSVC)
- set(OUTPUT_SUFFIX static)
- else (MSVC)
- set(OUTPUT_SUFFIX )
- endif (MSVC)
+
set_target_properties(
${LIBSSH_STATIC_LIBRARY}
PROPERTIES
@@ -385,23 +382,18 @@ if (BUILD_STATIC_LIB)
OUTPUT_NAME
ssh
ARCHIVE_OUTPUT_DIRECTORY
- ${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_SUFFIX}
+ ${CMAKE_CURRENT_BINARY_DIR}
)
if (WIN32)
- set_target_properties(
- ${LIBSSH_STATIC_LIBRARY}
- PROPERTIES
- COMPILE_FLAGS
- "-DLIBSSH_STATIC"
- )
+ target_compile_definitions(${LIBSSH_STATIC_LIBRARY} PUBLIC LIBSSH_STATIC)
endif (WIN32)
if (WITH_STATIC_LIB)
install(TARGETS
${LIBSSH_STATIC_LIBRARY}
DESTINATION
- ${LIB_INSTALL_DIR}/${OUTPUT_SUFFIX}
+ ${LIB_INSTALL_DIR}
COMPONENT
libraries)
endif (WITH_STATIC_LIB)

View File

@ -1,35 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b9f6ef485..c910d37eb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -145,8 +145,6 @@ install(
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake
DESTINATION
${CMAKE_INSTALL_DIR}/${PROJECT_NAME}
- COMPONENT
- devel
)
if (WITH_EXAMPLES)
diff --git a/0.9.0-daf25b6f84 - Kopie/libssh-config.cmake.in b/0.9.0-daf25b6f84/libssh-config.cmake.in
index 11388f009..2f826a9b4 100644
--- a/libssh-config.cmake.in
+++ b/libssh-config.cmake.in
@@ -6,7 +6,16 @@ if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/CMakeCache.txt")
set_and_check(LIBSSH_LIBRARIES "${CMAKE_CURRENT_LIST_DIR}/lib/@LIBSSH_LIBRARY_NAME@")
else()
+ # Compute the installation prefix relative to this file.
+get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
+get_filename_component(PACKAGE_PREFIX_DIR "${PACKAGE_PREFIX_DIR}" PATH)
+get_filename_component(PACKAGE_PREFIX_DIR "${PACKAGE_PREFIX_DIR}" PATH)
+if(PACKAGE_PREFIX_DIR STREQUAL "/")
+ set(PACKAGE_PREFIX_DIR "")
+endif()
set_and_check(LIBSSH_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
- set_and_check(LIBSSH_LIBRARIES "@PACKAGE_LIB_INSTALL_DIR@/@LIBSSH_LIBRARY_NAME@")
+ set_and_check(LIBSSH_LIBRARIES_RELEASE "@PACKAGE_LIB_INSTALL_DIR@/@LIBSSH_LIBRARY_NAME@")
+ set_and_check(LIBSSH_LIBRARIES_DEBUG "@PACKAGE_LIB_INSTALL_DIR@/../debug/lib/@LIBSSH_LIBRARY_NAME@")
+ set_and_check(LIBSSH_LIBRARIES "optimized;${LIBSSH_LIBRARIES_RELEASE};debug;${LIBSSH_LIBRARIES_DEBUG}")
endif()
# For backward compatibility

View File

@ -1,53 +1,37 @@
include(vcpkg_common_functions)
vcpkg_fail_port_install(ON_TARGET "UWP")
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore)
message(FATAL_ERROR "WindowsStore not supported")
endif()
set(VERSION 0.9.0)
set(VERSION 0.9.3)
vcpkg_download_distfile(ARCHIVE
URLS "https://www.libssh.org/files/0.9/libssh-${VERSION}.tar.xz"
FILENAME "libssh-${VERSION}.tar.xz"
SHA512 8c91b31e49652d93c295ca62c2ff1ae30f26c263195a8bc2390e44f6e688959507f609125d342ee8180fc03cec2d73258ac72f864696281b53ba9ad244060865
SHA512 6e59718565daeca6d224426cc1095a112deff9af8e0b021917e04f08bb7409263c35724de95f591f38e26f0fb3bbbbc69b679b6775edc21dec158d241b076c6f
)
#vcpkg_download_distfile(WINPATCH
# URLS "https://bugs.libssh.org/rLIBSSHf81ca6161223e3566ce78a427571235fb6848fe9?diff=1"
# FILENAME "libssh-f81ca616.patch"
# SHA512 f3f6088f8f1bf8fe6226c1aa7b355d877be7f2aa9482c5e3de74b6a35fc5b28d8f89221d3afa5a5d3a5900519a86e5906516667ed22ad98f058616a8120999cd
#)
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
REF ${VERSION}
PATCHES
build-one-flavor.patch
install-config.patch
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" WITH_STATIC_LIB)
if(zlib IN_LIST FEATURES)
set(WITH_ZLIB ON)
else()
set(WITH_ZLIB OFF)
endif()
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
mbedtls WITH_MBEDTLS
zlib WITH_ZLIB
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DWITH_STATIC_LIB=${WITH_STATIC_LIB}
${FEATURE_OPTIONS}
-DWITH_EXAMPLES=OFF
-DWITH_TESTING=OFF
-DWITH_NACL=OFF
-DWITH_GSSAPI=OFF
-DWITH_ZLIB=${WITH_ZLIB}
"-DCMAKE_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/share"
)
-DUNIT_TESTING=OFF
-DCLIENT_TESTING=OFF
-DSERVER_TESTING=OFF
-DWITH_NACL=OFF)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT})
vcpkg_copy_pdbs()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
@ -65,8 +49,5 @@ if(VCPKG_TARGET_IS_WINDOWS)
endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
# The installed cmake config files are nonfunctional (0.7.5)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libssh RENAME copyright)
file(INSTALL ${CURRENT_PORT_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/libssh)
file(INSTALL ${CURRENT_PORT_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/libssh)

View File

@ -1,5 +1,4 @@
The package libssh is compatible with built-in CMake targets:
find_package(libssh CONFIG REQUIRED)
target_link_libraries(main PRIVATE ${LIBSSH_LIBRARIES})
target_include_directories(main PRIVATE ${LIBSSH_INCLUDE_DIR})
target_link_libraries(main PRIVATE ssh)