From 07d8fb54dd8c3a1df9fd5c97fe5b698371ffe6c5 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Wed, 25 Jan 2017 00:23:22 +0100 Subject: [PATCH] mosquitto: Include the mosquitto broker (#613) --- packages/libmosquitto/add-liblog.patch | 12 +++++++ packages/libmosquitto/build.sh | 21 ++++------- packages/libmosquitto/config.patch | 36 ------------------- ...t.patch => detect-librt-and-pthread.patch} | 19 ++++++++++ packages/libmosquitto/mosquitto.subpackage.sh | 6 ++-- packages/libmosquitto/src-conf.c.patch | 15 ++++++++ 6 files changed, 55 insertions(+), 54 deletions(-) create mode 100644 packages/libmosquitto/add-liblog.patch delete mode 100644 packages/libmosquitto/config.patch rename packages/libmosquitto/{lib-CMakeLists.txt.patch => detect-librt-and-pthread.patch} (61%) create mode 100644 packages/libmosquitto/src-conf.c.patch diff --git a/packages/libmosquitto/add-liblog.patch b/packages/libmosquitto/add-liblog.patch new file mode 100644 index 000000000..dffe1da1d --- /dev/null +++ b/packages/libmosquitto/add-liblog.patch @@ -0,0 +1,12 @@ +diff -u -r ../mosquitto-1.4.10/src/CMakeLists.txt ./src/CMakeLists.txt +--- ../mosquitto-1.4.10/src/CMakeLists.txt 2016-08-17 13:05:14.000000000 +0200 ++++ ./src/CMakeLists.txt 2017-01-24 23:40:30.787022276 +0100 +@@ -107,7 +111,7 @@ + endif (UUID_HEADER) + endif(NOT APPLE) + +-target_link_libraries(mosquitto ${MOSQ_LIBS}) ++target_link_libraries(mosquitto ${MOSQ_LIBS} log) + + if (UNIX) + if (APPLE) diff --git a/packages/libmosquitto/build.sh b/packages/libmosquitto/build.sh index 71b969687..07d7d1a77 100644 --- a/packages/libmosquitto/build.sh +++ b/packages/libmosquitto/build.sh @@ -1,21 +1,12 @@ -TERMUX_PKG_DESCRIPTION="MQTT library" TERMUX_PKG_HOMEPAGE=https://mosquitto.org/ +TERMUX_PKG_DESCRIPTION="MQTT library" TERMUX_PKG_VERSION=1.4.10 +TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://mosquitto.org/files/source/mosquitto-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=437648d68a4a781dd8d913814cd5451f59ab4a5fcf84cccaf7c36e6a07459770 -TERMUX_PKG_BUILD_IN_SRC=Yes TERMUX_PKG_DEPENDS="c-ares, openssl" TERMUX_PKG_MAINTAINER="Nathaniel Wesley Filardo @nwf" - -termux_step_configure() { - # Prevent cmake configuration. - return -} - -termux_step_make() { - for i in lib client; do make -C $i; done -} -termux_step_make_install() { - for i in lib client; do make -C $i DESTDIR=${TERMUX_PREFIX} install; done -} - +TERMUX_PKG_EXTRA_CONFIGURE_ARGS="\ +-DWITH_THREADING=OFF +-DWITH_TLS_PSK=OFF" +TERMUX_PKG_RM_AFTER_INSTALL="include/mosquittopp.h lib/libmosquittopp.so" diff --git a/packages/libmosquitto/config.patch b/packages/libmosquitto/config.patch deleted file mode 100644 index 2505036a8..000000000 --- a/packages/libmosquitto/config.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git a/config.mk b/config.mk -index 087766c..6ff9bc1 100644 ---- a/config.mk -+++ b/config.mk -@@ -26,10 +26,10 @@ WITH_TLS:=yes - # Comment out to disable TLS/PSK support in the broker and client. Requires - # WITH_TLS=yes. - # This must be disabled if using openssl < 1.0. --WITH_TLS_PSK:=yes -+WITH_TLS_PSK:=no - - # Comment out to disable client client threading support. --WITH_THREADING:=yes -+WITH_THREADING:=no - - # Comment out to remove bridge support from the broker. This allow the broker - # to connect to other brokers and subscribe/publish to topics. You probably -@@ -124,8 +124,7 @@ LIB_LIBS:= - PASSWD_LIBS:= - - ifeq ($(UNAME),Linux) -- BROKER_LIBS:=$(BROKER_LIBS) -lrt -Wl,--dynamic-list=linker.syms -- LIB_LIBS:=$(LIB_LIBS) -lrt -+ BROKER_LIBS:=$(BROKER_LIBS) -Wl,--dynamic-list=linker.syms - endif - - CLIENT_LDFLAGS:=$(LDFLAGS) -L../lib ../lib/libmosquitto.so.${SOVERSION} -@@ -241,7 +240,7 @@ ifeq ($(WITH_DOCS),yes) - endif - - INSTALL?=install --prefix=/usr/local -+prefix= - mandir=${prefix}/share/man - localedir=${prefix}/share/locale - STRIP?=strip diff --git a/packages/libmosquitto/lib-CMakeLists.txt.patch b/packages/libmosquitto/detect-librt-and-pthread.patch similarity index 61% rename from packages/libmosquitto/lib-CMakeLists.txt.patch rename to packages/libmosquitto/detect-librt-and-pthread.patch index 5e3d2c2e7..f3edd2173 100644 --- a/packages/libmosquitto/lib-CMakeLists.txt.patch +++ b/packages/libmosquitto/detect-librt-and-pthread.patch @@ -1,3 +1,22 @@ +Submitted for upstream inclusion at: +https://github.com/eclipse/mosquitto/pull/360 + +diff -u -r ../mosquitto-1.4.10/src/CMakeLists.txt ./src/CMakeLists.txt +--- ../mosquitto-1.4.10/src/CMakeLists.txt 2016-08-17 13:05:14.000000000 +0200 ++++ ./src/CMakeLists.txt 2017-01-24 22:30:42.611308509 +0100 +@@ -86,7 +86,11 @@ + if (APPLE) + set (MOSQ_LIBS ${MOSQ_LIBS} dl m) + else (APPLE) +- set (MOSQ_LIBS ${MOSQ_LIBS} rt dl m) ++ set (MOSQ_LIBS ${MOSQ_LIBS} dl m) ++ find_library(LIBRT rt) ++ if (LIBRT) ++ set (MOSQ_LIBS ${MOSQ_LIBS} rt) ++ endif (LIBRT) + endif (APPLE) + endif (UNIX) + diff -u -r ../mosquitto-1.4.10/lib/CMakeLists.txt ./lib/CMakeLists.txt --- ../mosquitto-1.4.10/lib/CMakeLists.txt 2016-08-17 13:05:14.000000000 +0200 +++ ./lib/CMakeLists.txt 2017-01-15 21:09:21.548573341 +0100 diff --git a/packages/libmosquitto/mosquitto.subpackage.sh b/packages/libmosquitto/mosquitto.subpackage.sh index a5426f891..0ce22843d 100644 --- a/packages/libmosquitto/mosquitto.subpackage.sh +++ b/packages/libmosquitto/mosquitto.subpackage.sh @@ -1,3 +1,3 @@ -TERMUX_SUBPKG_DEPENDS="libmosquitto" -TERMUX_SUBPKG_INCLUDE="bin/mosquitto_pub bin/mosquitto_sub" -TERMUX_SUBPKG_DESCRIPTION="mosquitto_pub and _sub clients" +TERMUX_SUBPKG_DEPENDS="libmosquitto, libuuid" +TERMUX_SUBPKG_INCLUDE="bin/ share/man/ etc/" +TERMUX_SUBPKG_DESCRIPTION="MQTT version 3.1/3.1.1 compatible message broker and clients" diff --git a/packages/libmosquitto/src-conf.c.patch b/packages/libmosquitto/src-conf.c.patch new file mode 100644 index 000000000..3aa506627 --- /dev/null +++ b/packages/libmosquitto/src-conf.c.patch @@ -0,0 +1,15 @@ +Submitted for upstream inclusion at: +https://github.com/eclipse/mosquitto/pull/361 + +diff -u -r ../mosquitto-1.4.10/src/conf.c ./src/conf.c +--- ../mosquitto-1.4.10/src/conf.c 2016-08-17 13:05:14.000000000 +0200 ++++ ./src/conf.c 2017-01-24 10:50:34.011878190 +0100 +@@ -36,7 +36,7 @@ + #endif + + #if !defined(WIN32) && !defined(__CYGWIN__) +-# include ++# include + #endif + + #include