aboutsummaryrefslogtreecommitdiff
path: root/devel
diff options
context:
space:
mode:
authorPhilip Paeps <philip@FreeBSD.org>2006-11-02 00:38:06 +0000
committerPhilip Paeps <philip@FreeBSD.org>2006-11-02 00:38:06 +0000
commitadb4c0b0550a6f4e2cea0aee65d3ea9282e4c5a2 (patch)
tree6a146557f118f3288f0207b658e29566705b34e7 /devel
parent8824267a708f2c36abd992aa0d77034f88e30254 (diff)
downloadports-adb4c0b0550a6f4e2cea0aee65d3ea9282e4c5a2.tar.gz
ports-adb4c0b0550a6f4e2cea0aee65d3ea9282e4c5a2.zip
Notes
Diffstat (limited to 'devel')
-rw-r--r--devel/Makefile1
-rw-r--r--devel/lua-posix/Makefile10
-rw-r--r--devel/lua-posix/files/extrapatch-50-Makefile11
-rw-r--r--devel/lua-posix/files/extrapatch-51-lposix.c11
-rw-r--r--devel/lua-posix/files/extrapatch-51-posix.lua11
-rw-r--r--devel/lua-posix/files/extrapatch-51-test.lua25
-rw-r--r--devel/lua-posix/files/patch-Makefile9
-rw-r--r--devel/lua50-posix/Makefile20
-rw-r--r--devel/lua50-posix/distinfo3
-rw-r--r--devel/lua50-posix/files/patch-Makefile30
-rw-r--r--devel/lua50-posix/files/patch-posix.lua8
11 files changed, 70 insertions, 69 deletions
diff --git a/devel/Makefile b/devel/Makefile
index 3bca79f8ac69..1c6fe3fae397 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -632,6 +632,7 @@
SUBDIR += lua50-posix
SUBDIR += lua50-pty
SUBDIR += lua-gettext
+ SUBDIR += lua-posix
SUBDIR += lwp
SUBDIR += m17n-db
SUBDIR += m17n-docs
diff --git a/devel/lua-posix/Makefile b/devel/lua-posix/Makefile
index 37ec1872664c..02a45b1d6d89 100644
--- a/devel/lua-posix/Makefile
+++ b/devel/lua-posix/Makefile
@@ -15,12 +15,20 @@ DISTFILES= lposix.tar.gz
MAINTAINER= andrew+ports@fubar.geek.nz
COMMENT= A POSIX layer for Lua
-USE_LUA= 5.0
+USE_LUA?= 5.1
WRKSRC= ${WRKDIR}/posix
PLIST_FILES= %%LUA_MODSHAREDIR%%/posix.lua \
%%LUA_MODLIBDIR%%/lposix.so
+.if ${USE_LUA} == 5.1
+EXTRA_PATCHES= ${FILESDIR}/extrapatch-51-lposix.c \
+ ${FILESDIR}/extrapatch-51-posix.lua \
+ ${FILESDIR}/extrapatch-51-test.lua
+.elif ${USE_LUA} == 5.0
+EXTRA_PATCHES= ${FILESDIR}/extrapatch-50-Makefile
+.endif
+
do-install:
@${INSTALL_DATA} ${WRKSRC}/posix.lua ${LUA_MODSHAREDIR}
@${INSTALL_PROGRAM} ${WRKSRC}/lposix.so ${LUA_MODLIBDIR}
diff --git a/devel/lua-posix/files/extrapatch-50-Makefile b/devel/lua-posix/files/extrapatch-50-Makefile
new file mode 100644
index 000000000000..4092b3849f8a
--- /dev/null
+++ b/devel/lua-posix/files/extrapatch-50-Makefile
@@ -0,0 +1,11 @@
+--- Makefile.orig Wed Nov 5 21:26:49 2003
++++ Makefile Mon Aug 7 00:38:38 2006
+@@ -21,7 +21,7 @@
+ all: test
+
+ test: $T
+- $(LUABIN)/lua -l$(MYNAME) test.lua
++ LD_PRELOAD=${LUA_LIBDIR}/liblua.so:${LUA_LIBDIR}/liblualib.so $(LUABIN)/lua -l$(MYNAME) test.lua
+
+ $T: $(OBJS)
+ $(CC) -o $@ -shared $(OBJS)
diff --git a/devel/lua-posix/files/extrapatch-51-lposix.c b/devel/lua-posix/files/extrapatch-51-lposix.c
new file mode 100644
index 000000000000..48b5af5e4fb5
--- /dev/null
+++ b/devel/lua-posix/files/extrapatch-51-lposix.c
@@ -0,0 +1,11 @@
+--- lposix.c.orig Thu Nov 2 11:08:39 2006
++++ lposix.c Thu Nov 2 11:11:29 2006
+@@ -64,7 +64,7 @@
+ }
+ else
+ {
+- int j=luaL_findstring(luaL_checkstring(L, i), S);
++ int j=luaL_checkoption(L, i, NULL, S);
+ if (j==-1) luaL_argerror(L, i, "unknown selector");
+ return F(L, j, data);
+ }
diff --git a/devel/lua-posix/files/extrapatch-51-posix.lua b/devel/lua-posix/files/extrapatch-51-posix.lua
new file mode 100644
index 000000000000..fb5eea37a3fb
--- /dev/null
+++ b/devel/lua-posix/files/extrapatch-51-posix.lua
@@ -0,0 +1,11 @@
+--- posix.lua.orig Thu Nov 2 12:52:39 2006
++++ posix.lua Thu Nov 2 11:06:46 2006
+@@ -4,7 +4,7 @@
+
+ local function so(x)
+ local SOPATH= os.getenv"LUA_SOPATH" or "./"
+- assert(loadlib(SOPATH.."l"..x..".so","luaopen_"..x))()
++ assert(package.loadlib(SOPATH.."l"..x..".so","luaopen_"..x))()
+ end
+
+ so"posix"
diff --git a/devel/lua-posix/files/extrapatch-51-test.lua b/devel/lua-posix/files/extrapatch-51-test.lua
new file mode 100644
index 000000000000..a31c166aa9d1
--- /dev/null
+++ b/devel/lua-posix/files/extrapatch-51-test.lua
@@ -0,0 +1,25 @@
+--- test.lua.orig Thu Nov 2 11:13:00 2006
++++ test.lua Thu Nov 2 11:14:54 2006
+@@ -41,7 +41,7 @@
+ f"HOME"
+ f"SHELL"
+ f"absent"
+-for k in ox.getenv() do io.write(k,"\t") end io.write"\n"
++for k,_ in pairs(ox.getenv()) do io.write(k,"\t") end io.write"\n"
+
+ ------------------------------------------------------------------------------
+ testing"putenv"
+@@ -179,11 +179,11 @@
+ ------------------------------------------------------------------------------
+ testing"times"
+ a=ox.times()
+-for k,v in a do print(k,v) end
++for k,v in pairs(a) do print(k,v) end
+ print"sleeping 10 seconds..."
+ ox.sleep(10)
+ b=ox.times()
+-for k,v in b do print(k,v) end
++for k,v in pairs(b) do print(k,v) end
+ print""
+ print("elapsed",b.elapsed-a.elapsed)
+ print("clock",os.clock())
diff --git a/devel/lua-posix/files/patch-Makefile b/devel/lua-posix/files/patch-Makefile
index b0eb70640eb4..470cc31e5de5 100644
--- a/devel/lua-posix/files/patch-Makefile
+++ b/devel/lua-posix/files/patch-Makefile
@@ -19,12 +19,3 @@
WARN= -pedantic -Wall
INCS= -I$(LUAINC)
-@@ -21,7 +21,7 @@
- all: test
-
- test: $T
-- $(LUABIN)/lua -l$(MYNAME) test.lua
-+ LD_PRELOAD=${LUA_LIBDIR}/liblua.so:${LUA_LIBDIR}/liblualib.so $(LUABIN)/lua -l$(MYNAME) test.lua
-
- $T: $(OBJS)
- $(CC) -o $@ -shared $(OBJS)
diff --git a/devel/lua50-posix/Makefile b/devel/lua50-posix/Makefile
index 37ec1872664c..9979ebb26e84 100644
--- a/devel/lua50-posix/Makefile
+++ b/devel/lua50-posix/Makefile
@@ -5,24 +5,8 @@
# $FreeBSD$
#
-PORTNAME= posix
-PORTVERSION= 5.0
-CATEGORIES= devel
-MASTER_SITES= http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/5.0/
-PKGNAMEPREFIX= ${LUA_PKGNAMEPREFIX}
-DISTFILES= lposix.tar.gz
-
-MAINTAINER= andrew+ports@fubar.geek.nz
-COMMENT= A POSIX layer for Lua
-
USE_LUA= 5.0
-WRKSRC= ${WRKDIR}/posix
-
-PLIST_FILES= %%LUA_MODSHAREDIR%%/posix.lua \
- %%LUA_MODLIBDIR%%/lposix.so
-do-install:
- @${INSTALL_DATA} ${WRKSRC}/posix.lua ${LUA_MODSHAREDIR}
- @${INSTALL_PROGRAM} ${WRKSRC}/lposix.so ${LUA_MODLIBDIR}
+MASTERDIR= ${.CURDIR}/../lua-posix
-.include <bsd.port.mk>
+.include "${MASTERDIR}/Makefile"
diff --git a/devel/lua50-posix/distinfo b/devel/lua50-posix/distinfo
deleted file mode 100644
index 87ec6b660a1a..000000000000
--- a/devel/lua50-posix/distinfo
+++ /dev/null
@@ -1,3 +0,0 @@
-MD5 (lposix.tar.gz) = f22871247e444412a901d179028a0d82
-SHA256 (lposix.tar.gz) = e5140e19df90069b579be7983506e2461b6678e9e80b82545b6ca8070fd318a3
-SIZE (lposix.tar.gz) = 9651
diff --git a/devel/lua50-posix/files/patch-Makefile b/devel/lua50-posix/files/patch-Makefile
deleted file mode 100644
index b0eb70640eb4..000000000000
--- a/devel/lua50-posix/files/patch-Makefile
+++ /dev/null
@@ -1,30 +0,0 @@
---- Makefile.orig Wed Nov 5 21:26:49 2003
-+++ Makefile Mon Aug 7 00:38:38 2006
-@@ -1,13 +1,13 @@
- # makefile for POSIX library for Lua
-
- # change these to reflect your Lua installation
--LUA= /tmp/lhf/lua-5.0
--LUAINC= $(LUA)/include
--LUALIB= $(LUA)/lib
--LUABIN= $(LUA)/bin
-+LUA= ${PREFIX}
-+LUAINC= $(LUA_INCDIR)
-+LUALIB= $(LUA_LIBDIR)
-+LUABIN= $(LUA_BINDIR)
-
- # no need to change anything below here
--CFLAGS= -fPIC $(INCS) $(WARN) -O2 $G
-+CFLAGS+= -fPIC $(INCS) $(WARN) -O2 $G
- WARN= -pedantic -Wall
- INCS= -I$(LUAINC)
-
-@@ -21,7 +21,7 @@
- all: test
-
- test: $T
-- $(LUABIN)/lua -l$(MYNAME) test.lua
-+ LD_PRELOAD=${LUA_LIBDIR}/liblua.so:${LUA_LIBDIR}/liblualib.so $(LUABIN)/lua -l$(MYNAME) test.lua
-
- $T: $(OBJS)
- $(CC) -o $@ -shared $(OBJS)
diff --git a/devel/lua50-posix/files/patch-posix.lua b/devel/lua50-posix/files/patch-posix.lua
deleted file mode 100644
index 175746fb81df..000000000000
--- a/devel/lua50-posix/files/patch-posix.lua
+++ /dev/null
@@ -1,8 +0,0 @@
---- posix.lua.orig Tue Apr 11 23:59:52 2006
-+++ posix.lua Wed Apr 12 00:00:49 2006
-@@ -8,3 +8,5 @@
- end
-
- so"posix"
-+
-+return posix