lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Try using pkgsrc. I pack luasocket, luaposix and luaexpat in pkgsrc-wip. This is the NetBSD package system, but it's portable to all systems. Also you can view the pkgsrc-wip CVS and get the patches and makefile.

Also there's a MESSAGE explaining how to load the library using LUA_INIT.

patch-aa:

$ cat patch-aa
$NetBSD$
--- makefile.orig       2003-08-16 00:14:15.000000000 +0000
+++ makefile    2004-01-24 21:20:06.000000000 +0000
@@ -1,11 +1,11 @@
 V=2.0

-INSTALL_LUA=/usr/local/lua
-INSTALL_LUASOCKET=$(INSTALL_LUA)/luasocket
+INSTALL_LUA=${PREFIX}/lib
+INSTALL_LUASOCKET=$(INSTALL_LUA)/

 LUAC=luac
 BIN2C=bin2c
-CC=gcc
+CC?=gcc
 OPT=-O2

 OBJS= \
@@ -78,9 +78,9 @@
        mkdir -p $(INSTALL_LUASOCKET)
        cp $(DYN) $(INSTALL_LUASOCKET)
        ln -f -s $(INSTALL_LUASOCKET)/$(DYN) $(INSTALL_LUASOCKET)/libluasocket.so
-       cp luasocket.lua $(INSTALL_LUASOCKET)
-       cp luasocket.h $(INSTALL_LUASOCKET)
-       cp lua.lua $(INSTALL_LUA)
+#      cp luasocket.lua $(INSTALL_LUASOCKET)
+#      cp luasocket.h $(INSTALL_LUASOCKET)
+#      cp lua.lua $(INSTALL_LUA)

 clean:
        rm -f $(OBJS)



--- And here the MESSAGE:

$/usr/pkgsrc/wip/luasocket> cat MESSAGE
===========================================================================
$NetBSD$

To use luasocket in your lua programs you must set this environ variable:

   LUA_INIT = "loadlib('${PREFIX}/lib/libluasocket.so','luaopen_socket')();"

The rest of luasocket is installed in:

   ${PREFIX}/lib/lua/

===========================================================================

And BSD-Makefile: 


# $NetBSD$
#

DISTNAME=		luasocket-2.0-alpha
PKGNAME=		luasocket-2.0alpha
CATEGORIES=		wip
MASTER_SITES=		http://www.tecgraf.puc-rio.br/~diego/luasocket/new/

MAINTAINER=		pancake@phreaker.net
HOMEPAGE=		http://www.tecgraf.puc-rio.br/~diego/luasocket/new/
COMMENT=		Gives socket capabilities to lua50

MAKEFILE=		${WRKSRC}/makefile
ALL_TARGET=		dyn
USE_GNU_TOOLS+=		make
USE_BUILDLINK2=		YES

post-install:
	${INSTALL_DATA_DIR} ${PREFIX}/lib/lua/
	${INSTALL_DATA} ${WRKSRC}/*.lua ${PREFIX}/lib/lua/

.include "../../lang/lua/buildlink2.mk"
.include "../../mk/bsd.pkg.mk"


bye :)

On Mon, Feb 02, 2004 at 12:24:49PM +0200, Hans van der Merwe wrote:
-- How do I make a standalone LuaSocket "enabled" Lua VM on Linux?
-- 
-- I have built LuaSocket 2.0 (alpha) and it works using the LuaSocket dyn libs
-- and preloading luasocket.lua, but I need a standalone ver like the Win32 bin
-- download provided on the dev site.