2014-01-11 16:42:06 +01:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# luarocks
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
2020-02-07 15:59:55 +01:00
|
|
|
LUAROCKS_VERSION = 3.3.1
|
2014-07-31 10:46:58 +02:00
|
|
|
LUAROCKS_SITE = http://luarocks.org/releases
|
2014-01-11 16:42:06 +01:00
|
|
|
LUAROCKS_LICENSE = MIT
|
|
|
|
LUAROCKS_LICENSE_FILES = COPYING
|
|
|
|
|
2014-07-19 16:38:57 +02:00
|
|
|
HOST_LUAROCKS_DEPENDENCIES = host-luainterpreter
|
2014-01-11 16:42:06 +01:00
|
|
|
|
2018-08-16 09:30:49 +02:00
|
|
|
LUAROCKS_CONFIG_DIR = $(HOST_DIR)/etc
|
2020-04-12 14:00:43 +02:00
|
|
|
LUAROCKS_CONFIG_FILE_DEFAULT = $(LUAROCKS_CONFIG_DIR)/luarocks/config-$(LUAINTERPRETER_ABIVER).lua
|
|
|
|
LUAROCKS_CONFIG_FILE = $(LUAROCKS_CONFIG_DIR)/luarocks/config.lua
|
2020-03-22 09:07:04 +01:00
|
|
|
HOST_LUAROCKS_CONFIG_FILE = $(LUAROCKS_CONFIG_DIR)/luarocks/host-config.lua
|
2014-01-11 16:42:06 +01:00
|
|
|
|
2019-01-20 08:19:45 +01:00
|
|
|
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
|
|
|
|
|
2014-09-27 21:32:44 +02:00
|
|
|
HOST_LUAROCKS_CONF_OPTS = \
|
2017-07-05 13:14:18 +02:00
|
|
|
--prefix=$(HOST_DIR) \
|
2014-07-19 16:38:57 +02:00
|
|
|
--sysconfdir=$(LUAROCKS_CONFIG_DIR) \
|
2017-07-05 13:14:24 +02:00
|
|
|
--with-lua=$(HOST_DIR)
|
2014-07-19 16:38:57 +02:00
|
|
|
|
2014-01-11 16:42:06 +01:00
|
|
|
define HOST_LUAROCKS_CONFIGURE_CMDS
|
2014-09-27 21:32:44 +02:00
|
|
|
cd $(@D) && ./configure $(HOST_LUAROCKS_CONF_OPTS)
|
2014-01-11 16:42:06 +01:00
|
|
|
endef
|
|
|
|
|
|
|
|
define HOST_LUAROCKS_INSTALL_CMDS
|
2020-04-12 14:00:43 +02:00
|
|
|
rm -f $(LUAROCKS_CONFIG_FILE_DEFAULT)
|
2018-07-21 08:49:30 +02:00
|
|
|
$(MAKE1) -C $(@D) install
|
2020-04-12 14:00:43 +02:00
|
|
|
cat $(LUAROCKS_CONFIG_FILE_DEFAULT) $(HOST_LUAROCKS_PKGDIR)/luarocks-br-config.lua \
|
2020-04-19 09:48:27 +02:00
|
|
|
> $(LUAROCKS_CONFIG_FILE)
|
2020-03-22 09:07:04 +01:00
|
|
|
cat $(LUAROCKS_CONFIG_FILE_DEFAULT) $(HOST_LUAROCKS_PKGDIR)/luarocks-br-host-config.lua \
|
|
|
|
> $(HOST_LUAROCKS_CONFIG_FILE)
|
2020-04-12 14:00:43 +02:00
|
|
|
rm -f $(LUAROCKS_CONFIG_FILE_DEFAULT)
|
2014-01-11 16:42:06 +01:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(host-generic-package))
|
2014-01-11 16:42:07 +01:00
|
|
|
|
2014-07-29 20:18:15 +02:00
|
|
|
define LUAROCKS_FINALIZE_TARGET
|
|
|
|
rm -rf $(TARGET_DIR)/usr/lib/luarocks
|
|
|
|
endef
|
|
|
|
|
2016-12-24 02:50:55 +01:00
|
|
|
# Apply to global variable directly, as pkg-generic does not
|
|
|
|
ifneq ($(BR2_PACKAGE_LUAJIT)$(BR2_PACKAGE_LUA),)
|
|
|
|
TARGET_FINALIZE_HOOKS += LUAROCKS_FINALIZE_TARGET
|
|
|
|
endif
|