2014-01-11 16:42:06 +01:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# luarocks
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
LUAROCKS_VERSION = 2.1.2
|
|
|
|
LUAROCKS_SITE = http://luarocks.org/releases/
|
|
|
|
LUAROCKS_LICENSE = MIT
|
|
|
|
LUAROCKS_LICENSE_FILES = COPYING
|
|
|
|
|
2014-03-01 23:30:55 +01:00
|
|
|
HOST_LUAROCKS_DEPENDENCIES = host-lua
|
2014-01-11 16:42:06 +01:00
|
|
|
|
|
|
|
LUAROCKS_CONFIG_DIR = $(HOST_DIR)/usr/etc/luarocks
|
2014-01-17 18:47:36 +01:00
|
|
|
LUAROCKS_CONFIG_FILE = $(LUAROCKS_CONFIG_DIR)/config-$(LUAINTERPRETER_ABIVER).lua
|
2014-01-11 16:42:06 +01:00
|
|
|
|
|
|
|
define HOST_LUAROCKS_CONFIGURE_CMDS
|
|
|
|
cd $(@D) && ./configure \
|
|
|
|
--prefix=$(HOST_DIR)/usr \
|
|
|
|
--sysconfdir=$(LUAROCKS_CONFIG_DIR) \
|
|
|
|
--with-lua=$(HOST_DIR)/usr
|
|
|
|
endef
|
|
|
|
|
|
|
|
define HOST_LUAROCKS_INSTALL_CMDS
|
|
|
|
rm -f $(LUAROCKS_CONFIG_FILE)
|
|
|
|
$(MAKE1) -C $(@D) install \
|
|
|
|
PREFIX=$(HOST_DIR)/usr
|
|
|
|
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)
|
2014-01-15 09:42:50 +01:00
|
|
|
echo " CFLAGS = [[$(TARGET_CFLAGS) -fPIC]]," >> $(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-01-11 16:42:06 +01:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(host-generic-package))
|
2014-01-11 16:42:07 +01:00
|
|
|
|
2014-01-17 18:47:36 +01:00
|
|
|
LUAROCKS_RUN = LUA_PATH="$(HOST_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/?.lua" \
|
2014-01-11 16:42:07 +01:00
|
|
|
$(HOST_DIR)/usr/bin/lua $(HOST_DIR)/usr/bin/luarocks
|