aboutsummaryrefslogtreecommitdiff
path: root/ports/libssh
diff options
context:
space:
mode:
Diffstat (limited to 'ports/libssh')
-rw-r--r--ports/libssh/CONTROL2
-rw-r--r--ports/libssh/build-one-flavor.patch58
-rw-r--r--ports/libssh/fix-config-cmake.patch77
-rw-r--r--ports/libssh/install-config.patch35
-rw-r--r--ports/libssh/missing-includes.patch13
-rw-r--r--ports/libssh/only-one-flavor-threads.patch21
-rw-r--r--ports/libssh/portfile.cmake35
-rw-r--r--ports/libssh/usage2
8 files changed, 102 insertions, 141 deletions
diff --git a/ports/libssh/CONTROL b/ports/libssh/CONTROL
index a819253d0..c12fb8f8f 100644
--- a/ports/libssh/CONTROL
+++ b/ports/libssh/CONTROL
@@ -1,5 +1,5 @@
Source: libssh
-Version: 0.7.6-1
+Version: 0.9.0
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
diff --git a/ports/libssh/build-one-flavor.patch b/ports/libssh/build-one-flavor.patch
index 96e20ba98..64e2c58a7 100644
--- a/ports/libssh/build-one-flavor.patch
+++ b/ports/libssh/build-one-flavor.patch
@@ -2,19 +2,61 @@ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 1012ddf..612f0ba 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
-@@ -225,6 +225,7 @@ include_directories(
- ${LIBSSH_PRIVATE_INCLUDE_DIRS}
- )
+@@ -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_link_libraries(${LIBSSH_SHARED_LIBRARY} ${LIBSSH_LINK_LIBRARIES})
-@@ -259,6 +260,7 @@ install(
+ target_compile_options(${LIBSSH_SHARED_LIBRARY}
+ PRIVATE
+@@ -362,7 +363,7 @@ install(
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
COMPONENT libraries
)
+-
+endif()
-
- if (WITH_STATIC_LIB)
+ 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)
+
diff --git a/ports/libssh/fix-config-cmake.patch b/ports/libssh/fix-config-cmake.patch
deleted file mode 100644
index bb369359f..000000000
--- a/ports/libssh/fix-config-cmake.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index a063556..68e559e 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -11,6 +11,8 @@ set(APPLICATION_VERSION_MINOR "7")
- set(APPLICATION_VERSION_PATCH "6")
-
- set(APPLICATION_VERSION "${APPLICATION_VERSION_MAJOR}.${APPLICATION_VERSION_MINOR}.${APPLICATION_VERSION_PATCH}")
-+set(CMAKE_INSTALL_DIR lib/cmake/libssh CACHE STRING
-+ "The subdirectory where CMake package config files should be installed")
-
- # SOVERSION scheme: CURRENT.AGE.REVISION
- # If there was an incompatible interface change:
-@@ -114,14 +116,29 @@ endif (UNIX)
- set(LIBSSH_LIBRARY_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}ssh${CMAKE_SHARED_LIBRARY_SUFFIX})
- set(LIBSSH_THREADS_LIBRARY_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}ssh${CMAKE_SHARED_LIBRARY_SUFFIX})
-
--configure_file(${PROJECT_NAME}-config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake @ONLY)
--configure_file(${PROJECT_NAME}-config-version.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake @ONLY)
-+include(CMakePackageConfigHelpers)
-+configure_package_config_file(
-+ ${PROJECT_NAME}-config.cmake.in
-+ ${PROJECT_NAME}-config.cmake
-+ INSTALL_DESTINATION ${CMAKE_INSTALL_DIR}
-+ PATH_VARS
-+ INCLUDE_INSTALL_DIR
-+ CMAKE_INSTALL_DIR
-+)
-+configure_package_config_file(
-+ ${PROJECT_NAME}-config-version.cmake.in
-+ ${PROJECT_NAME}-config-version.cmake
-+ INSTALL_DESTINATION ${CMAKE_INSTALL_DIR}
-+ PATH_VARS
-+ INCLUDE_INSTALL_DIR
-+ CMAKE_INSTALL_DIR
-+)
- install(
- FILES
- ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake
- ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake
- DESTINATION
-- ${CMAKE_INSTALL_DIR}/${PROJECT_NAME}
-+ ${CMAKE_INSTALL_DIR}
- COMPONENT
- devel
- )
-diff --git a/libssh-config.cmake.in b/libssh-config.cmake.in
-index fa9cecf..b17fdbd 100644
---- a/libssh-config.cmake.in
-+++ b/libssh-config.cmake.in
-@@ -1,13 +1,22 @@
- get_filename_component(LIBSSH_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
-+get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../" ABSOLUTE)
-
- if (EXISTS "${LIBSSH_CMAKE_DIR}/CMakeCache.txt")
- # In build tree
- include(${LIBSSH_CMAKE_DIR}/libssh-build-tree-settings.cmake)
- else()
-- set(LIBSSH_INCLUDE_DIR @INCLUDE_INSTALL_DIR@)
-+ set(LIBSSH_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/include/")
-+ set(LIBSSH_INCLUDE_DIRS "${PACKAGE_PREFIX_DIR}/include/")
- endif()
-
--set(LIBSSH_LIBRARY @LIB_INSTALL_DIR@/@LIBSSH_LIBRARY_NAME@)
--set(LIBSSH_LIBRARIES @LIB_INSTALL_DIR@/@LIBSSH_LIBRARY_NAME@)
-+if(CMAKE_BUILD_TYPE STREQUAL "Release")
-+ set(LIBSSH_LIBRARY "${PACKAGE_PREFIX_DIR}/lib/ssh.lib")
-+ set(LIBSSH_LIBRARIES "${PACKAGE_PREFIX_DIR}/lib/ssh.lib")
-
--set(LIBSSH_THREADS_LIBRARY @LIB_INSTALL_DIR@/@LIBSSH_THREADS_LIBRARY_NAME@)
-+ set(LIBSSH_THREADS_LIBRARY "${PACKAGE_PREFIX_DIR}/lib/ssh.lib")
-+elseif(CMAKE_BUILD_TYPE STREQUAL "Debug")
-+ set(LIBSSH_LIBRARY "${PACKAGE_PREFIX_DIR}/debug/lib/ssh.lib")
-+ set(LIBSSH_LIBRARIES "${PACKAGE_PREFIX_DIR}/debug/lib/ssh.lib")
-+
-+ set(LIBSSH_THREADS_LIBRARY "${PACKAGE_PREFIX_DIR}/debug/lib/ssh.lib")
-+endif()
diff --git a/ports/libssh/install-config.patch b/ports/libssh/install-config.patch
new file mode 100644
index 000000000..4943765d5
--- /dev/null
+++ b/ports/libssh/install-config.patch
@@ -0,0 +1,35 @@
+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
diff --git a/ports/libssh/missing-includes.patch b/ports/libssh/missing-includes.patch
deleted file mode 100644
index f12d04744..000000000
--- a/ports/libssh/missing-includes.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/include/libssh/priv.h b/include/libssh/priv.h
-index 4cf6d75..13993ea 100644
---- a/include/libssh/priv.h
-+++ b/include/libssh/priv.h
-@@ -30,6 +30,8 @@
- #define _LIBSSH_PRIV_H
-
- #include "config.h"
-+#include <stdint.h>
-+#include <string.h>
-
- #if !defined(HAVE_STRTOULL)
- # if defined(HAVE___STRTOULL)
diff --git a/ports/libssh/only-one-flavor-threads.patch b/ports/libssh/only-one-flavor-threads.patch
deleted file mode 100644
index 31b3e1f36..000000000
--- a/ports/libssh/only-one-flavor-threads.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/src/threads/CMakeLists.txt b/src/threads/CMakeLists.txt
-index 2ab4e1b..a47620b 100644
---- a/src/threads/CMakeLists.txt
-+++ b/src/threads/CMakeLists.txt
-@@ -59,6 +59,7 @@ include_directories(
- if (libssh_threads_SRCS)
- set(LIBSSH_THREADS ON CACHE "libssh threads lib" INTERNAL)
-
-+ if (NOT WITH_STATIC_LIB)
- add_library(${LIBSSH_THREADS_SHARED_LIBRARY} SHARED ${libssh_threads_SRCS})
-
- target_link_libraries(${LIBSSH_THREADS_SHARED_LIBRARY} ${LIBSSH_THREADS_LINK_LIBRARIES})
-@@ -89,7 +90,7 @@ if (libssh_threads_SRCS)
- COMPONENT libraries
- )
-
-- if (WITH_STATIC_LIB)
-+ else (WITH_STATIC_LIB)
- add_library(${LIBSSH_THREADS_STATIC_LIBRARY} STATIC ${libssh_threads_SRCS})
-
- if (MSVC)
diff --git a/ports/libssh/portfile.cmake b/ports/libssh/portfile.cmake
index e137f823f..5a87be14b 100644
--- a/ports/libssh/portfile.cmake
+++ b/ports/libssh/portfile.cmake
@@ -4,18 +4,18 @@ if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore)
message(FATAL_ERROR "WindowsStore not supported")
endif()
-set(VERSION 0.7.6)
+set(VERSION 0.9.0)
vcpkg_download_distfile(ARCHIVE
- URLS "https://www.libssh.org/files/0.7/libssh-${VERSION}.tar.xz"
+ URLS "https://www.libssh.org/files/0.9/libssh-${VERSION}.tar.xz"
FILENAME "libssh-${VERSION}.tar.xz"
- SHA512 2a01402b5a9fab9ecc29200544ed45d3f2c40871ed1c8241ca793f8dc7fdb3ad2150f6a522c4321affa9b8778e280dc7ed10f76adfc4a73f0751ae735a42f56c
+ SHA512 8c91b31e49652d93c295ca62c2ff1ae30f26c263195a8bc2390e44f6e688959507f609125d342ee8180fc03cec2d73258ac72f864696281b53ba9ad244060865
)
-vcpkg_download_distfile(WINPATCH
- URLS "https://bugs.libssh.org/rLIBSSHf81ca6161223e3566ce78a427571235fb6848fe9?diff=1"
- FILENAME "libssh-f81ca616.patch"
- SHA512 f3f6088f8f1bf8fe6226c1aa7b355d877be7f2aa9482c5e3de74b6a35fc5b28d8f89221d3afa5a5d3a5900519a86e5906516667ed22ad98f058616a8120999cd
-)
+#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
@@ -23,10 +23,7 @@ vcpkg_extract_source_archive_ex(
REF ${VERSION}
PATCHES
build-one-flavor.patch
- only-one-flavor-threads.patch
- "${WINPATCH}"
- missing-includes.patch
- fix-config-cmake.patch
+ install-config.patch
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" WITH_STATIC_LIB)
@@ -47,19 +44,13 @@ vcpkg_configure_cmake(
-DWITH_NACL=OFF
-DWITH_GSSAPI=OFF
-DWITH_ZLIB=${WITH_ZLIB}
- -DCMAKE_INSTALL_DIR=share/libssh
+ "-DCMAKE_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/share"
)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
- if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/static/ssh.lib)
- file(RENAME ${CURRENT_PACKAGES_DIR}/lib/static/ssh.lib ${CURRENT_PACKAGES_DIR}/lib/ssh.lib)
- endif()
- if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/static/ssh.lib)
- file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/static/ssh.lib ${CURRENT_PACKAGES_DIR}/debug/lib/ssh.lib)
- endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
file(READ ${CURRENT_PACKAGES_DIR}/include/libssh/libssh.h _contents)
@@ -67,7 +58,11 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(WRITE ${CURRENT_PACKAGES_DIR}/include/libssh/libssh.h "${_contents}")
endif()
-file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/static ${CURRENT_PACKAGES_DIR}/debug/lib/static)
+if(VCPKG_TARGET_IS_WINDOWS)
+ file(READ ${CURRENT_PACKAGES_DIR}/share/libssh/libssh-config.cmake _contents)
+ string(REPLACE ".dll" ".lib" _contents "${_contents}")
+ file(WRITE ${CURRENT_PACKAGES_DIR}/share/libssh/libssh-config.cmake "${_contents}")
+endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
# The installed cmake config files are nonfunctional (0.7.5)
diff --git a/ports/libssh/usage b/ports/libssh/usage
index 3681ac112..acb7e822c 100644
--- a/ports/libssh/usage
+++ b/ports/libssh/usage
@@ -2,4 +2,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_DIRS})
+ target_include_directories(main PRIVATE ${LIBSSH_INCLUDE_DIR})