Browse Source

luarocks: allow building for the host

Allow building luarocks for the host-side, thus making luarocks-based LUA
modules packging easier.

Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
lilik-openwrt-22.03
Enrico Mioso 7 years ago
parent
commit
181460a7f1
1 changed files with 18 additions and 0 deletions
  1. +18
    -0
      lang/luarocks/Makefile

+ 18
- 0
lang/luarocks/Makefile View File

@ -21,8 +21,11 @@ PKG_SOURCE_VERSION:=v$(PKG_VERSION)
PKG_MAINTAINER:=Amr Hassan <amr.hassan@gmail.com>
PKG_INSTALL=1
PKG_BUILD_DEPENDS:=lua/host luac/host
HOST_BUILD_DEPENDS:=$(PKG_BUILD_DEPENDS)
PKG_LICENSE=GPL
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
define Package/luarocks
@ -44,6 +47,11 @@ CONFIGURE_ARGS = \
--sysconfdir=/etc \
--with-lua=$(STAGING_DIR_HOSTPKG)
HOST_CONFIGURE_ARGS= \
--prefix=$(STAGING_DIR_HOSTPKG) \
--sysconfdir=$(STAGING_DIR_HOSTPKG)/etc \
--with-lua=$(STAGING_DIR_HOSTPKG)
CONFIGURE_VARS = \
LUAROCKS_UNAME_S="Linux" \
LUAROCKS_UNAME_M="$(ARCH)"
@ -52,6 +60,10 @@ define Build/Compile
$(call Build/Compile/Default,build)
endef
define Host/Compile
$(call Host/Compile/Default,build)
endef
define Package/luarocks/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luarocks-5.1 $(1)/usr/bin/luarocks
@ -60,4 +72,10 @@ define Package/luarocks/install
$(CP) $(PKG_INSTALL_DIR)/etc $(1)/etc
endef
define Host/Install
$(MAKE) -C $(HOST_BUILD_DIR) install
endef
$(eval $(call BuildPackage,luarocks))
$(eval $(call HostBuild))

Loading…
Cancel
Save