luarocks: refactor with TARGET_FINALIZE_HOOKS
authorFrancois Perrad <fperrad@gmail.com>
Tue, 29 Jul 2014 18:18:15 +0000 (20:18 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 29 Jul 2014 18:22:58 +0000 (20:22 +0200)
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Makefile
package/luarocks/luarocks.mk

index ee6649435ddf90282413176bb5836235f4bfded3..022beeaf3d239233c461b5fb48db9b66291f8ac4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -576,7 +576,6 @@ endif
 ifeq ($(BR2_PACKAGE_PYTHON_PYC_ONLY)$(BR2_PACKAGE_PYTHON3_PYC_ONLY),y)
        find $(TARGET_DIR)/usr/lib/ -name '*.py' -print0 | xargs -0 rm -f
 endif
-       rm -rf $(TARGET_DIR)/usr/lib/luarocks
        $(STRIP_FIND_CMD) | xargs $(STRIPCMD) 2>/dev/null || true
        if test -d $(TARGET_DIR)/lib/modules; then \
                find $(TARGET_DIR)/lib/modules -type f -name '*.ko' | \
index 80b9e9fb68eecd3e424b7a91adfb8148ede3f5af..f4c06d6de3b225d1f13d0f4423e1eb1f9738732b 100644 (file)
@@ -51,3 +51,10 @@ $(eval $(host-generic-package))
 
 LUAROCKS_RUN = LUA_PATH="$(HOST_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/?.lua" \
        $(LUA_RUN) $(HOST_DIR)/usr/bin/luarocks
+
+define LUAROCKS_FINALIZE_TARGET
+       rm -rf $(TARGET_DIR)/usr/lib/luarocks
+endef
+
+TARGET_FINALIZE_HOOKS += LUAROCKS_FINALIZE_TARGET
+