svn commit: r339374 - in head/devel/lua-bitlib: . files

Baptiste Daroussin bapt at FreeBSD.org
Fri Jan 10 17:20:24 UTC 2014


Author: bapt
Date: Fri Jan 10 17:20:23 2014
New Revision: 339374
URL: http://svnweb.freebsd.org/changeset/ports/339374

Log:
  Port to lua 5.2
  While here support stage

Added:
  head/devel/lua-bitlib/files/
  head/devel/lua-bitlib/files/patch-lbitlib.c   (contents, props changed)
Modified:
  head/devel/lua-bitlib/Makefile

Modified: head/devel/lua-bitlib/Makefile
==============================================================================
--- head/devel/lua-bitlib/Makefile	Fri Jan 10 17:17:37 2014	(r339373)
+++ head/devel/lua-bitlib/Makefile	Fri Jan 10 17:20:23 2014	(r339374)
@@ -8,19 +8,19 @@ MASTER_SITES=	http://luaforge.net/frs/do
 PKGNAMEPREFIX=	${LUA_PKGNAMEPREFIX}
 
 MAINTAINER=	rafan at FreeBSD.org
-COMMENT=	A tiny library for bitwise operations
+COMMENT=	Tiny library for bitwise operations
 
-USE_LUA=	5.0+
+USES=		lua
 
 PLIST_FILES=	%%LUA_MODLIBDIR%%/bit.so
 
-NO_STAGE=	yes
 do-build:
 	cd ${WRKSRC} && \
 		${CC} -fPIC -shared -o bit.so lbitlib.c \
-		${LUA_LIBDIR}/liblua.a -I${LUA_INCDIR} -lm
+		-I${LUA_INCDIR} -lm
 
 do-install:
-	@${INSTALL_PROGRAM} ${WRKSRC}/bit.so ${LUA_MODLIBDIR}
+	@${MKDIR}  ${STAGEDIR}${LUA_MODLIBDIR}
+	${INSTALL_PROGRAM} ${WRKSRC}/bit.so ${STAGEDIR}${LUA_MODLIBDIR}
 
 .include <bsd.port.mk>

Added: head/devel/lua-bitlib/files/patch-lbitlib.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/lua-bitlib/files/patch-lbitlib.c	Fri Jan 10 17:20:23 2014	(r339374)
@@ -0,0 +1,22 @@
+--- ./lbitlib.c.orig	2007-11-16 14:14:40.000000000 +0100
++++ ./lbitlib.c	2014-01-10 18:19:01.197863901 +0100
+@@ -42,7 +42,7 @@
+ TDYADIC(rshift,  >>, UInteger, UInteger)
+ TDYADIC(arshift, >>, Integer, UInteger)
+ 
+-static const struct luaL_reg bitlib[] = {
++static const struct luaL_Reg bitlib[] = {
+   {"cast",    bit_cast},
+   {"bnot",    bit_bnot},
+   {"band",    bit_band},
+@@ -55,6 +55,9 @@
+ };
+ 
+ LUALIB_API int luaopen_bit (lua_State *L) {
+-  luaL_openlib(L, "bit", bitlib, 0);
++  lua_newtable(L);
++  luaL_setfuncs(L, bitlib, 0);
++  lua_pushvalue(L,-1);
++  lua_setglobal(L,"bit");
+   return 1;
+ }


More information about the svn-ports-all mailing list