2014-01-11 16:42:06 +01:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# luarocks
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
2018-03-13 18:29:35 +01:00
|
|
|
LUAROCKS_VERSION = 2.4.4
|
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
|
|
|
|
2017-07-05 13:14:24 +02:00
|
|
|
LUAROCKS_CONFIG_DIR = $(HOST_DIR)/etc/luarocks
|
2014-01-17 18:47:36 +01:00
|
|
|
LUAROCKS_CONFIG_FILE = $(LUAROCKS_CONFIG_DIR)/config-$(LUAINTERPRETER_ABIVER).lua
|
2015-01-16 22:09:50 +01:00
|
|
|
LUAROCKS_CFLAGS = $(TARGET_CFLAGS) -fPIC
|
|
|
|
ifeq ($(BR2_PACKAGE_LUA_5_3),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
LUAROCKS_CFLAGS += -DLUA_COMPAT_5_2
|
2015-01-16 22:09:50 +01:00
|
|
|
endif
|
2014-01-11 16:42:06 +01:00
|
|
|
|
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
|
|
|
|
rm -f $(LUAROCKS_CONFIG_FILE)
|
|
|
|
$(MAKE1) -C $(@D) install \
|
2017-07-05 13:14:18 +02:00
|
|
|
PREFIX=$(HOST_DIR)
|
2014-01-11 16:42:06 +01:00
|
|
|
echo "-- BR cross-compilation" >> $(LUAROCKS_CONFIG_FILE)
|
|
|
|
echo "variables = {" >> $(LUAROCKS_CONFIG_FILE)
|
|
|
|
echo " LUA_INCDIR = [[$(STAGING_DIR)/usr/include]]," >> $(LUAROCKS_CONFIG_FILE)
|
|
|
|
echo " LUA_LIBDIR = [[$(STAGING_DIR)/usr/lib]]," >> $(LUAROCKS_CONFIG_FILE)
|
|
|
|
echo " CC = [[$(TARGET_CC)]]," >> $(LUAROCKS_CONFIG_FILE)
|
|
|
|
echo " LD = [[$(TARGET_CC)]]," >> $(LUAROCKS_CONFIG_FILE)
|
2015-01-16 22:09:50 +01:00
|
|
|
echo " CFLAGS = [[$(LUAROCKS_CFLAGS)]]," >> $(LUAROCKS_CONFIG_FILE)
|
2014-01-11 16:42:06 +01:00
|
|
|
echo " LIBFLAG = [[-shared $(TARGET_LDFLAGS)]]," >> $(LUAROCKS_CONFIG_FILE)
|
|
|
|
echo "}" >> $(LUAROCKS_CONFIG_FILE)
|
|
|
|
echo "external_deps_dirs = { [[$(STAGING_DIR)/usr]] }" >> $(LUAROCKS_CONFIG_FILE)
|
|
|
|
echo "gcc_rpath = false" >> $(LUAROCKS_CONFIG_FILE)
|
|
|
|
echo "rocks_trees = { [[$(TARGET_DIR)/usr]] }" >> $(LUAROCKS_CONFIG_FILE)
|
2014-02-26 11:03:17 +01:00
|
|
|
echo "wrap_bin_scripts = false" >> $(LUAROCKS_CONFIG_FILE)
|
2014-07-25 20:21:25 +02:00
|
|
|
echo "deps_mode = [[none]]" >> $(LUAROCKS_CONFIG_FILE)
|
2014-01-11 16:42:06 +01:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(host-generic-package))
|
2014-01-11 16:42:07 +01:00
|
|
|
|
2017-07-05 13:14:23 +02:00
|
|
|
LUAROCKS_RUN_ENV = LUA_PATH="$(HOST_DIR)/share/lua/$(LUAINTERPRETER_ABIVER)/?.lua"
|
2017-07-05 13:14:19 +02:00
|
|
|
LUAROCKS_RUN_CMD = $(LUA_RUN) $(HOST_DIR)/bin/luarocks
|
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
|