diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2018-03-13 07:37:20 -0700 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2018-03-13 07:37:20 -0700 |
| commit | 9de17844e0201a27132149e392152525f8e8d34b (patch) | |
| tree | 1ef5e831041acbfe7e1402831fdd72a710d3a24c | |
| parent | 50a93f01970e499f35edbb57ce0328baeb465635 (diff) | |
| download | vcpkg-9de17844e0201a27132149e392152525f8e8d34b.tar.gz vcpkg-9de17844e0201a27132149e392152525f8e8d34b.zip | |
[libssh] Only build one flavor at a time, don't build examples.
| -rw-r--r-- | ports/libssh/CONTROL | 2 | ||||
| -rw-r--r-- | ports/libssh/build-one-flavor.patch | 20 | ||||
| -rw-r--r-- | ports/libssh/portfile.cmake | 28 |
3 files changed, 41 insertions, 9 deletions
diff --git a/ports/libssh/CONTROL b/ports/libssh/CONTROL index 692a6f4b8..70b555a79 100644 --- a/ports/libssh/CONTROL +++ b/ports/libssh/CONTROL @@ -1,4 +1,4 @@ Source: libssh -Version: 0.7.5-2 +Version: 0.7.5-3 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/build-one-flavor.patch b/ports/libssh/build-one-flavor.patch new file mode 100644 index 000000000..96e20ba98 --- /dev/null +++ b/ports/libssh/build-one-flavor.patch @@ -0,0 +1,20 @@ +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}
+ )
+
++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(
+ ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
+ COMPONENT libraries
+ )
++endif()
+
+ if (WITH_STATIC_LIB)
+ add_library(${LIBSSH_STATIC_LIBRARY} STATIC ${libssh_SRCS})
diff --git a/ports/libssh/portfile.cmake b/ports/libssh/portfile.cmake index 36ece7321..773685f76 100644 --- a/ports/libssh/portfile.cmake +++ b/ports/libssh/portfile.cmake @@ -1,7 +1,7 @@ include(vcpkg_common_functions) if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) - message(FATAL_ERROR "WindowsStore not supported") + message(FATAL_ERROR "WindowsStore not supported") endif() set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libssh-0.7.5) vcpkg_download_distfile(ARCHIVE @@ -11,23 +11,35 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES ${CMAKE_CURRENT_LIST_DIR}/build-one-flavor.patch +) + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" WITH_STATIC_LIB) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS -DWITH_STATIC_LIB=ON + OPTIONS + -DWITH_STATIC_LIB=${WITH_STATIC_LIB} + -DWITH_EXAMPLES=OFF + -DWITH_TESTING=OFF + -DWITH_NACL=OFF + -DWITH_GSSAPI=OFF ) 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) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) + 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) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) - file(READ ${CURRENT_PACKAGES_DIR}/include/libssh/libssh.h _contents) - string(REPLACE "#ifdef LIBSSH_STATIC" "#if 1" _contents "${_contents}") - file(WRITE ${CURRENT_PACKAGES_DIR}/include/libssh/libssh.h "${_contents}") + file(READ ${CURRENT_PACKAGES_DIR}/include/libssh/libssh.h _contents) + string(REPLACE "#ifdef LIBSSH_STATIC" "#if 1" _contents "${_contents}") + 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) |
