Browse Source

luaposix: import from packages

Signed-off-by: Maxim Storchak <m.storchak@gmail.com>
Maxim Storchak 10 years ago
parent
commit
988eab561d
2 changed files with 81 additions and 0 deletions
  1. 53
    0
      lang/luaposix/Makefile
  2. 28
    0
      lang/luaposix/patches/100-eglibc-compat.patch

+ 53
- 0
lang/luaposix/Makefile View File

@@ -0,0 +1,53 @@
1
+#
2
+# Copyright (C) 2011 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=luaposix
11
+PKG_VERSION:=v31
12
+PKG_RELEASE:=1
13
+
14
+PKG_SOURCE:=release-$(PKG_VERSION).tar.gz
15
+PKG_SOURCE_URL:=https://github.com/luaposix/luaposix/archive/
16
+PKG_MD5SUM:=a25ff76d54bbbebf7a1f3b20c9806ee3
17
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-release-$(PKG_VERSION)
18
+PKG_REMOVE_FILES:=aclocal.m4
19
+PKG_FIXUP:=autoreconf
20
+
21
+include $(INCLUDE_DIR)/package.mk
22
+
23
+define Package/luaposix
24
+  SUBMENU:=Lua
25
+  SECTION:=lang
26
+  CATEGORY:=Languages
27
+  TITLE:=luaposix
28
+  URL:=http://luaforge.net/projects/luaposix/
29
+  DEPENDS:=+lua +librt +luabitop
30
+  PKG_BUILD_DEPENDS:=+lua/host
31
+endef
32
+
33
+define Package/luaposix/description
34
+  luaposix is a general POSIX library for Lua providing access
35
+  to various low level libc functions.
36
+endef
37
+
38
+TARGET_CFLAGS += -DLUA_USE_LINUX $(FPIC) -std=gnu99
39
+
40
+ifneq ($(CONFIG_USE_EGLIBC),)
41
+  ifeq ($(CONFIG_EGLIBC_OPTION_EGLIBC_UTMP),)
42
+    TARGET_CFLAGS += -DNO_GETLOGIN
43
+  endif
44
+endif
45
+
46
+
47
+define Package/luaposix/install
48
+	$(INSTALL_DIR) $(1)/usr/lib/lua
49
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/ext/posix/.libs/posix_c.so $(1)/usr/lib/lua
50
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/posix.lua $(1)/usr/lib/lua
51
+endef
52
+
53
+$(eval $(call BuildPackage,luaposix))

+ 28
- 0
lang/luaposix/patches/100-eglibc-compat.patch View File

@@ -0,0 +1,28 @@
1
+--- a/ext/posix/posix.c
2
++++ b/ext/posix/posix.c
3
+@@ -1970,6 +1970,7 @@ static int Pctermid(lua_State *L)
4
+ 	return 1;
5
+ }
6
+ 
7
++#ifndef NO_GETLOGIN
8
+ /***
9
+ Current logged-in user.
10
+ @see getlogin(3)
11
+@@ -1980,6 +1981,7 @@ static int Pgetlogin(lua_State *L)
12
+ 	lua_pushstring(L, getlogin());
13
+ 	return 1;
14
+ }
15
++#endif
16
+ 
17
+ static void Fgetpasswd(lua_State *L, int i, const void *data)
18
+ {
19
+@@ -3786,7 +3788,9 @@ static const luaL_Reg R[] =
20
+ #if _POSIX_VERSION >= 200112L
21
+ 	MENTRY( Pgetgroups	),
22
+ #endif
23
++#ifndef NO_GETLOGIN
24
+ 	MENTRY( Pgetlogin	),
25
++#endif
26
+ 	MENTRY( Pgetopt		),
27
+ 	MENTRY( Pgetpasswd	),
28
+ 	MENTRY( Pgetpid		),