From fed53f577120b98949dc1cf61b4a0cee9ac1eb16 Mon Sep 17 00:00:00 2001 From: NancyLi1013 Date: Tue, 31 Mar 2020 19:39:03 -0700 Subject: [mosquitto] Add support for static build --- ports/mosquitto/CONTROL | 2 +- ports/mosquitto/portfile.cmake | 12 ++++------ ports/mosquitto/support-static-build.patch | 38 ++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 9 deletions(-) create mode 100644 ports/mosquitto/support-static-build.patch diff --git a/ports/mosquitto/CONTROL b/ports/mosquitto/CONTROL index 3b06305c5..6955ef15d 100644 --- a/ports/mosquitto/CONTROL +++ b/ports/mosquitto/CONTROL @@ -1,5 +1,5 @@ Source: mosquitto -Version: 1.6.8 +Version: 1.6.8-1 Build-Depends: c-ares, libwebsockets, openssl, pthreads Description: Mosquitto is an open source message broker that implements the MQ Telemetry Transport protocol versions 3.1 and 3.1.1. MQTT provides a lightweight method of carrying out messaging using a publish/subscribe model. This makes it suitable for "machine to machine" messaging such as with low power sensors or mobile devices such as phones, embedded computers or microcontrollers like the Arduino. diff --git a/ports/mosquitto/portfile.cmake b/ports/mosquitto/portfile.cmake index 2a5d7274e..2c04a7bb0 100644 --- a/ports/mosquitto/portfile.cmake +++ b/ports/mosquitto/portfile.cmake @@ -1,5 +1,3 @@ -vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT) # This is a lie. mosquitto can be build staticlly it just must be implemented by vcpkg - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO eclipse/mosquitto @@ -10,6 +8,7 @@ vcpkg_from_github( archive-dest.patch win64-cmake.patch libwebsockets.patch + support-static-build.patch ) vcpkg_configure_cmake( @@ -43,11 +42,8 @@ file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/mosquitto_rr${VCPKG_TARGET_EXECUTABLE_SU file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/mosquitto_sub${VCPKG_TARGET_EXECUTABLE_SUFFIX}) file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/mosquitto_sub${VCPKG_TARGET_EXECUTABLE_SUFFIX}) -#if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin") - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) - endif() -#endif() +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) +endif() file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/mosquitto/support-static-build.patch b/ports/mosquitto/support-static-build.patch new file mode 100644 index 000000000..28d7d779a --- /dev/null +++ b/ports/mosquitto/support-static-build.patch @@ -0,0 +1,38 @@ +diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt +index bd60b75..cc01a2a 100644 +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -60,7 +60,7 @@ if (UNIX AND NOT APPLE) + endif (UNIX AND NOT APPLE) + + if (WIN32) +- set (LIBRARIES ${LIBRARIES} ws2_32) ++ set (LIBRARIES ${LIBRARIES} ws2_32 crypt32) + endif (WIN32) + + if (WITH_SRV) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 7898ff5..23b3fe8 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -158,7 +158,7 @@ if (UNIX) + endif (UNIX) + + if (WIN32) +- set (MOSQ_LIBS ${MOSQ_LIBS} ws2_32) ++ set (MOSQ_LIBS ${MOSQ_LIBS} ws2_32 crypt32) + endif (WIN32) + + if (WITH_WEBSOCKETS) +@@ -189,6 +189,10 @@ install(FILES mosquitto_broker.h mosquitto_plugin.h DESTINATION "${CMAKE_INSTALL + + if (WITH_TLS) + add_executable(mosquitto_passwd mosquitto_passwd.c) +- target_link_libraries(mosquitto_passwd ${OPENSSL_LIBRARIES}) ++ if(WIN32) ++ target_link_libraries(mosquitto_passwd ${OPENSSL_LIBRARIES} ws2_32 crypt32) ++ else() ++ target_link_libraries(mosquitto_passwd ${OPENSSL_LIBRARIES}) ++ endif() + install(TARGETS mosquitto_passwd RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") + endif (WITH_TLS) -- cgit v1.2.3 From 7828fa848f4d0ad8d3c26020068eb629fce9f27e Mon Sep 17 00:00:00 2001 From: NancyLi1013 Date: Tue, 31 Mar 2020 19:44:22 -0700 Subject: Update ci.baseline.txt --- scripts/ci.baseline.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index faf2bb104..b3fbb8178 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -1120,7 +1120,6 @@ moos-essential:arm64-windows=fail moos-essential:x64-windows=fail moos-essential:x86-windows=fail moos-essential:x64-linux=ignore -mosquitto:x64-windows-static=fail mozjpeg:arm64-windows = skip mozjpeg:arm-uwp = skip mozjpeg:x64-linux = skip -- cgit v1.2.3 From 0f1294c61e51bba3c4257502852eecbe1a943a4b Mon Sep 17 00:00:00 2001 From: NancyLi1013 Date: Thu, 2 Apr 2020 00:24:47 -0700 Subject: [libwebsockets] Update options -DLWS_USE_BUNDLED_ZLIB as -DLWS_WITH_BUNDLED_ZLIB --- ports/libwebsockets/CONTROL | 2 +- ports/libwebsockets/portfile.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/libwebsockets/CONTROL b/ports/libwebsockets/CONTROL index 77536b9f8..7b9af2d39 100644 --- a/ports/libwebsockets/CONTROL +++ b/ports/libwebsockets/CONTROL @@ -1,5 +1,5 @@ Source: libwebsockets -Version: 3.2.2-1 +Version: 3.2.2-2 Build-Depends: zlib, openssl, libuv Homepage: https://github.com/warmcat/libwebsockets 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 a05ce4b16..e5d7fc0fa 100644 --- a/ports/libwebsockets/portfile.cmake +++ b/ports/libwebsockets/portfile.cmake @@ -134,7 +134,7 @@ vcpkg_configure_cmake( OPTIONS -DLWS_WITH_STATIC=${LWS_WITH_STATIC} -DLWS_WITH_SHARED=${LWS_WITH_SHARED} - -DLWS_USE_BUNDLED_ZLIB=OFF + -DLWS_WITH_BUNDLED_ZLIB=OFF -DLWS_WITHOUT_TESTAPPS=ON -DLWS_IPV6=ON -DLWS_HTTP2=ON -- cgit v1.2.3