From 181460a7f1fd3d04f4489e7380a2b0865af09baa Mon Sep 17 00:00:00 2001 From: Enrico Mioso Date: Mon, 6 Nov 2017 23:29:06 +0100 Subject: [PATCH 1/2] 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 --- lang/luarocks/Makefile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lang/luarocks/Makefile b/lang/luarocks/Makefile index a0943fc3f..c37a3baeb 100644 --- a/lang/luarocks/Makefile +++ b/lang/luarocks/Makefile @@ -21,8 +21,11 @@ PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_MAINTAINER:=Amr Hassan 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)) From 764fdfd49b755a27dd0aa9a41d5fc94f53cb0441 Mon Sep 17 00:00:00 2001 From: Enrico Mioso Date: Mon, 6 Nov 2017 23:30:00 +0100 Subject: [PATCH 2/2] ldbus: add new package This package contains "ldbus": LUA bindings to interact with the DBUS message bus, and services connected to it. See https://github.com/daurnimator/ldbus for more details. Signed-off-by: Enrico Mioso --- lang/ldbus/Makefile | 63 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 lang/ldbus/Makefile diff --git a/lang/ldbus/Makefile b/lang/ldbus/Makefile new file mode 100644 index 000000000..446274466 --- /dev/null +++ b/lang/ldbus/Makefile @@ -0,0 +1,63 @@ +# +# Copyright (C) 2006-2017 OpenWrt.org +# +# This is free software, licensed under the GPL 2 license. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ldbus +PKG_RELEASE:=1 +PKG_MIRROR_HASH:=0e39a80e126a77a937226e49ae0246e1fd4600a03dee6bdee5ac822963a234e1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_VERSION:=f4a1464e915a2313c80fb40c5c40b0bee7583677 +PKG_SOURCE_DATE:=2017-10-03 +PKG_SOURCE_URL=https://github.com/daurnimator/ldbus +PKG_MAINTAINER:=Enrico Mioso +PKG_LICENSE:=MIT + +PKG_FLAGS := nonshared + +PKG_BUILD_DEPENDS:=+luarocks/host +dbus +libdbus + +include $(INCLUDE_DIR)/package.mk + +define Package/ldbus + SUBMENU:=Lua + SECTION:=lang + CATEGORY:=Languages + TITLE:=ldbus Lua DBus bindings + DEPENDS:=+dbus +lua +endef + +define Package/ldbus/description + This package contains "ldbus": LUA bindings to interact with the DBUS + message bus system, and services connected to it. + See https://github.com/daurnimator/ldbus + for details. +endef + +TARGET_CFLAGS += \ + -I$(STAGING_DIR)/usr/include + +MAKE_FLAGS += \ + FPIC="$(FPIC)" \ + CFLAGS="$(TARGET_CFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" + +define Package/ldbus/install + $(INSTALL_DIR) $(1)/usr/lib/lua + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ldbus.so $(1)/usr/lib/lua +endef + +define Build/Compile + cd $(PKG_BUILD_DIR) && \ + luarocks make --pack-binary-rock ldbus-scm-0.rockspec \ + DBUS_INCDIR=$(STAGING_DIR)/usr/include/dbus-1.0/ \ + DBUS_ARCH_INCDIR=$(STAGING_DIR)/usr/lib/dbus-1.0/include \ + DBUS_LIBDIR=$(STAGING_DIR)/usr/lib \ + CC="$(TARGET_CC)" LD="$(TARGET_CC)" +endef + +$(eval $(call BuildPackage,ldbus))