luci-base: fix luasrcdiet
authorJo-Philipp Wich <jo@mein.io>
Sat, 28 Jul 2018 09:41:07 +0000 (11:41 +0200)
committerJo-Philipp Wich <jo@mein.io>
Sat, 28 Jul 2018 15:14:22 +0000 (17:14 +0200)
 - Stage required libraries as well
 - Remove not existing make target
 - Override library search path

Fixes: b5d5e5bf1 ("luci-base: update luasrcdiet")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 63fbf5a805085f7ad99aebaaa116e3096fcf792d)

luci.mk
modules/luci-base/Makefile

diff --git a/luci.mk b/luci.mk
index 6ece81c3d60b1f06d847e1219b6c63fe92584ab3..f9153819ee9c914b6cf65309027e2ed673727305 100644 (file)
--- a/luci.mk
+++ b/luci.mk
@@ -153,7 +153,7 @@ LUCI_LIBRARYDIR = $(LUA_LIBRARYDIR)/luci
 
 define SrcDiet
        $(FIND) $(1) -type f -name '*.lua' | while read src; do \
-               if luasrcdiet --noopt-binequiv -o "$$$$src.o" "$$$$src"; \
+               if LUA_PATH="$(STAGING_DIR_HOSTPKG)/lib/lua/5.1/?.lua" luasrcdiet --noopt-binequiv -o "$$$$src.o" "$$$$src"; \
                then mv "$$$$src.o" "$$$$src"; fi; \
        done
 endef
index 5c38d99c589621dbaa00aad78afcd6c814d54afc..437cdc665216930436a8bd3d268c119508c84fbd 100644 (file)
@@ -37,13 +37,13 @@ endef
 
 define Host/Compile
        $(MAKE) -C src/ clean po2lmo
-       $(MAKE) -C $(HOST_BUILD_DIR) bin/luasrcdiet
 endef
 
 define Host/Install
        $(INSTALL_DIR) $(1)/bin
        $(INSTALL_BIN) src/po2lmo $(1)/bin/po2lmo
        $(INSTALL_BIN) $(HOST_BUILD_DIR)/bin/luasrcdiet $(1)/bin/luasrcdiet
+       $(CP) $(HOST_BUILD_DIR)/luasrcdiet $(1)/lib/lua/5.1/
 endef
 
 $(eval $(call HostBuild))