[mosquitto] - Upgraded Mosquitto MQTT library to v1.5.0 (#3619)

* Updated and simplified patch files for the new source version
This commit is contained in:
Matt Powley 2018-07-04 05:22:34 +01:00 committed by Robert Schumacher
parent 2ef707aee7
commit 88b03d1029
6 changed files with 110 additions and 127 deletions

View File

@ -1,40 +0,0 @@
--- a/config.h
+++ b/config.h
@@ -16,7 +16,7 @@
# define EPROTO ECONNABORTED
#endif
-#ifdef WIN32
+#ifdef WIN32 || WIN64
# ifndef strcasecmp
# define strcasecmp strcmpi
# endif
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -4,8 +4,8 @@
if (${WITH_THREADING} STREQUAL ON)
add_definitions("-DWITH_THREADING")
if (WIN32)
- set (PTHREAD_LIBRARIES C:\\pthreads\\Pre-built.2\\lib\\x86\\pthreadVC2.lib)
- set (PTHREAD_INCLUDE_DIR C:\\pthreads\\Pre-built.2\\include)
+ set (PTHREAD_LIBRARIES ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/lib/pthreadsVC2.lib)
+ set (PTHREAD_INCLUDE_DIR ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/include)
else (WIN32)
find_library(LIBPTHREAD pthread)
if (LIBPTHREAD)
--- a/lib/net_mosq.h
+++ b/lib/net_mosq.h
@@ -20,7 +20,12 @@
#include <unistd.h>
#else
#include <winsock2.h>
+#if defined(_MSC_VER) && _MSC_VER > 1900
+#undef ssize_t
typedef int ssize_t;
+#else
+typedef int ssize_t;
+#endif
#endif
#include <mosquitto_internal.h>

View File

@ -1,5 +1,5 @@
Source: mosquitto
Version: 1.4.15
Version: 1.5.0
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

View File

@ -1,13 +0,0 @@
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -4,8 +4,8 @@
if (${WITH_THREADING} STREQUAL ON)
add_definitions("-DWITH_THREADING")
if (WIN32)
- set (PTHREAD_LIBRARIES C:\\pthreads\\Pre-built.2\\lib\\x86\\pthreadVC2.lib)
- set (PTHREAD_INCLUDE_DIR C:\\pthreads\\Pre-built.2\\include)
+ set (PTHREAD_LIBRARIES ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/lib/pthreadsVC2.lib)
+ set (PTHREAD_INCLUDE_DIR ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/include)
else (WIN32)
find_library(LIBPTHREAD pthread)
if (LIBPTHREAD)

View File

@ -1,68 +1,54 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3a68061..e4197fd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,10 +24,10 @@ endif (WIN32)
add_definitions (-DCMAKE -DVERSION=\"${VERSION}\" -DTIMESTAMP=\"${TIMESTAMP}\")
if (WIN32)
- set (BINDIR .)
- set (SBINDIR .)
+ set (BINDIR bin)
+ set (SBINDIR bin)
set (SYSCONFDIR .)
- set (LIBDIR .)
+ set (LIBDIR lib)
set (INCLUDEDIR include)
set (DATAROOTDIR share)
set (MANDIR man)
@@ -86,10 +86,10 @@ option(WITH_SRV "Include SRV lookup support?" ON)
add_subdirectory(lib)
add_subdirectory(client)
add_subdirectory(src)
-add_subdirectory(man)
+#add_subdirectory(man)
# ========================================
# Install config file
# ========================================
-install(FILES mosquitto.conf aclfile.example pskfile.example pwfile.example DESTINATION "${SYSCONFDIR}")
+#install(FILES mosquitto.conf aclfile.example pskfile.example pwfile.example DESTINATION "${SYSCONFDIR}")
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 1260761..aebd580 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -4,8 +4,8 @@ option(WITH_THREADING "Include client library threading support?" ON)
if (${WITH_THREADING} STREQUAL ON)
add_definitions("-DWITH_THREADING")
if (WIN32)
- set (PTHREAD_LIBRARIES ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/lib/pthreadsVC2.lib)
- set (PTHREAD_INCLUDE_DIR ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/include)
+ find_library(PTHREAD_LIBRARIES NAMES pthreadsVC2)
+ find_path(PTHREAD_INCLUDE_DIR pthread.h)
else (WIN32)
find_library(LIBPTHREAD pthread)
if (LIBPTHREAD)
@@ -78,7 +78,7 @@ set_target_properties(libmosquitto PROPERTIES
SOVERSION 1
)
-install(TARGETS libmosquitto RUNTIME DESTINATION "${BINDIR}" LIBRARY DESTINATION "${LIBDIR}")
+install(TARGETS libmosquitto RUNTIME DESTINATION "${BINDIR}" LIBRARY DESTINATION "${LIBDIR}" ARCHIVE DESTINATION "${LIBDIR}")
install(FILES mosquitto.h DESTINATION "${INCLUDEDIR}")
if (UNIX)
diff --git a/lib/cpp/CMakeLists.txt b/lib/cpp/CMakeLists.txt
index b80dc18..e91ec77 100644
--- a/lib/cpp/CMakeLists.txt
+++ b/lib/cpp/CMakeLists.txt
@@ -10,7 +10,7 @@ set_target_properties(mosquittopp PROPERTIES
VERSION ${VERSION}
SOVERSION 1
)
-install(TARGETS mosquittopp RUNTIME DESTINATION "${BINDIR}" LIBRARY DESTINATION "${LIBDIR}")
+install(TARGETS mosquittopp RUNTIME DESTINATION "${BINDIR}" LIBRARY DESTINATION "${LIBDIR}" ARCHIVE DESTINATION "${LIBDIR}")
install(FILES mosquittopp.h DESTINATION "${INCLUDEDIR}")
if (UNIX)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e1d631e..e95d7fb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,10 +16,10 @@ set (VERSION 1.5.0)
add_definitions (-DCMAKE -DVERSION=\"${VERSION}\")
if (WIN32)
- set (BINDIR .)
- set (SBINDIR .)
+ set (BINDIR bin)
+ set (SBINDIR bin)
set (SYSCONFDIR .)
- set (LIBDIR .)
+ set (LIBDIR lib)
set (INCLUDEDIR include)
set (DATAROOTDIR share)
set (MANDIR man)
@@ -90,7 +90,7 @@ endif (${DOCUMENTATION} STREQUAL ON)
# Install config file
# ========================================
-install(FILES mosquitto.conf aclfile.example pskfile.example pwfile.example DESTINATION "${SYSCONFDIR}")
+#install(FILES mosquitto.conf aclfile.example pskfile.example pwfile.example DESTINATION "${SYSCONFDIR}")
# ========================================
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 272b60a..c180067 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -104,7 +104,7 @@ set_target_properties(libmosquitto PROPERTIES
SOVERSION 1
)
-install(TARGETS libmosquitto RUNTIME DESTINATION "${BINDIR}" LIBRARY DESTINATION "${LIBDIR}")
+install(TARGETS libmosquitto RUNTIME DESTINATION "${BINDIR}" LIBRARY DESTINATION "${LIBDIR}" ARCHIVE DESTINATION "${LIBDIR}")
if (${WITH_STATIC_LIBRARIES} STREQUAL ON)
add_library(libmosquitto_static STATIC ${C_SRC})
diff --git a/lib/cpp/CMakeLists.txt b/lib/cpp/CMakeLists.txt
index 5e4f08e..a8cc6be 100644
--- a/lib/cpp/CMakeLists.txt
+++ b/lib/cpp/CMakeLists.txt
@@ -13,7 +13,7 @@ set_target_properties(mosquittopp PROPERTIES
VERSION ${VERSION}
SOVERSION 1
)
-install(TARGETS mosquittopp RUNTIME DESTINATION "${BINDIR}" LIBRARY DESTINATION "${LIBDIR}")
+install(TARGETS mosquittopp RUNTIME DESTINATION "${BINDIR}" LIBRARY DESTINATION "${LIBDIR}" ARCHIVE DESTINATION "${LIBDIR}")
if (${WITH_STATIC_LIBRARIES} STREQUAL ON)
add_library(mosquittopp_static STATIC

View File

@ -12,17 +12,16 @@ endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO eclipse/mosquitto
REF v1.4.15
SHA512 428ef9434d3fe022232dcde415fe8cd948d237507d512871803a116230f9e011c10fa01313111ced0946f906e8cc7e26d9eee5de6caa7f82590753a4d087f6fd
REF v1.5
SHA512 f6a5c8e71d642ef931176fe428fb79353933facc2db226d9e55b87d4ff9bd6610a1bd05d71159e30c8afb1fda542d233630ae164770e652baa7ea51117211489
HEAD_REF master
)
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES
"${CMAKE_CURRENT_LIST_DIR}/0001-win64-cmake.patch"
"${CMAKE_CURRENT_LIST_DIR}/cmake.patch"
"${CMAKE_CURRENT_LIST_DIR}/cmake-2.patch"
"${CMAKE_CURRENT_LIST_DIR}/win64-cmake.patch"
"${CMAKE_CURRENT_LIST_DIR}/output_folders-cmake.patch"
)
vcpkg_configure_cmake(
@ -34,6 +33,7 @@ vcpkg_configure_cmake(
-DWITH_TLS=ON
-DWITH_TLS_PSK=ON
-DWITH_THREADING=ON
-DDOCUMENTATION=OFF
OPTIONS_RELEASE
-DENABLE_DEBUG=OFF
OPTIONS_DEBUG

View File

@ -0,0 +1,50 @@
diff --git a/config.h b/config.h
index 906fad4..d5b2a72 100644
--- a/config.h
+++ b/config.h
@@ -15,7 +15,7 @@
# define EPROTO ECONNABORTED
#endif
-#ifdef WIN32
+#ifdef WIN32 || WIN64
# ifndef strcasecmp
# define strcasecmp strcmpi
# endif
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index d537e77..272b60a 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -6,12 +6,8 @@ option(WITH_THREADING "Include client library threading support?" ON)
if (${WITH_THREADING} STREQUAL ON)
add_definitions("-DWITH_THREADING")
if (WIN32)
- if (CMAKE_CL_64)
- set (PTHREAD_LIBRARIES C:\\pthreads\\Pre-built.2\\lib\\x64\\pthreadVC2.lib)
- else (CMAKE_CL_64)
- set (PTHREAD_LIBRARIES C:\\pthreads\\Pre-built.2\\lib\\x86\\pthreadVC2.lib)
- endif (CMAKE_CL_64)
- set (PTHREAD_INCLUDE_DIR C:\\pthreads\\Pre-built.2\\include)
+ find_library(PTHREAD_LIBRARIES NAMES pthreadsVC2)
+ find_path(PTHREAD_INCLUDE_DIR pthread.h)
else (WIN32)
find_library(LIBPTHREAD pthread)
if (LIBPTHREAD)
diff --git a/lib/net_mosq.h b/lib/net_mosq.h
index b5d8549..be60659 100644
--- a/lib/net_mosq.h
+++ b/lib/net_mosq.h
@@ -20,7 +20,12 @@
#include <unistd.h>
#else
#include <winsock2.h>
+#if defined(_MSC_VER) && _MSC_VER > 1900
+#undef ssize_t
typedef int ssize_t;
+#else
+typedef int ssize_t;
+#endif
#endif
#include "mosquitto_internal.h"