0526292914
In preparation for the introduction of support for host Luarocks packages, this commit reworks the luarocks-package infrastructure: - A number of variables that were defined in package/luarocks/luarocks-br-config.lua are now passed on the luarocks command line in $(2)_INSTALL_TARGET_CMDS in pkg-luarocks.mk. - The LUAROCKS_CFLAGS logic is moved from package/luarocks/luarocks.mk to package/pkg-luarocks.mk. - The LUAROCKS_RUN_ENV variable is no longer needed, as all details are now passed on the luarocks command line in pkg-luarocks.mk. Signed-off-by: Francois Perrad <francois.perrad@gadz.org> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
48 lines
1.3 KiB
Makefile
48 lines
1.3 KiB
Makefile
################################################################################
|
|
#
|
|
# luarocks
|
|
#
|
|
################################################################################
|
|
|
|
LUAROCKS_VERSION = 3.3.1
|
|
LUAROCKS_SITE = http://luarocks.org/releases
|
|
LUAROCKS_LICENSE = MIT
|
|
LUAROCKS_LICENSE_FILES = COPYING
|
|
|
|
HOST_LUAROCKS_DEPENDENCIES = host-luainterpreter
|
|
|
|
LUAROCKS_CONFIG_DIR = $(HOST_DIR)/etc
|
|
LUAROCKS_CONFIG_FILE = $(LUAROCKS_CONFIG_DIR)/luarocks/config-$(LUAINTERPRETER_ABIVER).lua
|
|
|
|
define LUAROCKS_ADDON_EXTRACT
|
|
mkdir $(@D)/src/luarocks/cmd/external
|
|
cp package/luarocks/buildroot.lua $(@D)/src/luarocks/cmd/external/buildroot.lua
|
|
endef
|
|
HOST_LUAROCKS_POST_EXTRACT_HOOKS += LUAROCKS_ADDON_EXTRACT
|
|
|
|
HOST_LUAROCKS_CONF_OPTS = \
|
|
--prefix=$(HOST_DIR) \
|
|
--sysconfdir=$(LUAROCKS_CONFIG_DIR) \
|
|
--with-lua=$(HOST_DIR)
|
|
|
|
define HOST_LUAROCKS_CONFIGURE_CMDS
|
|
cd $(@D) && ./configure $(HOST_LUAROCKS_CONF_OPTS)
|
|
endef
|
|
|
|
define HOST_LUAROCKS_INSTALL_CMDS
|
|
rm -f $(LUAROCKS_CONFIG_FILE)
|
|
$(MAKE1) -C $(@D) install
|
|
cat $(HOST_LUAROCKS_PKGDIR)/luarocks-br-config.lua >> $(LUAROCKS_CONFIG_FILE)
|
|
endef
|
|
|
|
$(eval $(host-generic-package))
|
|
|
|
define LUAROCKS_FINALIZE_TARGET
|
|
rm -rf $(TARGET_DIR)/usr/lib/luarocks
|
|
endef
|
|
|
|
# Apply to global variable directly, as pkg-generic does not
|
|
ifneq ($(BR2_PACKAGE_LUAJIT)$(BR2_PACKAGE_LUA),)
|
|
TARGET_FINALIZE_HOOKS += LUAROCKS_FINALIZE_TARGET
|
|
endif
|