domoticz: fix build and add test.sh
authorAlexandru Ardelean <redacted>
Tue, 28 Apr 2026 05:39:57 +0000 (08:39 +0300)
committerAlexandru Ardelean <redacted>
Sun, 3 May 2026 17:59:28 +0000 (20:59 +0300)
boost::asio::post() without an explicit executor fails to compile with
Boost >= 1.82 due to changes in the executor model: bare lambdas no
longer have an implicit system executor that satisfies the
blocking.never requirement.

Pass io_context_ explicitly as the first argument so the handler is
dispatched on the correct io_context thread, which is the original
intent of the call (making stop() safe to call from any thread).

Add test.sh
domoticz is a daemon requiring a database and network port; it does not
implement a --version flag. Verify the binary is present and executable.

Disable LTO to fix link failure on i386 with musl fortify
Suggested via https://github.com/openwrt/packages/pull/29239
Also tested.

Signed-off-by: Alexandru Ardelean <redacted>
utils/domoticz/Makefile
utils/domoticz/patches/002-fix-boost-asio-post-executor.patch [new file with mode: 0644]
utils/domoticz/test.sh [new file with mode: 0644]

index 6b08373dcc05b68f3fd4de378a103b8abfa98756..0ff146881116a1147baef94fec3fd455ab3824ea 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=domoticz
 PKG_VERSION:=2025.2
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/domoticz/domoticz/tar.gz/$(PKG_VERSION)?
@@ -21,7 +21,7 @@ PKG_LICENSE_FILES:=License.txt
 PKG_CPE_ID:=cpe:/a:domoticz:domoticz
 
 PKG_BUILD_DEPENDS:=python3 minizip cereal boost jwt-cpp
-PKG_BUILD_FLAGS:=no-mips16 lto
+PKG_BUILD_FLAGS:=no-mips16
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/cmake.mk
diff --git a/utils/domoticz/patches/002-fix-boost-asio-post-executor.patch b/utils/domoticz/patches/002-fix-boost-asio-post-executor.patch
new file mode 100644 (file)
index 0000000..f67c262
--- /dev/null
@@ -0,0 +1,11 @@
+--- 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()
diff --git a/utils/domoticz/test.sh b/utils/domoticz/test.sh
new file mode 100644 (file)
index 0000000..cdfc887
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+case "$1" in
+       domoticz)
+               [ -x /usr/bin/domoticz ] || exit 1
+               ;;
+esac
git clone https://git.99rst.org/PROJECT