diff mbox series

[1/1] package/rauc: optionally enable JSON output in host package

Message ID 20250429150228.790857-1-fiona.klute@gmx.de
State New
Headers show
Series [1/1] package/rauc: optionally enable JSON output in host package | expand

Commit Message

Fiona Klute April 29, 2025, 3:02 p.m. UTC
From: "Fiona Klute (WIWA)" <fiona.klute@gmx.de>

JSON output is useful for building integrations, e.g. reading bundle
information into other tools.

Signed-off-by: Fiona Klute (WIWA) <fiona.klute@gmx.de>
---
I've added the config option to preserve the current default, making
JSON support opt-in. However host-rauc depends on host-libglib2
already, so host-json-glib is the only additional dependency. If
simplicity is preferred over avoiding a small dependency, I'm happy to
modify the patch so JSON support is enabled unconditionally.

 package/rauc/Config.in.host | 10 ++++++++++
 package/rauc/rauc.mk        |  8 +++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/package/rauc/Config.in.host b/package/rauc/Config.in.host
index 1bd9a7935a..401bb4449a 100644
--- a/package/rauc/Config.in.host
+++ b/package/rauc/Config.in.host
@@ -8,3 +8,13 @@  config BR2_PACKAGE_HOST_RAUC
 	  bundles that are handled by the target rauc service.
 
 	  http://rauc.io/
+
+if BR2_PACKAGE_HOST_RAUC
+
+config BR2_PACKAGE_HOST_RAUC_JSON
+	bool "JSON output support"
+	help
+	  This option enables support for providing output in
+	  JSON format.
+
+endif
diff --git a/package/rauc/rauc.mk b/package/rauc/rauc.mk
index 6bed5ec129..3e36c599b5 100644
--- a/package/rauc/rauc.mk
+++ b/package/rauc/rauc.mk
@@ -70,9 +70,15 @@  HOST_RAUC_DEPENDENCIES = \
 HOST_RAUC_CONF_OPTS += \
 	-Dnetwork=false \
 	-Dstreaming=false \
-	-Djson=disabled \
 	-Dservice=false \
 	-Dtests=false
 
+ifeq ($(BR2_PACKAGE_HOST_RAUC_JSON),y)
+HOST_RAUC_DEPENDENCIES += host-json-glib
+HOST_RAUC_CONF_OPTS += -Djson=enabled
+else
+HOST_RAUC_CONF_OPTS += -Djson=disabled
+endif
+
 $(eval $(meson-package))
 $(eval $(host-meson-package))