From 2795fecc50ca91d7303ae817cdfa260eabd0975e Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Sat, 15 Mar 2025 20:57:06 +0100 Subject: [PATCH] package/nftables: add an option to force JSON support Currently, nftables JSON support is implicit: if jansson is enabled, JSON support is enabled, otherwise it is not. Some packages will require that nftables be built with JSON support; that's the case of netavarks, for example (to come in a later patch). So, in the current state, it would mean a package would have to select jansson, although it does not itself use it, so that nftables has JSON support. This does not feel right. Instead, introduce an option to nftables, to explicitly enabled JSON support. Packages such as netavark would then just have to require JSON support in nftables. Signed-off-by: Yann E. MORIN Cc: Yegor Yefremov Signed-off-by: Julien Olivain --- package/nftables/Config.in | 7 ++++++- package/nftables/nftables.mk | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/package/nftables/Config.in b/package/nftables/Config.in index 833a3a38a2..514682ec48 100644 --- a/package/nftables/Config.in +++ b/package/nftables/Config.in @@ -13,9 +13,14 @@ config BR2_PACKAGE_NFTABLES http://www.netfilter.org/projects/nftables/index.html -# Legacy: this used to be handled in nftables.mk if BR2_PACKAGE_NFTABLES +# Legacy: this used to be handled in nftables.mk source "package/nftables/nftables-python/Config.in" + +config BR2_PACKAGE_NFTABLES_JSON + bool "json support" + select BR2_PACKAGE_JANSSON + endif comment "nftables needs a toolchain w/ wchar, headers >= 3.12" diff --git a/package/nftables/nftables.mk b/package/nftables/nftables.mk index 380e553cde..f6e6a64efd 100644 --- a/package/nftables/nftables.mk +++ b/package/nftables/nftables.mk @@ -42,7 +42,7 @@ else NFTABLES_CONF_OPTS += --without-cli endif -ifeq ($(BR2_PACKAGE_JANSSON),y) +ifeq ($(BR2_PACKAGE_NFTABLES_JSON),y) NFTABLES_DEPENDENCIES += jansson NFTABLES_CONF_OPTS += --with-json else