From b17a792d7df93b2e3aedfd5285838006bfeebf0e Mon Sep 17 00:00:00 2001 From: Maxim Storchak Date: Wed, 11 Jun 2014 08:52:53 +0300 Subject: [PATCH 1/2] luabitop: import from packages Lua BitOp is a C extension module for Lua 5.1/5.2 which adds bitwise operations on numbers. Signed-off-by: Maxim Storchak --- lang/luabitop/Makefile | 51 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 lang/luabitop/Makefile diff --git a/lang/luabitop/Makefile b/lang/luabitop/Makefile new file mode 100644 index 000000000..33727f5e4 --- /dev/null +++ b/lang/luabitop/Makefile @@ -0,0 +1,51 @@ +# +# Copyright (C) 2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=luabitop +PKG_VERSION:=1.0.2 +PKG_RELEASE:=1 + +_BASENAME:=LuaBitOp + +PKG_SOURCE:=$(_BASENAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://bitop.luajit.org/download/ +PKG_MD5SUM:=d0c1080fe0c844e8477279668e2d0d06 +PKG_BUILD_DIR:=$(BUILD_DIR)/$(_BASENAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/luabitop + SUBMENU:=Lua + SECTION:=lang + CATEGORY:=Languages + TITLE:=luabitop + URL:=http://bitop.luajit.org/ + DEPENDS:=+lua +endef + +define Package/luabitop/description +Lua BitOp is a C extension module for Lua 5.1/5.2 which adds bitwise operations on numbers. +endef + +define Build/Configure +endef + + +TARGET_CFLAGS += $(FPIC) -DLUA_USE_LINUX -DLUA_NUMBER_DOUBLE + +define Build/Compile + $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_CPPFLAGS) -std=gnu99 $(FPIC) -DLUA_USE_LINUX -shared -o $(PKG_BUILD_DIR)/bit.so $(PKG_BUILD_DIR)/bit.c +endef + +define Package/luabitop/install + $(INSTALL_DIR) $(1)/usr/lib/lua + $(INSTALL_BIN) $(PKG_BUILD_DIR)/bit.so $(1)/usr/lib/lua +endef + +$(eval $(call BuildPackage,luabitop)) From 988eab561dea6eddfaf4d200aba610a10ebf4cc6 Mon Sep 17 00:00:00 2001 From: Maxim Storchak Date: Wed, 11 Jun 2014 08:55:54 +0300 Subject: [PATCH 2/2] luaposix: import from packages Signed-off-by: Maxim Storchak --- lang/luaposix/Makefile | 53 +++++++++++++++++++ lang/luaposix/patches/100-eglibc-compat.patch | 28 ++++++++++ 2 files changed, 81 insertions(+) create mode 100644 lang/luaposix/Makefile create mode 100644 lang/luaposix/patches/100-eglibc-compat.patch diff --git a/lang/luaposix/Makefile b/lang/luaposix/Makefile new file mode 100644 index 000000000..e82e31d42 --- /dev/null +++ b/lang/luaposix/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2011 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=luaposix +PKG_VERSION:=v31 +PKG_RELEASE:=1 + +PKG_SOURCE:=release-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://github.com/luaposix/luaposix/archive/ +PKG_MD5SUM:=a25ff76d54bbbebf7a1f3b20c9806ee3 +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-release-$(PKG_VERSION) +PKG_REMOVE_FILES:=aclocal.m4 +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/luaposix + SUBMENU:=Lua + SECTION:=lang + CATEGORY:=Languages + TITLE:=luaposix + URL:=http://luaforge.net/projects/luaposix/ + DEPENDS:=+lua +librt +luabitop + PKG_BUILD_DEPENDS:=+lua/host +endef + +define Package/luaposix/description + luaposix is a general POSIX library for Lua providing access + to various low level libc functions. +endef + +TARGET_CFLAGS += -DLUA_USE_LINUX $(FPIC) -std=gnu99 + +ifneq ($(CONFIG_USE_EGLIBC),) + ifeq ($(CONFIG_EGLIBC_OPTION_EGLIBC_UTMP),) + TARGET_CFLAGS += -DNO_GETLOGIN + endif +endif + + +define Package/luaposix/install + $(INSTALL_DIR) $(1)/usr/lib/lua + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ext/posix/.libs/posix_c.so $(1)/usr/lib/lua + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/posix.lua $(1)/usr/lib/lua +endef + +$(eval $(call BuildPackage,luaposix)) diff --git a/lang/luaposix/patches/100-eglibc-compat.patch b/lang/luaposix/patches/100-eglibc-compat.patch new file mode 100644 index 000000000..0cdff83d2 --- /dev/null +++ b/lang/luaposix/patches/100-eglibc-compat.patch @@ -0,0 +1,28 @@ +--- a/ext/posix/posix.c ++++ b/ext/posix/posix.c +@@ -1970,6 +1970,7 @@ static int Pctermid(lua_State *L) + return 1; + } + ++#ifndef NO_GETLOGIN + /*** + Current logged-in user. + @see getlogin(3) +@@ -1980,6 +1981,7 @@ static int Pgetlogin(lua_State *L) + lua_pushstring(L, getlogin()); + return 1; + } ++#endif + + static void Fgetpasswd(lua_State *L, int i, const void *data) + { +@@ -3786,7 +3788,9 @@ static const luaL_Reg R[] = + #if _POSIX_VERSION >= 200112L + MENTRY( Pgetgroups ), + #endif ++#ifndef NO_GETLOGIN + MENTRY( Pgetlogin ), ++#endif + MENTRY( Pgetopt ), + MENTRY( Pgetpasswd ), + MENTRY( Pgetpid ),