package/lua: allow host-lua to find installed modules
authorFrancois Perrad <fperrad@gmail.com>
Sun, 22 Mar 2020 08:07:06 +0000 (09:07 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sun, 12 Apr 2020 12:48:18 +0000 (14:48 +0200)
We need to set LUA_ROOT to allow the host-lua interpreter to find
installed modules.

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/lua/lua.mk

index 2ff2fdf754eeac2dd2f4357ff18d9d760f9c6526..ce75af6b023cd6c32567b3cb151051c276c6f205 100644 (file)
@@ -54,6 +54,11 @@ endef
 LUA_POST_PATCH_HOOKS += LUA_32BITS_LUACONF
 endif
 
+define HOST_LUA_LUACONF
+       $(SED) 's|#define LUA_ROOT.*|#define LUA_ROOT "$(HOST_DIR)/usr/"|' $(@D)/src/luaconf.h
+endef
+HOST_LUA_POST_PATCH_HOOKS += HOST_LUA_LUACONF
+
 HOST_LUA_CFLAGS = -Wall -fPIC -DLUA_USE_DLOPEN -DLUA_USE_POSIX
 ifeq ($(BR2_PACKAGE_LUA_5_3),y)
 HOST_LUA_CFLAGS += -DLUA_COMPAT_5_2