Hi,

This is an update for luaposix to v31. It provides more interfaces to
POSIX functions for Lua. There is also a new requirement, luabitop.

Tested on Raspberry Pi in LXC container running OpenWRT.

Signed-off-by: Maxim Storchak <m.storc...@gmail.com>

-- 
Best regards,
Maxim Storchak
mailto:m.storc...@gmail.com

diff --git a/lang/luaposix/Makefile b/lang/luaposix/Makefile
index 46cb211..f821655 100644
--- a/lang/luaposix/Makefile
+++ b/lang/luaposix/Makefile
@@ -8,13 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=luaposix
-PKG_VERSION:=5.1.11
+PKG_VERSION:=v31
 PKG_RELEASE:=1
+_BASENAME:=release
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://luaforge.net/frs/download.php/4813
-PKG_MD5SUM:=edb76911dbdabe98dec49e3d8a126227
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
+PKG_SOURCE:=$(_BASENAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/luaposix/luaposix/archive/
+PKG_MD5SUM:=a25ff76d54bbbebf7a1f3b20c9806ee3
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(_BASENAME)-$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -23,8 +24,8 @@ define Package/luaposix
   SECTION:=lang
   CATEGORY:=Languages
   TITLE:=luaposix
-  URL:=http://luaposix.luaforge.net/
-  DEPENDS:=+lua +librt
+  URL:=http://luaforge.net/projects/luaposix/
+  DEPENDS:=+lua +librt +luabitop
 endef
 
 define Package/luaposix/description
@@ -33,6 +34,8 @@ define Package/luaposix/description
 endef
 
 define Build/Configure
+       cd $(PKG_BUILD_DIR) && ./bootstrap
+       $(call Build/Configure/Default)
 endef
 
 TARGET_CFLAGS += -DLUA_USE_LINUX $(FPIC) -std=gnu99
@@ -46,7 +49,8 @@ endif
 
 define Package/luaposix/install
        $(INSTALL_DIR) $(1)/usr/lib/lua
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/posix.so $(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
index 96a6fce..10aad20 100644
--- a/lang/luaposix/patches/100-eglibc-compat.patch
+++ b/lang/luaposix/patches/100-eglibc-compat.patch
@@ -1,26 +1,28 @@
---- a/lposix.c
-+++ b/lposix.c
-@@ -960,11 +960,13 @@ static int Pctermid(lua_State *L)                /** c
+--- luaposix-release-v31/ext/posix/posix.c.orig        2014-03-10 
14:22:45.000000000 +0200
++++ luaposix-release-v31/ext/posix/posix.c     2014-03-10 14:25:04.000000000 
+0200
+@@ -1970,6 +1970,7 @@
+       return 1;
  }
  
- 
 +#ifndef NO_GETLOGIN
- static int Pgetlogin(lua_State *L)            /** getlogin() */
- {
+ /***
+ Current logged-in user.
+ @see getlogin(3)
+@@ -1980,6 +1981,7 @@
        lua_pushstring(L, getlogin());
        return 1;
  }
 +#endif
  
- 
  static void Fgetpasswd(lua_State *L, int i, const void *data)
-@@ -1778,7 +1780,9 @@ static const luaL_reg R[] =
+ {
+@@ -3786,7 +3788,9 @@
  #if _POSIX_VERSION >= 200112L
-       {"getgroups",           Pgetgroups},
+       MENTRY( Pgetgroups      ),
  #endif
 +#ifndef NO_GETLOGIN
-       {"getlogin",            Pgetlogin},
+       MENTRY( Pgetlogin       ),
 +#endif
-       {"getopt_long",         Pgetopt_long},
-       {"getpasswd",           Pgetpasswd},
-       {"getpid",              Pgetpid},
+       MENTRY( Pgetopt         ),
+       MENTRY( Pgetpasswd      ),
+       MENTRY( Pgetpid         ),
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to