diff options
| author | Gianfranco Costamagna <gianfranco.costamagna@abinsula.com> | 2020-01-25 19:52:17 +0100 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2020-01-25 12:44:25 -0800 |
| commit | 318627819b61ec8f433d47be6ca45db07a6fb930 (patch) | |
| tree | 645dbb548c70e46c6dd18962e5ebe2ea38fd7186 | |
| parent | c063eb6472b3fde419032ea5a00e02df40acfed6 (diff) | |
| download | meta-openembedded-318627819b61ec8f433d47be6ca45db07a6fb930.tar.gz | |
mosquitto: apply upstream proposed patches to use cmake build system,
simplifying a lot the build and install process.
Signed-off-by: Gianfranco Costamagna <costamagnagianfranco@yahoo.it>
Signed-off-by: Gianfranco Costamagna <gianfranco.costamagna@abinsula.com>
Signed-off-by: Gianfranco Costamagna <locutusofborg@debian.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
5 files changed, 173 insertions, 27 deletions
diff --git a/meta-networking/recipes-connectivity/mosquitto/files/1568.patch b/meta-networking/recipes-connectivity/mosquitto/files/1568.patch new file mode 100644 index 0000000000..15f7a91057 --- /dev/null +++ b/meta-networking/recipes-connectivity/mosquitto/files/1568.patch | |||
| @@ -0,0 +1,67 @@ | |||
| 1 | Upstream-Status: Submitted [https://github.com/eclipse/mosquitto/pull/1568] | ||
| 2 | From 50bfc79cae5764a6e513b684a5eb5bef2b35c856 Mon Sep 17 00:00:00 2001 | ||
| 3 | From: Gianfranco Costamagna <costamagnagianfranco@yahoo.it> | ||
| 4 | Date: Wed, 22 Jan 2020 12:30:25 +0100 | ||
| 5 | Subject: [PATCH] Bugfix: include "deps" directory only if BUNDLED_DEPS has | ||
| 6 | been provided and set to true | ||
| 7 | |||
| 8 | Signed-off-by: Gianfranco Costamagna <costamagnagianfranco@yahoo.it> | ||
| 9 | --- | ||
| 10 | config.mk | 5 ++++- | ||
| 11 | lib/CMakeLists.txt | 5 ++++- | ||
| 12 | test/unit/Makefile | 6 +++++- | ||
| 13 | 3 files changed, 13 insertions(+), 3 deletions(-) | ||
| 14 | |||
| 15 | diff --git a/config.mk b/config.mk | ||
| 16 | index 51e36e0d0..0ac24b3d4 100644 | ||
| 17 | --- a/config.mk | ||
| 18 | +++ b/config.mk | ||
| 19 | @@ -135,7 +135,10 @@ endif | ||
| 20 | |||
| 21 | STATIC_LIB_DEPS:= | ||
| 22 | |||
| 23 | -LIB_CPPFLAGS=$(CPPFLAGS) -I. -I.. -I../lib -I../src/deps | ||
| 24 | +LIB_CPPFLAGS=$(CPPFLAGS) -I. -I.. -I../lib | ||
| 25 | +ifeq ($(WITH_BUNDLED_DEPS),yes) | ||
| 26 | + LIB_CPPFLAGS:=$(LIB_CPPFLAGS) -I../src/deps | ||
| 27 | +endif | ||
| 28 | LIB_CFLAGS:=$(CFLAGS) | ||
| 29 | LIB_CXXFLAGS:=$(CXXFLAGS) | ||
| 30 | LIB_LDFLAGS:=$(LDFLAGS) | ||
| 31 | diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt | ||
| 32 | index e1521f12a..891046a81 100644 | ||
| 33 | --- a/lib/CMakeLists.txt | ||
| 34 | +++ b/lib/CMakeLists.txt | ||
| 35 | @@ -1,11 +1,14 @@ | ||
| 36 | add_subdirectory(cpp) | ||
| 37 | |||
| 38 | include_directories(${mosquitto_SOURCE_DIR} ${mosquitto_SOURCE_DIR}/lib | ||
| 39 | - ${mosquitto_SOURCE_DIR}/src/deps | ||
| 40 | ${STDBOOL_H_PATH} ${STDINT_H_PATH} | ||
| 41 | ${OPENSSL_INCLUDE_DIR} ${PTHREAD_INCLUDE_DIR}) | ||
| 42 | link_directories(${mosquitto_SOURCE_DIR}/lib) | ||
| 43 | |||
| 44 | +if (WITH_BUNDLED_DEPS) | ||
| 45 | + include_directories(${mosquitto_SOURCE_DIR} ${mosquitto_SOURCE_DIR}/src/deps) | ||
| 46 | +endif (WITH_BUNDLED_DEPS) | ||
| 47 | + | ||
| 48 | set(C_SRC | ||
| 49 | actions.c | ||
| 50 | callbacks.c | ||
| 51 | diff --git a/test/unit/Makefile b/test/unit/Makefile | ||
| 52 | index 9d422428d..928579492 100644 | ||
| 53 | --- a/test/unit/Makefile | ||
| 54 | +++ b/test/unit/Makefile | ||
| 55 | @@ -2,7 +2,11 @@ include ../../config.mk | ||
| 56 | |||
| 57 | .PHONY: all check test test-broker test-lib clean coverage | ||
| 58 | |||
| 59 | -CPPFLAGS:=$(CPPFLAGS) -I../.. -I../../lib -I../../src -I../../src/deps | ||
| 60 | +CPPFLAGS:=$(CPPFLAGS) -I../.. -I../../lib -I../../src | ||
| 61 | +ifeq ($(WITH_BUNDLED_DEPS),yes) | ||
| 62 | + CPPFLAGS:=$(CPPFLAGS) -I../../src/deps | ||
| 63 | +endif | ||
| 64 | + | ||
| 65 | CFLAGS:=$(CFLAGS) -coverage -Wall -ggdb | ||
| 66 | LDFLAGS:=$(LDFLAGS) -coverage | ||
| 67 | LDADD:=$(LDADD) -lcunit | ||
diff --git a/meta-networking/recipes-connectivity/mosquitto/files/1569.patch b/meta-networking/recipes-connectivity/mosquitto/files/1569.patch new file mode 100644 index 0000000000..9718b98c82 --- /dev/null +++ b/meta-networking/recipes-connectivity/mosquitto/files/1569.patch | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | Upstream-Status: Submitted [https://github.com/eclipse/mosquitto/pull/1569] | ||
| 2 | From fda932612afce2cead2fd2ca1c8ea543b2892177 Mon Sep 17 00:00:00 2001 | ||
| 3 | From: Gianfranco Costamagna <costamagnagianfranco@yahoo.it> | ||
| 4 | Date: Wed, 22 Jan 2020 12:31:01 +0100 | ||
| 5 | Subject: [PATCH] Bugfix: enabling DLT was overriding everything else on linker | ||
| 6 | flags because of error in cmake set keyword | ||
| 7 | |||
| 8 | Signed-off-by: Gianfranco Costamagna <costamagnagianfranco@yahoo.it> | ||
| 9 | --- | ||
| 10 | src/CMakeLists.txt | 2 +- | ||
| 11 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 12 | |||
| 13 | diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt | ||
| 14 | index 7898ff5b1..6dfbba5e6 100644 | ||
| 15 | --- a/src/CMakeLists.txt | ||
| 16 | +++ b/src/CMakeLists.txt | ||
| 17 | @@ -130,7 +130,7 @@ add_definitions (-DWITH_BROKER) | ||
| 18 | if (WITH_DLT) | ||
| 19 | message(STATUS "DLT_LIBDIR = ${DLT_LIBDIR}") | ||
| 20 | link_directories(${DLT_LIBDIR}) | ||
| 21 | - set (MOSQ_LIBS ${DLT_LIBRARIES}) | ||
| 22 | + set (MOSQ_LIBS ${MOSQ_LIBS} ${DLT_LIBRARIES}) | ||
| 23 | endif (WITH_DLT) | ||
| 24 | |||
| 25 | set (MOSQ_LIBS ${MOSQ_LIBS} ${OPENSSL_LIBRARIES}) | ||
diff --git a/meta-networking/recipes-connectivity/mosquitto/files/1570.patch b/meta-networking/recipes-connectivity/mosquitto/files/1570.patch new file mode 100644 index 0000000000..f11fc48150 --- /dev/null +++ b/meta-networking/recipes-connectivity/mosquitto/files/1570.patch | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | Upstream-Status: Submitted [https://github.com/eclipse/mosquitto/pull/1570] | ||
| 2 | From 775677b05190380c3736bf0dbef002ee7b9bff33 Mon Sep 17 00:00:00 2001 | ||
| 3 | From: Gianfranco Costamagna <costamagnagianfranco@yahoo.it> | ||
| 4 | Date: Wed, 22 Jan 2020 12:29:41 +0100 | ||
| 5 | Subject: [PATCH] cmake: add ADNS enable/disable dynamic support | ||
| 6 | |||
| 7 | Signed-off-by: Gianfranco Costamagna <costamagnagianfranco@yahoo.it> | ||
| 8 | --- | ||
| 9 | src/CMakeLists.txt | 8 ++++++-- | ||
| 10 | 1 file changed, 6 insertions(+), 2 deletions(-) | ||
| 11 | |||
| 12 | diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt | ||
| 13 | index 7898ff5b1..edae76f32 100644 | ||
| 14 | --- a/src/CMakeLists.txt | ||
| 15 | +++ b/src/CMakeLists.txt | ||
| 16 | @@ -105,6 +105,9 @@ if (WITH_SYS_TREE) | ||
| 17 | add_definitions("-DWITH_SYS_TREE") | ||
| 18 | endif (WITH_SYS_TREE) | ||
| 19 | |||
| 20 | +option(WITH_ADNS | ||
| 21 | + "Include ADNS support?" OFF) | ||
| 22 | + | ||
| 23 | if (CMAKE_SYSTEM_NAME STREQUAL Linux) | ||
| 24 | option(WITH_SYSTEMD | ||
| 25 | "Include systemd support?" OFF) | ||
| 26 | @@ -137,10 +140,11 @@ set (MOSQ_LIBS ${MOSQ_LIBS} ${OPENSSL_LIBRARIES}) | ||
| 27 | # Check for getaddrinfo_a | ||
| 28 | include(CheckLibraryExists) | ||
| 29 | check_library_exists(anl getaddrinfo_a "" HAVE_GETADDRINFO_A) | ||
| 30 | -if (HAVE_GETADDRINFO_A) | ||
| 31 | +if (HAVE_GETADDRINFO_A AND WITH_ADNS) | ||
| 32 | + add_definitions("-DWITH_ADNS") | ||
| 33 | add_definitions(-DHAVE_GETADDRINFO_A) | ||
| 34 | set (MOSQ_LIBS ${MOSQ_LIBS} anl) | ||
| 35 | -endif (HAVE_GETADDRINFO_A) | ||
| 36 | +endif (HAVE_GETADDRINFO_A AND WITH_ADNS) | ||
| 37 | |||
| 38 | |||
| 39 | if (UNIX) | ||
diff --git a/meta-networking/recipes-connectivity/mosquitto/files/1571.patch b/meta-networking/recipes-connectivity/mosquitto/files/1571.patch new file mode 100644 index 0000000000..2cfa48457a --- /dev/null +++ b/meta-networking/recipes-connectivity/mosquitto/files/1571.patch | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | Upstream-Status: Submitted [https://github.com/eclipse/mosquitto/pull/1571] | ||
| 2 | From 3fe5468f1bdca1bff1d18cf43c9e338f41aa9e32 Mon Sep 17 00:00:00 2001 | ||
| 3 | From: Gianfranco Costamagna <costamagnagianfranco@yahoo.it> | ||
| 4 | Date: Wed, 22 Jan 2020 12:39:49 +0100 | ||
| 5 | Subject: [PATCH] Add dynamic symbols linking with cmake too | ||
| 6 | |||
| 7 | Signed-off-by: Gianfranco Costamagna <costamagnagianfranco@yahoo.it> | ||
| 8 | --- | ||
| 9 | lib/CMakeLists.txt | 2 ++ | ||
| 10 | 1 file changed, 2 insertions(+) | ||
| 11 | |||
| 12 | diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt | ||
| 13 | index e1521f12a..14ba12739 100644 | ||
| 14 | --- a/lib/CMakeLists.txt | ||
| 15 | +++ b/lib/CMakeLists.txt | ||
| 16 | @@ -88,6 +88,8 @@ set_target_properties(libmosquitto PROPERTIES | ||
| 17 | OUTPUT_NAME mosquitto | ||
| 18 | VERSION ${VERSION} | ||
| 19 | SOVERSION 1 | ||
| 20 | + LINK_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/linker.version | ||
| 21 | + LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/linker.version" | ||
| 22 | ) | ||
| 23 | |||
| 24 | install(TARGETS libmosquitto RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") | ||
diff --git a/meta-networking/recipes-connectivity/mosquitto/mosquitto_1.6.8.bb b/meta-networking/recipes-connectivity/mosquitto/mosquitto_1.6.8.bb index ea533d8a02..6079555a0c 100644 --- a/meta-networking/recipes-connectivity/mosquitto/mosquitto_1.6.8.bb +++ b/meta-networking/recipes-connectivity/mosquitto/mosquitto_1.6.8.bb | |||
| @@ -16,45 +16,36 @@ DEPENDS = "uthash" | |||
| 16 | 16 | ||
| 17 | SRC_URI = "http://mosquitto.org/files/source/mosquitto-${PV}.tar.gz \ | 17 | SRC_URI = "http://mosquitto.org/files/source/mosquitto-${PV}.tar.gz \ |
| 18 | file://mosquitto.init \ | 18 | file://mosquitto.init \ |
| 19 | file://1568.patch \ | ||
| 20 | file://1569.patch \ | ||
| 21 | file://1570.patch \ | ||
| 22 | file://1571.patch \ | ||
| 19 | " | 23 | " |
| 20 | 24 | ||
| 21 | SRC_URI[md5sum] = "24a0e567c845b3e41b75e237d200edf8" | 25 | SRC_URI[md5sum] = "24a0e567c845b3e41b75e237d200edf8" |
| 22 | SRC_URI[sha256sum] = "7df23c81ca37f0e070574fe74414403cf25183016433d07add6134366fb45df6" | 26 | SRC_URI[sha256sum] = "7df23c81ca37f0e070574fe74414403cf25183016433d07add6134366fb45df6" |
| 23 | 27 | ||
| 24 | inherit systemd update-rc.d useradd | 28 | inherit systemd update-rc.d useradd cmake |
| 25 | 29 | ||
| 26 | PACKAGECONFIG ??= "ssl uuid \ | 30 | PACKAGECONFIG ??= "ssl dlt websockets dns-srv\ |
| 27 | ${@bb.utils.filter('DISTRO_FEATURES','systemd', d)} \ | 31 | ${@bb.utils.filter('DISTRO_FEATURES','systemd', d)} \ |
| 28 | " | 32 | " |
| 29 | 33 | ||
| 30 | PACKAGECONFIG[dns-srv] = "WITH_SRV=yes,WITH_SRV=no,c-ares" | 34 | PACKAGECONFIG[dns-srv] = "-DWITH_SRV=ON,-DWITH_SRV=OFF,c-ares" |
| 31 | PACKAGECONFIG[ssl] = "WITH_TLS=yes WITH_TLS_PSK=yes,WITH_TLS=no WITH_TLS_PSK=no,openssl" | 35 | PACKAGECONFIG[ssl] = "-DWITH_TLS=ON -DWITH_TLS_PSK=ON -DWITH_EC=ON,-DWITH_TLS=OFF -DWITH_TLS_PSK=OFF -DWITH_EC_OFF,openssl" |
| 32 | PACKAGECONFIG[uuid] = "WITH_UUID=yes,WITH_UUID=no,util-linux" | 36 | PACKAGECONFIG[systemd] = "-DWITH_SYSTEMD=ON,-DWITH_SYSTEMD=OFF,systemd" |
| 33 | PACKAGECONFIG[systemd] = "WITH_SYSTEMD=yes,WITH_SYSTEMD=no,systemd" | 37 | PACKAGECONFIG[websockets] = "-DWITH_WEBSOCKETS=ON,-DWITH_WEBSOCKETS=OFF,libwebsockets" |
| 34 | PACKAGECONFIG[websockets] = "WITH_WEBSOCKETS=yes,WITH_WEBSOCKETS=no,libwebsockets" | 38 | PACKAGECONFIG[dlt] = "-DWITH_DLT=ON,-DWITH_DLT=OFF,dlt-daemon" |
| 35 | |||
| 36 | EXTRA_OEMAKE = " \ | ||
| 37 | prefix=${prefix} \ | ||
| 38 | mandir=${mandir} \ | ||
| 39 | localedir=${localedir} \ | ||
| 40 | ${PACKAGECONFIG_CONFARGS} \ | ||
| 41 | STRIP=/bin/true \ | ||
| 42 | WITH_DOCS=no \ | ||
| 43 | WITH_BUNDLED_DEPS=no \ | ||
| 44 | " | ||
| 45 | |||
| 46 | export LIB_SUFFIX = "${@d.getVar('baselib').replace('lib', '')}" | ||
| 47 | 39 | ||
| 48 | do_install() { | 40 | EXTRA_OECMAKE = " \ |
| 49 | oe_runmake 'DESTDIR=${D}' install | 41 | -DWITH_BUNDLED_DEPS=OFF \ |
| 42 | -DWITH_ADNS=ON \ | ||
| 43 | " | ||
| 50 | 44 | ||
| 45 | do_install_append() { | ||
| 51 | install -d ${D}${systemd_unitdir}/system/ | 46 | install -d ${D}${systemd_unitdir}/system/ |
| 52 | install -m 0644 ${S}/service/systemd/mosquitto.service.notify ${D}${systemd_unitdir}/system/mosquitto.service | 47 | install -m 0644 ${S}/service/systemd/mosquitto.service.notify ${D}${systemd_unitdir}/system/mosquitto.service |
| 53 | 48 | ||
| 54 | install -d ${D}${sysconfdir}/mosquitto | ||
| 55 | install -m 0644 ${D}${sysconfdir}/mosquitto/mosquitto.conf.example \ | ||
| 56 | ${D}${sysconfdir}/mosquitto/mosquitto.conf | ||
| 57 | |||
| 58 | install -d ${D}${sysconfdir}/init.d/ | 49 | install -d ${D}${sysconfdir}/init.d/ |
| 59 | install -m 0755 ${WORKDIR}/mosquitto.init ${D}${sysconfdir}/init.d/mosquitto | 50 | install -m 0755 ${WORKDIR}/mosquitto.init ${D}${sysconfdir}/init.d/mosquitto |
| 60 | sed -i -e 's,@SBINDIR@,${sbindir},g' \ | 51 | sed -i -e 's,@SBINDIR@,${sbindir},g' \ |
| @@ -77,9 +68,9 @@ FILES_${PN} = "${sbindir}/mosquitto \ | |||
| 77 | 68 | ||
| 78 | CONFFILES_${PN} += "${sysconfdir}/mosquitto/mosquitto.conf" | 69 | CONFFILES_${PN} += "${sysconfdir}/mosquitto/mosquitto.conf" |
| 79 | 70 | ||
| 80 | FILES_libmosquitto1 = "${libdir}/libmosquitto.so.1" | 71 | FILES_libmosquitto1 = "${libdir}/libmosquitto.so.*" |
| 81 | 72 | ||
| 82 | FILES_libmosquittopp1 = "${libdir}/libmosquittopp.so.1" | 73 | FILES_libmosquittopp1 = "${libdir}/libmosquittopp.so.*" |
| 83 | 74 | ||
| 84 | FILES_${PN}-clients = "${bindir}/mosquitto_pub \ | 75 | FILES_${PN}-clients = "${bindir}/mosquitto_pub \ |
| 85 | ${bindir}/mosquitto_sub \ | 76 | ${bindir}/mosquitto_sub \ |
