luci.mk: automatically depend on luci-lua-runtime
authorJo-Philipp Wich <jo@mein.io>
Wed, 14 Sep 2022 12:17:03 +0000 (14:17 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 24 Oct 2022 23:03:37 +0000 (01:03 +0200)
Make packages having a non-empty luasrc/ directory automatically depend
on the LuCI Lua runtime package.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
luci.mk
modules/luci-lua-runtime/Makefile

diff --git a/luci.mk b/luci.mk
index fc920f8d3aacfdea3e158b852cf14a85e83ed1af..f8d6e100bd768d429712e24c05ff68e3491679bd 100644 (file)
--- a/luci.mk
+++ b/luci.mk
@@ -138,6 +138,12 @@ include $(INCLUDE_DIR)/package.mk
 LUCI_SUBMENU_DEFAULT=$(if $(LUCI_MENU.$(LUCI_TYPE)),$(LUCI_MENU.$(LUCI_TYPE)),$(LUCI_MENU.app))
 LUCI_SUBMENU=$(if $(LUCI_SUBMENU_FORCED),$(LUCI_SUBMENU_FORCED),$(LUCI_SUBMENU_DEFAULT))
 
+ifneq ($(wildcard ${CURDIR}/luasrc/*),)
+ ifneq ($(filter-out luci-lib-base luci-lua-runtime,$(PKG_NAME)),)
+  LUCI_DEPENDS += +luci-lua-runtime
+ endif
+endif
+
 define Package/$(PKG_NAME)
   SECTION:=$(LUCI_SECTION)
   CATEGORY:=$(LUCI_CATEGORY)
index 2c6f38f08f21d72d17ae3c8ef44fc58ffc8826a2..f25e513eb18dc1210c216e280a22b20a507c787b 100644 (file)
@@ -15,6 +15,7 @@ LUCI_TITLE:=LuCI Lua runtime libraries
 LUCI_DEPENDS:= \
        +luci-base \
        +lua \
+       +luci-lib-base \
        +luci-lib-nixio \
        +luci-lib-ip \
        +luci-lib-jsonc \