[LEDE-DEV] [PATCH] luarocks: allow building for the host

Hans Dedecker dedeckeh at gmail.com
Fri Nov 10 00:49:50 PST 2017


On Fri, Nov 10, 2017 at 1:12 AM, Enrico Mioso <mrkiko.rs at gmail.com> wrote:
> Allow building luarocks for the host-side, thus making luarocks-based LUA
> modules packging easier. Given the extensive use of LUA in LEDE/OpenWRT,
> I think it's worth having the luarocks tool available.
Hi,

Package luarocks belongs to feeds packages which is an independent
project and not part of LEDE base system; it is maintained at
https://github.com/openwrt/packages.

Would you please open a PR at  https://github.com/openwrt/packages to
make sure that the appropriate people can review the PR ?

Hans
>
> Signed-off-by: Enrico Mioso <mrkiko.rs at gmail.com>
> ---
>  lang/luarocks/Makefile | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
>
> diff --git a/lang/luarocks/Makefile b/lang/luarocks/Makefile
> index a0943fc3..c37a3bae 100644
> --- a/lang/luarocks/Makefile
> +++ b/lang/luarocks/Makefile
> @@ -21,8 +21,11 @@ PKG_SOURCE_VERSION:=v$(PKG_VERSION)
>  PKG_MAINTAINER:=Amr Hassan <amr.hassan at 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))
> --
> 2.15.0
>
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev



More information about the Lede-dev mailing list