diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2018-03-13 11:06:52 -0700 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2018-03-13 11:06:52 -0700 |
| commit | 40bc3cb716c912e7a9cd567369a77918cfce87a2 (patch) | |
| tree | e304412e7f653b7d0739b23425affb0a1478babe | |
| parent | 3c7997215bc2e44125912fb7aae672f1b63944a8 (diff) | |
| download | vcpkg-40bc3cb716c912e7a9cd567369a77918cfce87a2.tar.gz vcpkg-40bc3cb716c912e7a9cd567369a77918cfce87a2.zip | |
[libssh] Fix static builds for non-windows
| -rw-r--r-- | ports/libssh/CONTROL | 2 | ||||
| -rw-r--r-- | ports/libssh/only-one-flavor-threads.patch | 21 | ||||
| -rw-r--r-- | ports/libssh/portfile.cmake | 11 |
3 files changed, 30 insertions, 4 deletions
diff --git a/ports/libssh/CONTROL b/ports/libssh/CONTROL index 70b555a79..5f3c8a0db 100644 --- a/ports/libssh/CONTROL +++ b/ports/libssh/CONTROL @@ -1,4 +1,4 @@ Source: libssh -Version: 0.7.5-3 +Version: 0.7.5-4 Description: libssh is a multiplatform C library implementing the SSHv2 and SSHv1 protocol on client and server side Build-Depends: zlib, openssl diff --git a/ports/libssh/only-one-flavor-threads.patch b/ports/libssh/only-one-flavor-threads.patch new file mode 100644 index 000000000..31b3e1f36 --- /dev/null +++ b/ports/libssh/only-one-flavor-threads.patch @@ -0,0 +1,21 @@ +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 773685f76..7d986d244 100644 --- a/ports/libssh/portfile.cmake +++ b/ports/libssh/portfile.cmake @@ -13,7 +13,9 @@ vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} - PATCHES ${CMAKE_CURRENT_LIST_DIR}/build-one-flavor.patch + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/build-one-flavor.patch + ${CMAKE_CURRENT_LIST_DIR}/only-one-flavor-threads.patch ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" WITH_STATIC_LIB) @@ -33,8 +35,10 @@ vcpkg_install_cmake() vcpkg_copy_pdbs() if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/static/ssh.lib ${CURRENT_PACKAGES_DIR}/lib/ssh.lib) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/static/ssh.lib ${CURRENT_PACKAGES_DIR}/debug/lib/ssh.lib) + if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/static/ssh.lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/static/ssh.lib ${CURRENT_PACKAGES_DIR}/lib/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) @@ -47,5 +51,6 @@ 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/cmake ${CURRENT_PACKAGES_DIR}/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake ${CURRENT_PACKAGES_DIR}/lib/cmake) file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libssh RENAME copyright) |
