--- Makefile (revision 536994) +++ Makefile (working copy) @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= mosquitto -PORTVERSION= 1.6.7 +PORTVERSION= 1.6.8 CATEGORIES= net MASTER_SITES= http://mosquitto.org/files/source/ @@ -23,7 +23,7 @@ PLIST_SUB= PORTVERSION=${PORTVERSION} -OPTIONS_DEFINE= CARES WS +OPTIONS_DEFINE= CARES WS NETDATA OPTIONS_DEFAULT= CARES CARES_LIB_DEPENDS= libcares.so:dns/c-ares @@ -33,6 +33,9 @@ WS_LIB_DEPENDS= libwebsockets.so:net/libwebsockets WS_CMAKE_ON= -DWITH_WEBSOCKETS:BOOL=ON +NETDATA_DESC= Apply netdata compatibility patches +NETDATA_EXTRA_PATCHES= ${FILESDIR}/extra-patch-netdata + post-patch: @${REINPLACE_CMD} -e '/ldconfig/d' ${WRKSRC}/src/CMakeLists.txt \ ${WRKSRC}/lib/CMakeLists.txt ${WRKSRC}/lib/cpp/CMakeLists.txt --- distinfo (revision 536994) +++ distinfo (working copy) @@ -1,3 +1,3 @@ -TIMESTAMP = 1571605357 -SHA256 (mosquitto-1.6.7.tar.gz) = bcd31a8fbbd053fee328986fadd8666d3058357ded56b9782f7d4f19931d178e -SIZE (mosquitto-1.6.7.tar.gz) = 591062 +TIMESTAMP = 1590873457 +SHA256 (mosquitto-1.6.8.tar.gz) = 7df23c81ca37f0e070574fe74414403cf25183016433d07add6134366fb45df6 +SIZE (mosquitto-1.6.8.tar.gz) = 589873 --- files/extra-patch-netdata (nonexistent) +++ files/extra-patch-netdata (working copy) @@ -0,0 +1,96 @@ +--- lib/mosquitto.c ++++ lib/mosquitto.c +@@ -75,6 +75,14 @@ int mosquitto_lib_cleanup(void) + return MOSQ_ERR_SUCCESS; + } + ++int mosquitto_external_callbacks_set(struct mosquitto *mosq, size_t (*external_write_fnc)(void *buf, size_t count), size_t (*external_read_fnc)(void *buf, size_t count)) ++{ ++ if(mosq) { ++ mosq->external_read_fnc = external_read_fnc; ++ mosq->external_write_fnc = external_write_fnc; ++ } ++} ++ + struct mosquitto *mosquitto_new(const char *id, bool clean_start, void *userdata) + { + struct mosquitto *mosq = NULL; +--- lib/mosquitto.h ++++ lib/mosquitto.h +@@ -222,6 +222,7 @@ libmosq_EXPORT int mosquitto_lib_init(void); + */ + libmosq_EXPORT int mosquitto_lib_cleanup(void); + ++libmosq_EXPORT int mosquitto_external_callbacks_set(struct mosquitto *mosq, size_t (*external_write_fnc)(void *buf, size_t count), size_t (*external_read_fnc)(void *buf, size_t count)); + + /* ====================================================================== + * +--- lib/mosquitto_internal.h ++++ lib/mosquitto_internal.h +@@ -346,6 +346,8 @@ struct mosquitto { + #ifdef WITH_EPOLL + uint32_t events; + #endif ++ size_t (*external_read_fnc)(void *buf, size_t count); ++ size_t (*external_write_fnc)(void *buf, size_t count); + }; + + #define STREMPTY(str) (str[0] == '\0') +--- lib/net_mosq.c ++++ lib/net_mosq.c +@@ -824,6 +824,11 @@ int net__socket_connect_step3(struct mosquitto *mosq, const char *host) + /* Create a socket and connect it to 'ip' on port 'port'. */ + int net__socket_connect(struct mosquitto *mosq, const char *host, uint16_t port, const char *bind_address, bool blocking) + { ++ if(mosq->external_write_fnc) { ++ mosq->sock = 777; ++ return MOSQ_ERR_SUCCESS; ++ } ++ + mosq_sock_t sock = INVALID_SOCKET; + int rc, rc2; + +@@ -853,6 +858,10 @@ ssize_t net__read(struct mosquitto *mosq, void *buf, size_t count) + int err; + #endif + assert(mosq); ++ ++ if(mosq->external_read_fnc) ++ return mosq->external_read_fnc(buf, count); ++ + errno = 0; + #ifdef WITH_TLS + if(mosq->ssl){ +@@ -900,6 +909,9 @@ ssize_t net__write(struct mosquitto *mosq, void *buf, size_t count) + #endif + assert(mosq); + ++ if(mosq->external_write_fnc) ++ return mosq->external_write_fnc(buf, count); ++ + errno = 0; + #ifdef WITH_TLS + if(mosq->ssl){ + +--- lib/mosquitto.c ++++ lib/mosquitto.c +@@ -75,7 +75,7 @@ int mosquitto_lib_cleanup(void) + return MOSQ_ERR_SUCCESS; + } + +-int mosquitto_external_callbacks_set(struct mosquitto *mosq, size_t (*external_write_fnc)(void *buf, size_t count), size_t (*external_read_fnc)(void *buf, size_t count)) ++void mosquitto_external_callbacks_set(struct mosquitto *mosq, size_t (*external_write_fnc)(void *buf, size_t count), size_t (*external_read_fnc)(void *buf, size_t count)) + { + if(mosq) { + mosq->external_read_fnc = external_read_fnc; +--- lib/mosquitto.h ++++ lib/mosquitto.h +@@ -222,7 +222,7 @@ libmosq_EXPORT int mosquitto_lib_init(void); + */ + libmosq_EXPORT int mosquitto_lib_cleanup(void); + +-libmosq_EXPORT int mosquitto_external_callbacks_set(struct mosquitto *mosq, size_t (*external_write_fnc)(void *buf, size_t count), size_t (*external_read_fnc)(void *buf, size_t count)); ++libmosq_EXPORT void mosquitto_external_callbacks_set(struct mosquitto *mosq, size_t (*external_write_fnc)(void *buf, size_t count), size_t (*external_read_fnc)(void *buf, size_t count)); + + /* ====================================================================== + * --- files/patch-CMakeLists.txt (revision 536994) +++ files/patch-CMakeLists.txt (working copy) @@ -1,8 +1,8 @@ Index: CMakeLists.txt =================================================================== ---- CMakeLists.txt.orig +--- CMakeLists.txt.orig 2019-11-28 17:15:13 UTC +++ CMakeLists.txt -@@ -15,6 +15,9 @@ set (VERSION 1.6.4) +@@ -15,6 +15,9 @@ set (VERSION 1.6.8) add_definitions (-DCMAKE -DVERSION=\"${VERSION}\") @@ -12,15 +12,3 @@ if (WIN32) add_definitions("-D_CRT_SECURE_NO_WARNINGS") add_definitions("-D_CRT_NONSTDC_NO_DEPRECATE") -@@ -108,9 +111,9 @@ install(FILES mosquitto.conf aclfile.exa - # ======================================== - - configure_file(libmosquitto.pc.in libmosquitto.pc @ONLY) --install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libmosquitto.pc" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/pkgconfig") -+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libmosquitto.pc" DESTINATION "${CMAKE_INSTALL_PREFIX}/libdata/pkgconfig") - configure_file(libmosquittopp.pc.in libmosquittopp.pc @ONLY) --install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libmosquittopp.pc" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/pkgconfig") -+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libmosquittopp.pc" DESTINATION "${CMAKE_INSTALL_PREFIX}/libdata/pkgconfig") - - # ======================================== - # Testing --- files/patch-config.mk (revision 536994) +++ files/patch-config.mk (working copy) @@ -1,8 +1,8 @@ Index: config.mk =================================================================== ---- config.mk.orig +--- config.mk.orig 2019-11-28 17:15:13 UTC +++ config.mk -@@ -283,7 +283,7 @@ ifeq ($(WITH_WEBSOCKETS),static) +@@ -288,7 +288,7 @@ ifeq ($(WITH_WEBSOCKETS),static) endif INSTALL?=install --- files/patch-mosquitto.conf (revision 536994) +++ files/patch-mosquitto.conf (working copy) @@ -1,6 +1,6 @@ Index: mosquitto.conf =================================================================== ---- mosquitto.conf.orig +--- mosquitto.conf.orig 2019-11-28 17:15:13 UTC +++ mosquitto.conf @@ -158,7 +158,7 @@ # This should be set to /var/run/mosquitto.pid if mosquitto is --- files/patch-src_CMakeLists.txt (revision 536994) +++ files/patch-src_CMakeLists.txt (working copy) @@ -1,6 +1,6 @@ Index: src/CMakeLists.txt =================================================================== ---- src/CMakeLists.txt.orig +--- src/CMakeLists.txt.orig 2019-11-28 17:15:13 UTC +++ src/CMakeLists.txt @@ -126,6 +126,7 @@ if (WIN32 OR CYGWIN) endif (WIN32 OR CYGWIN) --- files/patch-src_mosquitto__passwd.c (revision 536994) +++ files/patch-src_mosquitto__passwd.c (working copy) @@ -1,8 +1,8 @@ Index: src/mosquitto_passwd.c =================================================================== ---- src/mosquitto_passwd.c.orig +--- src/mosquitto_passwd.c.orig 2019-11-28 17:15:13 UTC +++ src/mosquitto_passwd.c -@@ -141,7 +141,7 @@ int output_new_password(FILE *fptr, cons +@@ -141,7 +141,7 @@ int output_new_password(FILE *fptr, const char *userna unsigned char hash[EVP_MAX_MD_SIZE]; unsigned int hash_len; const EVP_MD *digest; @@ -11,7 +11,7 @@ EVP_MD_CTX context; #else EVP_MD_CTX *context; -@@ -168,7 +168,7 @@ int output_new_password(FILE *fptr, cons +@@ -168,7 +168,7 @@ int output_new_password(FILE *fptr, const char *userna return 1; } --- files/patch-src_security__default.c (revision 536994) +++ files/patch-src_security__default.c (working copy) @@ -1,4 +1,4 @@ ---- src/security_default.c.orig 2018-10-11 00:28:56 UTC +--- src/security_default.c.orig 2019-11-28 17:15:13 UTC +++ src/security_default.c @@ -18,7 +18,7 @@ Contributors: @@ -8,4 +8,4 @@ +#include #include "mosquitto_broker_internal.h" #include "memory_mosq.h" - #include "util_mosq.h" + #include "mqtt_protocol.h"