From b5afd00ad632ab144555e9bc1e106b84e11cd040 Mon Sep 17 00:00:00 2001 From: Andrew Male Date: Sat, 11 Nov 2017 07:27:31 -0500 Subject: [PATCH 1/4] Modifying libwebsockets portfile to account for static triplets --- ports/libwebsockets/portfile.cmake | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ports/libwebsockets/portfile.cmake b/ports/libwebsockets/portfile.cmake index 43502a52a8..fa5ecfd8f0 100644 --- a/ports/libwebsockets/portfile.cmake +++ b/ports/libwebsockets/portfile.cmake @@ -17,10 +17,19 @@ vcpkg_apply_patches( ${CMAKE_CURRENT_LIST_DIR}/0001-Fix-UWP.patch ) +if(VCPKG_CRT_LINKAGE STREQUAL static) + set(LWS_MSVC_STATIC_RUNTIME ON) + set(LWS_MSVC_SHARED_RUNTIME OFF) +else() + set(LWS_MSVC_STATIC_RUNTIME OFF) + set(LWS_MSVC_SHARED_RUNTIME ON) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS - -DLWS_WITH_STATIC=OFF + -DLWS_WITH_STATIC=${LWS_MSVC_STATIC_RUNTIME} + -DLWS_WITH_SHARED=${LWS_MSVC_SHARED_RUNTIME} -DLWS_USE_BUNDLED_ZLIB=OFF -DLWS_WITHOUT_TESTAPPS=ON -DLWS_IPV6=ON From 679dd12a756583f3014d06ac5a2ab8e6695eb372 Mon Sep 17 00:00:00 2001 From: Andrew Male Date: Sat, 11 Nov 2017 07:38:53 -0500 Subject: [PATCH 2/4] Incrementing CONTROL version for libwebsockets --- ports/libwebsockets/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/libwebsockets/CONTROL b/ports/libwebsockets/CONTROL index 816253a2c7..fa700ddbd2 100644 --- a/ports/libwebsockets/CONTROL +++ b/ports/libwebsockets/CONTROL @@ -1,4 +1,4 @@ Source: libwebsockets -Version: 2.0.0-2 +Version: 2.0.0-3 Build-Depends: zlib, openssl Description: Libwebsockets is a lightweight pure C library built to use minimal CPU and memory resources, and provide fast throughput in both directions as client or server. From 1b679903952c3afa0a0252299348ff6e3e143092 Mon Sep 17 00:00:00 2001 From: Andrew Male Date: Sat, 11 Nov 2017 07:39:17 -0500 Subject: [PATCH 3/4] Removing static linkage warning/toggle --- ports/libwebsockets/portfile.cmake | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ports/libwebsockets/portfile.cmake b/ports/libwebsockets/portfile.cmake index fa5ecfd8f0..78632256da 100644 --- a/ports/libwebsockets/portfile.cmake +++ b/ports/libwebsockets/portfile.cmake @@ -1,7 +1,3 @@ -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(STATUS "Warning: Static building not supported yet. Building dynamic.") - set(VCPKG_LIBRARY_LINKAGE dynamic) -endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libwebsockets-2.0.0) vcpkg_download_distfile(ARCHIVE From 482f85f4142fb02ec6a39ae7d264901bc1e162c1 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 11 Nov 2017 21:00:10 -0800 Subject: [PATCH 4/4] [libwebsockets] Use vcpkg_from_github. Compare against VCPKG_LIBRARY_LINKAGE instead of VCPKG_CRT_LINKAGE. Use vcpkg_fixup_cmake_targets(). --- ports/libwebsockets/CONTROL | 2 +- ports/libwebsockets/portfile.cmake | 41 ++++++++++++------------------ 2 files changed, 17 insertions(+), 26 deletions(-) diff --git a/ports/libwebsockets/CONTROL b/ports/libwebsockets/CONTROL index fa700ddbd2..64bf929bd7 100644 --- a/ports/libwebsockets/CONTROL +++ b/ports/libwebsockets/CONTROL @@ -1,4 +1,4 @@ Source: libwebsockets -Version: 2.0.0-3 +Version: 2.0.0-4 Build-Depends: zlib, openssl Description: Libwebsockets is a lightweight pure C library built to use minimal CPU and memory resources, and provide fast throughput in both directions as client or server. diff --git a/ports/libwebsockets/portfile.cmake b/ports/libwebsockets/portfile.cmake index 78632256da..ae74f52689 100644 --- a/ports/libwebsockets/portfile.cmake +++ b/ports/libwebsockets/portfile.cmake @@ -1,31 +1,27 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libwebsockets-2.0.0) -vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/warmcat/libwebsockets/archive/v2.0.0.zip" - FILENAME "libwebsockets-v2.0.0.zip" - SHA512 bf57a46f2c60095e7e6ec6656b185ffd2cf8f553bc22255ae8f6825d3613316d794f139cdefacbdf60ef997b0cd675fe356813d406c9b7c5a5ae838ce5326042 + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO warmcat/libwebsockets + REF v2.0.0 + SHA512 26bc09877c1595b80b08e788e4ae3908af86b67e19f4b9f7ac48d90783cf5c563d4d03e5586d18f6bb8e67d15a03d000f31f67f3a327d898844f77e5d22f7c9d + HEAD_REF master ) -vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} - PATCHES - ${CMAKE_CURRENT_LIST_DIR}/0001-Fix-UWP.patch + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/0001-Fix-UWP.patch ) -if(VCPKG_CRT_LINKAGE STREQUAL static) - set(LWS_MSVC_STATIC_RUNTIME ON) - set(LWS_MSVC_SHARED_RUNTIME OFF) -else() - set(LWS_MSVC_STATIC_RUNTIME OFF) - set(LWS_MSVC_SHARED_RUNTIME ON) -endif() +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" LWS_WITH_STATIC) +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" LWS_WITH_SHARED) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS - -DLWS_WITH_STATIC=${LWS_MSVC_STATIC_RUNTIME} - -DLWS_WITH_SHARED=${LWS_MSVC_SHARED_RUNTIME} + -DLWS_WITH_STATIC=${LWS_WITH_STATIC} + -DLWS_WITH_SHARED=${LWS_WITH_SHARED} -DLWS_USE_BUNDLED_ZLIB=OFF -DLWS_WITHOUT_TESTAPPS=ON -DLWS_IPV6=ON @@ -36,14 +32,9 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) -file(RENAME ${CURRENT_PACKAGES_DIR}/cmake ${CURRENT_PACKAGES_DIR}/share/libwebsockets) -file(RENAME - ${CURRENT_PACKAGES_DIR}/debug/cmake/LibwebsocketsTargets-debug.cmake - ${CURRENT_PACKAGES_DIR}/share/libwebsockets/LibwebsocketsTargets-debug.cmake -) +vcpkg_fixup_cmake_targets(CONFIG_PATH "cmake") + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/cmake) file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libwebsockets) file(RENAME ${CURRENT_PACKAGES_DIR}/share/libwebsockets/LICENSE ${CURRENT_PACKAGES_DIR}/share/libwebsockets/copyright)