domoticz: update to 2026.4

Fetch the source asset from the release rather than the codeload
tarball: the webserver is now the libwebem submodule (previously the
in-tree webserver/ directory), and codeload tarballs do not include
submodules. It is built in and linked statically, as before.

Drop the patches which are obsoleted by the new release: the
development snapshot (and its version stamp), the telldus and boost
fixes, and the counter graph spike-spreading feature which was
accepted upstream as fillMissingDays(). Rebase the MQTT-AD duplicate
message patch.

Add two patches to libwebem, submitted upstream:
 - accept the MINIZIP::minizip imported target name exported by
   minizip-ng 4.x
 - fall back to pkg-config to find jsoncpp. We build with
   CMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY, as config-mode
   find_package() would otherwise find the build host's jsoncpp
   cmake config and link an x86_64 library into an aarch64 build.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
This commit is contained in:
David Woodhouse committed 2026-11-09 13:06:36 -08:00
1 parent 373e99f073
commit 16be13461c
6 files changed
+114 -58

No files matched your search

+16 -6
View File
@@ -8,12 +8,14 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=domoticz
PKG_VERSION:=2025.2
PKG_RELEASE:=4
PKG_VERSION:=2026.4
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/domoticz/domoticz/tar.gz/$(PKG_VERSION)?
PKG_HASH:=fd016f4ffe419e8d559bc0a7f9de5ec4fcaf485fc9d1464c8e8221102b13f589
# The codeload tarball lacks the extern/ submodules (libwebem); use the
# source asset from the release, which bundles them.
PKG_SOURCE:=domoticz_src_2026.18387.tar.gz
PKG_SOURCE_URL:=https://github.com/domoticz/domoticz/releases/download/$(PKG_VERSION)
PKG_HASH:=88964b791050abf6b6df3ec9e1d262d18e198a6fa108638974eca8600d1a4568
PKG_MAINTAINER:=David Woodhouse <dwmw2@infradead.org>
PKG_LICENSE:=GPL-3.0
@@ -26,6 +28,11 @@ PKG_BUILD_FLAGS:=no-mips16
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
# The tarball extracts to a bare domoticz/ directory; strip that so the
# build happens in the usual versioned directory.
TAR_OPTIONS:=--strip-components 1 $(TAR_OPTIONS)
TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
define Package/domoticz
SECTION:=utils
CATEGORY:=Utilities
@@ -33,6 +40,7 @@ define Package/domoticz
URL:=https://domoticz.com/
USERID:=domoticz=6144:domoticz=6144
DEPENDS:= \
+libatomic \
+boost \
+boost-date_time \
+boost-thread \
@@ -54,9 +62,11 @@ define Package/domoticz/description
Domoticz is a Home Automation System that lets you monitor and configure various devices like: Lights, Switches, various sensors/meters like Temperature, Rain, Wind, UV, Electra, Gas, Water and much more. Notifications/Alerts can be sent to any mobile device.
endef
TARGET_LDFLAGS += -latomic
CMAKE_OPTIONS += \
-DBUILD_SHARED_LIBS=yes \
-DBoost_NO_BOOST_CMAKE=yes \
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY \
-DGIT_SUBMODULE=no \
-DCMAKE_BUILD_TYPE=Release \
-DUSE_BUILTIN_MQTT=no \
@@ -1,41 +0,0 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -32,6 +32,7 @@ option(USE_PYTHON "Use Python for Plugin
option(INCLUDE_LINUX_I2C "Include I2C support" YES)
option(INCLUDE_SPI "Include SPI support" YES)
option(WITH_LIBUSB "Enable libusb support" YES)
+option(WITH_TELLDUSCORE "Enable Telldus support" YES)
# Link static or shared, external dependencies
option(USE_LUA_STATIC "Link LUA static" YES)
@@ -783,17 +784,19 @@ ELSE()
message(STATUS "GPIO is not available")
ENDIF()
-find_path(TELLDUSCORE_INCLUDE NAMES telldus-core.h)
-IF(TELLDUSCORE_INCLUDE)
- message(STATUS "Found telldus-core (telldus-core.h) at : ${TELLDUSCORE_INCLUDE}")
- find_library(TELLDUS_LIBRARIES NAMES libtelldus-core.so)
- IF(TELLDUS_LIBRARIES)
- message(STATUS "Found libtelldus-core at : ${TELLDUS_LIBRARIES}, adding telldus support")
- add_definitions(-DWITH_TELLDUSCORE)
- ENDIF(TELLDUS_LIBRARIES)
-ELSE()
- message(STATUS "Not found telldus-core (telldus-core.h), not adding tellstick support")
-ENDIF(TELLDUSCORE_INCLUDE)
+IF(WITH_TELLDUSCORE)
+ find_path(TELLDUSCORE_INCLUDE NAMES telldus-core.h)
+ IF(TELLDUSCORE_INCLUDE)
+ message(STATUS "Found telldus-core (telldus-core.h) at : ${TELLDUSCORE_INCLUDE}")
+ find_library(TELLDUS_LIBRARIES NAMES libtelldus-core.so)
+ IF(TELLDUS_LIBRARIES)
+ message(STATUS "Found libtelldus-core at : ${TELLDUS_LIBRARIES}, adding telldus support")
+ add_definitions(-DWITH_TELLDUSCORE)
+ ENDIF(TELLDUS_LIBRARIES)
+ ELSE()
+ message(STATUS "Not found telldus-core (telldus-core.h), not adding tellstick support")
+ ENDIF(TELLDUSCORE_INCLUDE)
+ENDIF(WITH_TELLDUSCORE)
# Handle resolving
check_function_exists(res_init HAVE_LIBC_RESOLV)
@@ -1,11 +0,0 @@
--- a/tcpserver/TCPServer.cpp
+++ b/tcpserver/TCPServer.cpp
@@ -59,7 +59,7 @@ namespace tcp {
// Post a call to the stop function so that server::stop() is safe to call
// from any thread.
flghandle_stop_Completed=false;
- boost::asio::post([this] { handle_stop(); });
+ boost::asio::post(io_context_, [this] { handle_stop(); });
}
void CTCPServerInt::handle_stop()
@@ -0,0 +1,27 @@
From 1b41f66000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: David Woodhouse <dwmw2@infradead.org>
Date: Fri, 31 Oct 2026 10:30:00 +0000
Subject: [PATCH] libwebem: accept the MINIZIP::minizip imported target name
The minizip cmake config shipped by minizip 4.x exports its imported
target in an uppercase MINIZIP:: namespace; webem only looked for
minizip::minizip and failed at generate time despite minizip_FOUND.
--- a/extern/libwebem/CMakeLists.txt
+++ b/extern/libwebem/CMakeLists.txt
@@ -207,10 +207,14 @@ if(WEBEM_ENABLE_ZIP)
target_link_libraries(webem PRIVATE minizip)
elseif(TARGET minizip::minizip)
target_link_libraries(webem PRIVATE minizip::minizip)
+ elseif(TARGET MINIZIP::minizip)
+ target_link_libraries(webem PRIVATE MINIZIP::minizip)
else()
find_package(minizip QUIET)
- if(minizip_FOUND)
+ if(TARGET minizip::minizip)
target_link_libraries(webem PRIVATE minizip::minizip)
+ elseif(TARGET MINIZIP::minizip)
+ target_link_libraries(webem PRIVATE MINIZIP::minizip)
else()
message(WARNING "minizip not found - disabling ZIP support. Install minizip to enable it.")
target_compile_definitions(webem PUBLIC WEBSERVER_DONT_USE_ZIP)
@@ -0,0 +1,35 @@
From 344e73e000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: David Woodhouse <dwmw2@infradead.org>
Date: Fri, 31 Oct 2026 10:31:00 +0000
Subject: [PATCH] libwebem: fall back to pkg-config to find jsoncpp
Distros (OpenWrt among them) may ship jsoncpp with only a pkg-config
file. Config-mode find_package() then finds nothing - or worse, when
cross-compiling, finds the build host's config and links a foreign-
architecture library. Try pkg-config, which handles cross-compilation
correctly, before resorting to FetchContent.
--- a/extern/libwebem/CMakeLists.txt
+++ b/extern/libwebem/CMakeLists.txt
@@ -171,9 +171,20 @@ elseif(TARGET jsoncpp_lib)
target_link_libraries(webem PUBLIC jsoncpp_lib)
else()
find_package(jsoncpp QUIET)
- if(jsoncpp_FOUND)
+ if(NOT TARGET jsoncpp_lib)
+ # No usable cmake config for jsoncpp (when cross-compiling, a host
+ # config must not count); pkg-config gets cross-compilation right.
+ find_package(PkgConfig QUIET)
+ if(PKG_CONFIG_FOUND)
+ pkg_check_modules(JSONCPP IMPORTED_TARGET jsoncpp)
+ endif()
+ endif()
+ if(TARGET jsoncpp_lib)
message(STATUS "webem: using system jsoncpp")
target_link_libraries(webem PUBLIC jsoncpp_lib)
+ elseif(TARGET PkgConfig::JSONCPP)
+ message(STATUS "webem: using pkg-config jsoncpp")
+ target_link_libraries(webem PUBLIC PkgConfig::JSONCPP)
else()
message(STATUS "webem: fetching jsoncpp 1.9.6 via FetchContent")
set(JSONCPP_WITH_TESTS OFF CACHE BOOL "" FORCE)
@@ -0,0 +1,36 @@
From 39dbe8121339917ab4c2f856aec714f0507af2a5 Mon Sep 17 00:00:00 2001
From: David Woodhouse <dwmw2@infradead.org>
Date: Mon, 1 Dec 2025 10:14:54 +0000
Subject: [PATCH 2/7] MQTT-AD: Drop duplicate messages
ESPHome sends duplicate messages to MQTT every time it polls the hardware
sensor, even if the value hasn't changed. Drop them in MQTT-AD if the
previous one is less than ten minutes old, rather than wasting a lot of
time processing the 'updates'.
---
hardware/MQTTAutoDiscover.cpp | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
--- a/hardware/MQTTAutoDiscover.cpp
+++ b/hardware/MQTTAutoDiscover.cpp
@@ -2090,8 +2090,20 @@ void MQTTAutoDiscover::handle_auto_disco
{
szValue = qMessage;
}
+ // ESPHome repeatedly sends MQTT updates each time it polls the sensor,
+ // even when the value doesn't change. Discard duplicates if the last
+ // value is the same, and less than ten minutes old.
+ auto now = mytime(nullptr);
+ if (pSensor->last_topic == topic && pSensor->last_value == szValue &&
+ pSensor->last_received > (now - 600))
+ {
+#ifdef _DEBUG
+ Log(LOG_NORM, "Dropping duplicate MQTT message to %s (%ld seconds old)", topic.c_str(), now - pSensor->last_received);
+#endif
+ return;
+ }
pSensor->last_value = szValue;
- pSensor->last_received = mytime(nullptr);
+ pSensor->last_received = now;
pSensor->last_topic = topic;
pSensor->bIsJSON = bIsJSON;
if (bIsJSON)