aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2020-04-16 13:33:10 -0700
committerGitHub <noreply@github.com>2020-04-16 13:33:10 -0700
commitd216948042d80d457c8643d19db0ba815d28b6fd (patch)
tree290fadda304aefe0624be328c22421dc0eabb342
parent5e4995e5895fe0055845a9758bcc6a20cc6d8b1a (diff)
parent9cbb1bd46e0948374fe496195cca828e68a71f3c (diff)
downloadvcpkg-d216948042d80d457c8643d19db0ba815d28b6fd.tar.gz
vcpkg-d216948042d80d457c8643d19db0ba815d28b6fd.zip
[mosquitto] Add support for static build (#10636)
* [mosquitto] Add support for static build * Update ci.baseline.txt * [libwebsockets] Update options -DLWS_USE_BUNDLED_ZLIB as -DLWS_WITH_BUNDLED_ZLIB
-rw-r--r--ports/libwebsockets/CONTROL2
-rw-r--r--ports/mosquitto/CONTROL2
-rw-r--r--ports/mosquitto/portfile.cmake12
-rw-r--r--ports/mosquitto/support-static-build.patch38
-rw-r--r--scripts/ci.baseline.txt1
5 files changed, 44 insertions, 11 deletions
diff --git a/ports/libwebsockets/CONTROL b/ports/libwebsockets/CONTROL
index 6cb5eda15..b5cf18829 100644
--- a/ports/libwebsockets/CONTROL
+++ b/ports/libwebsockets/CONTROL
@@ -1,5 +1,5 @@
Source: libwebsockets
-Version: 4.0.1
+Version: 4.0.1-1
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/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)
diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt
index 89fbe629b..06c7456c1 100644
--- a/scripts/ci.baseline.txt
+++ b/scripts/ci.baseline.txt
@@ -1113,7 +1113,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