diff options
author | linimon <linimon@FreeBSD.org> | 2006-09-15 16:17:11 +0800 |
---|---|---|
committer | linimon <linimon@FreeBSD.org> | 2006-09-15 16:17:11 +0800 |
commit | f2d8437c35c46dc1131c982c1f25abcd7d641fb3 (patch) | |
tree | 61136cc420c647223541df746f011f5307a7b184 /lang | |
parent | 6c16383d95de00351d4ecaf674a95f310d209a6b (diff) | |
download | freebsd-ports-gnome-f2d8437c35c46dc1131c982c1f25abcd7d641fb3.tar.gz freebsd-ports-gnome-f2d8437c35c46dc1131c982c1f25abcd7d641fb3.tar.zst freebsd-ports-gnome-f2d8437c35c46dc1131c982c1f25abcd7d641fb3.zip |
Modify these files to reflect bsd.lua.mk as tested on the cluster.
PR: ports/101612
Submitted by: alepulver
Hat: portmgr
Diffstat (limited to 'lang')
-rw-r--r-- | lang/lua/Makefile | 52 | ||||
-rw-r--r-- | lang/lua/pkg-plist | 81 | ||||
-rw-r--r-- | lang/lua4/Makefile | 96 | ||||
-rw-r--r-- | lang/lua4/files/patch-aa | 19 | ||||
-rw-r--r-- | lang/lua4/pkg-plist | 84 | ||||
-rw-r--r-- | lang/lua50/Makefile | 94 | ||||
-rw-r--r-- | lang/lua50/pkg-plist | 89 | ||||
-rw-r--r-- | lang/ruby-lua4/Makefile | 15 | ||||
-rw-r--r-- | lang/ruby-lua4/pkg-plist | 2 | ||||
-rw-r--r-- | lang/tolua++/Makefile | 8 | ||||
-rw-r--r-- | lang/tolua++/files/patch-config_posix.py | 14 | ||||
-rw-r--r-- | lang/tolua++50/Makefile | 8 | ||||
-rw-r--r-- | lang/tolua++50/files/patch-config_posix.py | 14 | ||||
-rw-r--r-- | lang/tolua/Makefile | 24 | ||||
-rw-r--r-- | lang/tolua/files/patch-Makefile | 22 | ||||
-rw-r--r-- | lang/tolua/files/patch-config | 30 | ||||
-rw-r--r-- | lang/tolua/pkg-plist | 7 | ||||
-rw-r--r-- | lang/tolua4/Makefile | 25 | ||||
-rw-r--r-- | lang/tolua4/files/patch-config | 26 | ||||
-rw-r--r-- | lang/tolua4/pkg-plist | 7 | ||||
-rw-r--r-- | lang/tolua50/Makefile | 24 | ||||
-rw-r--r-- | lang/tolua50/files/patch-Makefile | 22 | ||||
-rw-r--r-- | lang/tolua50/files/patch-config | 30 | ||||
-rw-r--r-- | lang/tolua50/pkg-plist | 7 |
24 files changed, 483 insertions, 317 deletions
diff --git a/lang/lua/Makefile b/lang/lua/Makefile index 35540a42841c..96de7f0e5f3a 100644 --- a/lang/lua/Makefile +++ b/lang/lua/Makefile @@ -19,20 +19,58 @@ MASTER_SITES= http://www.lua.org/ftp/ \ MAINTAINER= him@richardkiss.com COMMENT= Small, compilable scripting language providing easy access to C code -MAN1= lua.1 luac.1 +USE_LUA= 5.1 +LUA_COMPS= # only define variables +ALL_TARGET= bsd -MAKE_ARGS= bsd +MAN1= lua-${LUA_VER}.1 luac-${LUA_VER}.1 +DOCSDIR= ${PREFIX}/share/doc/${LUA_SUBDIR} +LATEST_LINK= ${LUA_SUBDIR} -CONFLICTS= lua-4* lua-5.0* +LUA_BIN= lua luac +LUA_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp +LUA_MAN= ${LUA_BIN:S/$/.1/} post-patch: - @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' ${WRKSRC}/Makefile + @${REINPLACE_CMD} -Ee \ + 's|^(CC=).*|\1 ${CC}| ; \ + s|^(CFLAGS=)|\1 ${CFLAGS}| ; \ + s|/usr/local|${PREFIX}|' \ + ${WRKSRC}/Makefile ${WRKSRC}/src/Makefile -post-install: +post-build: + @${RM} -f ${WRKSRC}/test/lua ${WRKSRC}/test/luac + +do-install: +# Programs. + ${MKDIR} ${LUA_BINDIR} +.for f in ${LUA_BIN} + ${INSTALL_PROGRAM} ${WRKSRC}/src/${f} ${LUA_BINDIR} + ${LN} -sf ${LUA_SUBDIR}/${f} ${PREFIX}/bin/${f}-${LUA_VER} +.endfor +# Include files. + ${MKDIR} ${LUA_INCDIR} +.for f in ${LUA_INC} + ${INSTALL_DATA} ${WRKSRC}/src/${f} ${LUA_INCDIR} +.endfor +# Libraries. + ${MKDIR} ${LUA_LIBDIR} + ${INSTALL_DATA} ${WRKSRC}/src/liblua.a ${LUA_LIBDIR} +# Manual pages. +.for f in ${LUA_MAN} + ${INSTALL_MAN} ${WRKSRC}/doc/${f} \ + ${PREFIX}/man/man1/${f:C/.1$//}-${LUA_VER}.1 +.endfor +# Documentation. .if !defined(NOPORTDOCS) - @${MKDIR} ${DOCSDIR} - @cd ${WRKSRC}/doc && ${INSTALL_DATA} *.html *.css *.gif ${DOCSDIR} + ${MKDIR} ${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR} + cd ${WRKSRC}/doc && ${INSTALL_DATA} *.html *.gif ${DOCSDIR} + ${CP} -r ${WRKSRC}/etc ${WRKSRC}/test ${DOCSDIR} .endif +# Module directories. + ${MKDIR} ${LUA_MODLIBDIR} + ${MKDIR} ${LUA_MODSHAREDIR} .if ${MACHINE_ARCH:L} == "amd64" CFLAGS+= -fPIC diff --git a/lang/lua/pkg-plist b/lang/lua/pkg-plist index 0e1c8d85a72b..9655c72683b5 100644 --- a/lang/lua/pkg-plist +++ b/lang/lua/pkg-plist @@ -1,22 +1,59 @@ -@exec mkdir -p %D/lib/lua/5.1 -@exec mkdir -p %D/share/lua/5.1 -%%DOCSDIR%%/contents.html -%%DOCSDIR%%/logo.gif -%%DOCSDIR%%/lua.css -%%DOCSDIR%%/lua.html -%%DOCSDIR%%/luac.html -%%DOCSDIR%%/manual.html -%%DOCSDIR%%/readme.html -bin/lua -bin/luac -include/lauxlib.h -include/lua.h -include/lua.hpp -include/luaconf.h -include/lualib.h -lib/liblua.a -@dirrm %%DOCSDIR%% -@dirrm share/lua/5.1 -@dirrm share/lua -@dirrm lib/lua/5.1 -@dirrm lib/lua +@exec mkdir -p %D/share/lua/%%LUA_VER%% +@exec mkdir -p %D/lib/lua/%%LUA_VER%% +bin/lua-%%LUA_VER%% +%%LUA_BINDIR%%/lua +%%LUA_BINDIR%%/luac +bin/luac-%%LUA_VER%% +%%LUA_INCDIR%%/lauxlib.h +%%LUA_INCDIR%%/lua.h +%%LUA_INCDIR%%/lua.hpp +%%LUA_INCDIR%%/luaconf.h +%%LUA_INCDIR%%/lualib.h +%%LUA_LIBDIR%%/liblua.a +%%PORTDOCS%%%%DOCSDIR%%/README +%%PORTDOCS%%%%DOCSDIR%%/contents.html +%%PORTDOCS%%%%DOCSDIR%%/etc/Makefile +%%PORTDOCS%%%%DOCSDIR%%/etc/README +%%PORTDOCS%%%%DOCSDIR%%/etc/all.c +%%PORTDOCS%%%%DOCSDIR%%/etc/lua.hpp +%%PORTDOCS%%%%DOCSDIR%%/etc/lua.ico +%%PORTDOCS%%%%DOCSDIR%%/etc/lua.pc +%%PORTDOCS%%%%DOCSDIR%%/etc/luavs.bat +%%PORTDOCS%%%%DOCSDIR%%/etc/min.c +%%PORTDOCS%%%%DOCSDIR%%/etc/noparser.c +%%PORTDOCS%%%%DOCSDIR%%/etc/strict.lua +%%PORTDOCS%%%%DOCSDIR%%/logo.gif +%%PORTDOCS%%%%DOCSDIR%%/lua.html +%%PORTDOCS%%%%DOCSDIR%%/luac.html +%%PORTDOCS%%%%DOCSDIR%%/manual.html +%%PORTDOCS%%%%DOCSDIR%%/readme.html +%%PORTDOCS%%%%DOCSDIR%%/test/README +%%PORTDOCS%%%%DOCSDIR%%/test/bisect.lua +%%PORTDOCS%%%%DOCSDIR%%/test/cf.lua +%%PORTDOCS%%%%DOCSDIR%%/test/echo.lua +%%PORTDOCS%%%%DOCSDIR%%/test/env.lua +%%PORTDOCS%%%%DOCSDIR%%/test/factorial.lua +%%PORTDOCS%%%%DOCSDIR%%/test/fib.lua +%%PORTDOCS%%%%DOCSDIR%%/test/fibfor.lua +%%PORTDOCS%%%%DOCSDIR%%/test/globals.lua +%%PORTDOCS%%%%DOCSDIR%%/test/hello.lua +%%PORTDOCS%%%%DOCSDIR%%/test/life.lua +%%PORTDOCS%%%%DOCSDIR%%/test/luac.lua +%%PORTDOCS%%%%DOCSDIR%%/test/printf.lua +%%PORTDOCS%%%%DOCSDIR%%/test/readonly.lua +%%PORTDOCS%%%%DOCSDIR%%/test/sieve.lua +%%PORTDOCS%%%%DOCSDIR%%/test/sort.lua +%%PORTDOCS%%%%DOCSDIR%%/test/table.lua +%%PORTDOCS%%%%DOCSDIR%%/test/trace-calls.lua +%%PORTDOCS%%%%DOCSDIR%%/test/trace-globals.lua +%%PORTDOCS%%%%DOCSDIR%%/test/xd.lua +@dirrm share/lua/%%LUA_VER%% +@dirrmtry share/lua +%%PORTDOCS%%@dirrm %%DOCSDIR%%/test +%%PORTDOCS%%@dirrm %%DOCSDIR%%/etc +%%PORTDOCS%%@dirrm %%DOCSDIR%% +@dirrm %%LUA_LIBDIR%% +@dirrm lib/lua/%%LUA_VER%% +@dirrmtry lib/lua +@dirrm %%LUA_INCDIR%% +@dirrm %%LUA_BINDIR%% diff --git a/lang/lua4/Makefile b/lang/lua4/Makefile index 5e4e66968dba..352031b6da5c 100644 --- a/lang/lua4/Makefile +++ b/lang/lua4/Makefile @@ -17,40 +17,74 @@ MASTER_SITES= ftp://ftp.tecgraf.puc-rio.br/pub/lua/ \ MAINTAINER= him@richardkiss.com COMMENT= Small, compilable scripting language providing easy access to C code -LATEST_LINK= lua4 -MAN1= luac.1 -WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} +USE_LDCONFIG= yes +USE_LUA= 4.0 +LUA_COMPS= # only define variables ALL_TARGET= all so -INSTALLS_SHLIB= YES -CONFLICTS= lua-5* +MAN1= lua-${LUA_VER}.1 luac-${LUA_VER}.1 +DOCSDIR= ${PREFIX}/share/doc/${LUA_SUBDIR} +LATEST_LINK= ${LUA_SUBDIR} -do-install: - @ ${MKDIR} ${PREFIX}/share/doc/lua - @ ${INSTALL_PROGRAM} ${WRKSRC}/bin/lua ${PREFIX}/bin - @ ${INSTALL_PROGRAM} ${WRKSRC}/bin/luac ${PREFIX}/bin - @ ${INSTALL_MAN} ${WRKSRC}/doc/luac.1 ${PREFIX}/man/man1/luac.1 - @ ${INSTALL_DATA} ${WRKSRC}/doc/idx.html ${PREFIX}/share/doc/lua - @ ${INSTALL_DATA} ${WRKSRC}/doc/index.html ${PREFIX}/share/doc/lua - @ ${INSTALL_DATA} ${WRKSRC}/doc/luac.html ${PREFIX}/share/doc/lua - @ ${INSTALL_DATA} ${WRKSRC}/doc/manual.html ${PREFIX}/share/doc/lua - @ ${INSTALL_DATA} ${WRKSRC}/include/lua.h ${PREFIX}/include - @ ${INSTALL_DATA} ${WRKSRC}/include/luadebug.h ${PREFIX}/include - @ ${INSTALL_DATA} ${WRKSRC}/include/lualib.h ${PREFIX}/include - @ ${INSTALL_DATA} ${WRKSRC}/include/lauxlib.h ${PREFIX}/include - @ ${INSTALL_DATA} ${WRKSRC}/lib/liblua.a ${PREFIX}/lib - @ ${INSTALL_DATA} ${WRKSRC}/lib/liblua.so.4.0 ${PREFIX}/lib/liblua.so.4 - @ ${LN} -s ${PREFIX}/lib/liblua.so.4 ${PREFIX}/lib/liblua.so - @ ${INSTALL_DATA} ${WRKSRC}/lib/liblualib.a ${PREFIX}/lib - @ ${INSTALL_DATA} ${WRKSRC}/lib/liblualib.so.4.0 ${PREFIX}/lib/liblualib.so.4 - @ ${LN} -s ${PREFIX}/lib/liblualib.so.4 ${PREFIX}/lib/liblualib.so - -post-install: - @${STRIP_CMD} ${PREFIX}/bin/lua - @${STRIP_CMD} ${PREFIX}/bin/luac - -.if ${MACHINE_ARCH:L} == "amd64" +LUA_BIN= lua luac +LUA_LIB= lua lualib +LUA_MAN= ${LUA_BIN:S/$/.1/} + +.include <bsd.port.pre.mk> + +.if ${ARCH} == "amd64" CFLAGS+= -fPIC .endif -.include <bsd.port.mk> +post-patch: + @${REINPLACE_CMD} -Ee \ + 's|^#(POPEN=.*)|\1|; \ + s|^(CC=).*|\1 ${CC}|; \ + s|^(CFLAGS=) -O2 (.*)|\1 ${CFLAGS} \2|; \ + s|^(V=)[[:digit:]]\.0|\1 ${LUA_VER}|' \ + ${WRKSRC}/config + @${REINPLACE_CMD} -Ee 's|(ld -o lib/(liblua(lib)?)\.so\.\$$V)|\1 -soname=\2-${LUA_VER}.so.${LUA_VER_SH}|' \ + ${WRKSRC}/${MAKEFILE} + +post-build: + @${RM} -f ${WRKSRC}/test/lua ${WRKSRC}/test/luac + +do-install: +# Programs. + ${MKDIR} ${LUA_BINDIR} +.for f in ${LUA_BIN} + ${INSTALL_PROGRAM} ${WRKSRC}/bin/${f} ${LUA_BINDIR} + ${LN} -sf ${LUA_SUBDIR}/${f} ${PREFIX}/bin/${f}-${LUA_VER} +.endfor +# Include files. + ${MKDIR} ${LUA_INCDIR} + ${INSTALL_DATA} ${WRKSRC}/include/*.h ${LUA_INCDIR} +# Libraries. + ${MKDIR} ${LUA_LIBDIR} +.for f in ${LUA_LIB} + ${INSTALL_PROGRAM} ${WRKSRC}/lib/lib${f}.a ${LUA_LIBDIR} + ${INSTALL_PROGRAM} ${WRKSRC}/lib/lib${f}.so \ + ${LUA_LIBDIR}/lib${f}-${LUA_VER}.so.${LUA_VER_SH} + @${LN} -sf lib${f}-${LUA_VER}.so.${LUA_VER_SH} ${LUA_LIBDIR}/lib${f}.so + @${LN} -sf ${LUA_SUBDIR}/lib${f}-${LUA_VER}.so.${LUA_VER_SH} \ + ${PREFIX}/lib + @${LN} -sf lib${f}-${LUA_VER}.so.${LUA_VER_SH} \ + ${PREFIX}/lib/lib${f}-${LUA_VER}.so +.endfor +# Manual pages. +.for f in ${LUA_MAN} + ${INSTALL_MAN} ${WRKSRC}/doc/${f} \ + ${PREFIX}/man/man1/${f:C/.1$//}-${LUA_VER}.1 +.endfor +# Documentation. +.if !defined(NOPORTDOCS) + ${MKDIR} ${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR} + cd ${WRKSRC}/doc && ${INSTALL_DATA} *.html *.gif ${DOCSDIR} + ${CP} -r ${WRKSRC}/etc ${WRKSRC}/test ${DOCSDIR} +.endif +# Module directories. + ${MKDIR} ${LUA_MODSHAREDIR} + ${MKDIR} ${LUA_MODLIBDIR} + +.include <bsd.port.post.mk> diff --git a/lang/lua4/files/patch-aa b/lang/lua4/files/patch-aa index 44a4a2a5d1bc..e69de29bb2d1 100644 --- a/lang/lua4/files/patch-aa +++ b/lang/lua4/files/patch-aa @@ -1,19 +0,0 @@ ---- config Mon Nov 6 12:28:20 2000 -+++ config.new Tue Jan 2 15:51:57 2001 -@@ -28,7 +28,6 @@ - # ------------------------------------------------------------------ C compiler - - # You need an ANSI C compiler. gcc is a popular one. --CC= gcc - WARN= -ansi -pedantic -Wall - - # On IRIX, cc is a good ANSI compiler. -@@ -93,7 +93,7 @@ - INCS= -I$(INC) $(EXTRA_INCS) - DEFS= $(COMPAT) $(NUMBER) $(OLD_ANSI) $(EXTRA_DEFS) - --CFLAGS= -O2 $(WARN) $(INCS) $(DEFS) -+CFLAGS+= $(WARN) $(INCS) $(DEFS) - - V=4.0 - diff --git a/lang/lua4/pkg-plist b/lang/lua4/pkg-plist index 752a182ae672..a243c69536fb 100644 --- a/lang/lua4/pkg-plist +++ b/lang/lua4/pkg-plist @@ -1,17 +1,77 @@ -bin/lua -bin/luac -include/lauxlib.h -include/lua.h -include/luadebug.h -include/lualib.h -lib/liblua.a -lib/liblua.so -lib/liblua.so.4 -lib/liblualib.a -lib/liblualib.so -lib/liblualib.so.4 +@exec mkdir -p %D/share/lua/%%LUA_VER%% +@exec mkdir -p %D/lib/lua/%%LUA_VER%% +bin/lua-%%LUA_VER%% +%%LUA_BINDIR%%/lua +%%LUA_BINDIR%%/luac +bin/luac-%%LUA_VER%% +%%LUA_INCDIR%%/lauxlib.h +%%LUA_INCDIR%%/lua.h +%%LUA_INCDIR%%/luadebug.h +%%LUA_INCDIR%%/lualib.h +lib/liblua-%%LUA_VER%%.so +lib/liblua-%%LUA_VER%%.so.%%LUA_VER_SH%% +lib/liblualib-%%LUA_VER%%.so +lib/liblualib-%%LUA_VER%%.so.0 +%%LUA_LIBDIR%%/liblua-%%LUA_VER%%.so.%%LUA_VER_SH%% +%%LUA_LIBDIR%%/liblua.a +%%LUA_LIBDIR%%/liblua.so +%%LUA_LIBDIR%%/liblualib-%%LUA_VER%%.so.%%LUA_VER_SH%% +%%LUA_LIBDIR%%/liblualib.a +%%LUA_LIBDIR%%/liblualib.so +%%PORTDOCS%%%%DOCSDIR%%/etc/Makefile +%%PORTDOCS%%%%DOCSDIR%%/etc/README +%%PORTDOCS%%%%DOCSDIR%%/etc/bin2c.c +%%PORTDOCS%%%%DOCSDIR%%/etc/def.lua +%%PORTDOCS%%%%DOCSDIR%%/etc/lua.ico +%%PORTDOCS%%%%DOCSDIR%%/etc/lua.magic +%%PORTDOCS%%%%DOCSDIR%%/etc/lua.xpm +%%PORTDOCS%%%%DOCSDIR%%/etc/min.c +%%PORTDOCS%%%%DOCSDIR%%/etc/setfallback.lua +%%PORTDOCS%%%%DOCSDIR%%/etc/stdcall.lua +%%PORTDOCS%%%%DOCSDIR%%/etc/trace.c +%%PORTDOCS%%%%DOCSDIR%%/README %%PORTDOCS%%%%DOCSDIR%%/idx.html %%PORTDOCS%%%%DOCSDIR%%/index.html +%%PORTDOCS%%%%DOCSDIR%%/logo.gif +%%PORTDOCS%%%%DOCSDIR%%/lua.html %%PORTDOCS%%%%DOCSDIR%%/luac.html %%PORTDOCS%%%%DOCSDIR%%/manual.html +%%PORTDOCS%%%%DOCSDIR%%/readme.html +%%PORTDOCS%%%%DOCSDIR%%/test/README +%%PORTDOCS%%%%DOCSDIR%%/test/bisect.lua +%%PORTDOCS%%%%DOCSDIR%%/test/cf-for.lua +%%PORTDOCS%%%%DOCSDIR%%/test/cf.lua +%%PORTDOCS%%%%DOCSDIR%%/test/examples/ps/hilbert.lua +%%PORTDOCS%%%%DOCSDIR%%/test/examples/ps/ps.lua +%%PORTDOCS%%%%DOCSDIR%%/test/examples/www/README +%%PORTDOCS%%%%DOCSDIR%%/test/examples/www/db.lua +%%PORTDOCS%%%%DOCSDIR%%/test/examples/www/staff.lua +%%PORTDOCS%%%%DOCSDIR%%/test/examples/www/template.html +%%PORTDOCS%%%%DOCSDIR%%/test/factorial.lua +%%PORTDOCS%%%%DOCSDIR%%/test/fib.lua +%%PORTDOCS%%%%DOCSDIR%%/test/globals.lua +%%PORTDOCS%%%%DOCSDIR%%/test/hello.lua +%%PORTDOCS%%%%DOCSDIR%%/test/life.lua +%%PORTDOCS%%%%DOCSDIR%%/test/lisp.lua +%%PORTDOCS%%%%DOCSDIR%%/test/old.lua +%%PORTDOCS%%%%DOCSDIR%%/test/qp.lua +%%PORTDOCS%%%%DOCSDIR%%/test/save.lua +%%PORTDOCS%%%%DOCSDIR%%/test/sort.lua +%%PORTDOCS%%%%DOCSDIR%%/test/table.lua +%%PORTDOCS%%%%DOCSDIR%%/test/trace-calls.lua +%%PORTDOCS%%%%DOCSDIR%%/test/trace-globals.lua +%%PORTDOCS%%%%DOCSDIR%%/test/undefined.lua +%%PORTDOCS%%%%DOCSDIR%%/test/webform.lua +@dirrm share/lua/%%LUA_VER%% +@dirrmtry share/lua +%%PORTDOCS%%@dirrm %%DOCSDIR%%/test/examples/www +%%PORTDOCS%%@dirrm %%DOCSDIR%%/test/examples/ps +%%PORTDOCS%%@dirrm %%DOCSDIR%%/test/examples +%%PORTDOCS%%@dirrm %%DOCSDIR%%/test +%%PORTDOCS%%@dirrm %%DOCSDIR%%/etc %%PORTDOCS%%@dirrm %%DOCSDIR%% +@dirrm %%LUA_LIBDIR%% +@dirrm lib/lua/%%LUA_VER%% +@dirrmtry lib/lua +@dirrm %%LUA_INCDIR%% +@dirrm %%LUA_BINDIR%% diff --git a/lang/lua50/Makefile b/lang/lua50/Makefile index 253e5b3e9593..ac91303c9422 100644 --- a/lang/lua50/Makefile +++ b/lang/lua50/Makefile @@ -19,36 +19,76 @@ MASTER_SITES= http://www.lua.org/ftp/ \ MAINTAINER= him@richardkiss.com COMMENT= Small, compilable scripting language providing easy access to C code -LATEST_LINK= lua50 -MAN1= lua.1 luac.1 +USE_LDCONFIG= yes +USE_LUA= 5.0 +LUA_COMPS= # only define variables ALL_TARGET= all so -INSTALL_TARGET= install soinstall -INSTALLS_SHLIB= YES - -CONFLICTS= lua-4* lua-5.1* - -do-configure: - ${REINPLACE_CMD} \ - -e 's|^\(MYCFLAGS=\).*$$|\1 ${CFLAGS}|' \ - -e 's|^\(LOADLIB=\).*$$|\1 -DUSE_DLOPEN=1|' \ - -e 's|^\(CC=\).*$$|\1 ${CC}|' \ - -e 's|^\(STRIP=\).*$$|\1 ${STRIP_CMD}|' \ - -e 's|^\(INSTALL_ROOT=\).*$$|\1 ${PREFIX}|' \ - -e 's|^\(INSTALL_EXEC=\).*$$|\1 ${INSTALL_PROGRAM}|' \ - -e 's|^\(INSTALL_DATA=\).*$$|\1 ${INSTALL_DATA}|' \ - -e 's|^#\(USERCONF.*READLINE.*\)$$|\1|' \ - -e 's|^\(EXTRA_LIBS=\).*$$|\1 -lm -lreadline -lhistory -lncurses|' \ - -e 's|V=5.0|V=5|' \ - ${WRKSRC}/config -post-install: -.if !defined(NOPORTDOCS) - @${MKDIR} ${DOCSDIR} - @cd ${WRKSRC}/doc && ${INSTALL_DATA} *.html *.gif ${DOCSDIR} -.endif +MAN1= lua-${LUA_VER}.1 luac-${LUA_VER}.1 +DOCSDIR= ${PREFIX}/share/doc/${LUA_SUBDIR} +LATEST_LINK= ${LUA_SUBDIR} -.if ${MACHINE_ARCH:L} == "amd64" +LUA_BIN= lua luac +LUA_LIB= lua lualib +LUA_MAN= ${LUA_BIN:S/$/.1/} + +.include <bsd.port.pre.mk> + +.if ${ARCH} == "amd64" CFLAGS+= -fPIC .endif -.include <bsd.port.mk> +post-patch: + @${REINPLACE_CMD} -Ee \ + 's|^(MYCFLAGS=).*|\1 ${CFLAGS}|; \ + s|^(LOADLIB=).*|\1 -DUSE_DLOPEN=1|; \ + s|^(CC=).*|\1 ${CC}|; \ + s|^#(USERCONF.*READLINE.*)|\1|; \ + s|^(EXTRA_LIBS=).*|\1 -lm -lreadline -lhistory -lncurses|; \ + s|^(V=[[:digit:]])\.0|\1|' \ + ${WRKSRC}/config + @${REINPLACE_CMD} -Ee 's|(ld -o lib/(liblua(lib)?)\.so\.\$$V)|\1 -soname=\2-${LUA_VER}.so.${LUA_VER_SH}|' \ + ${WRKSRC}/${MAKEFILE} + +post-build: + @${RM} -f ${WRKSRC}/test/lua ${WRKSRC}/test/luac + +do-install: +# Programs. + ${MKDIR} ${LUA_BINDIR} +.for f in ${LUA_BIN} + ${INSTALL_PROGRAM} ${WRKSRC}/bin/${f} ${LUA_BINDIR} + ${LN} -sf ${LUA_SUBDIR}/${f} ${PREFIX}/bin/${f}-${LUA_VER} +.endfor +# Include files. + ${MKDIR} ${LUA_INCDIR} + ${INSTALL_DATA} ${WRKSRC}/include/*.h ${LUA_INCDIR} +# Libraries. + ${MKDIR} ${LUA_LIBDIR} +.for f in ${LUA_LIB} + ${INSTALL_PROGRAM} ${WRKSRC}/lib/lib${f}.a ${LUA_LIBDIR} + ${INSTALL_PROGRAM} ${WRKSRC}/lib/lib${f}.so \ + ${LUA_LIBDIR}/lib${f}-${LUA_VER}.so.${LUA_VER_SH} + @${LN} -sf lib${f}-${LUA_VER}.so.${LUA_VER_SH} ${LUA_LIBDIR}/lib${f}.so + @${LN} -sf ${LUA_SUBDIR}/lib${f}-${LUA_VER}.so.${LUA_VER_SH} \ + ${PREFIX}/lib + @${LN} -sf lib${f}-${LUA_VER}.so.${LUA_VER_SH} \ + ${PREFIX}/lib/lib${f}-${LUA_VER}.so +.endfor +# Manual pages. +.for f in ${LUA_MAN} + ${INSTALL_MAN} ${WRKSRC}/doc/${f} \ + ${PREFIX}/man/man1/${f:C/.1$//}-${LUA_VER}.1 +.endfor +# Documentation. +.if !defined(NOPORTDOCS) + ${MKDIR} ${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR} + cd ${WRKSRC}/doc && ${INSTALL_DATA} *.html *.gif ${DOCSDIR} + ${CP} -r ${WRKSRC}/etc ${WRKSRC}/test ${DOCSDIR} +.endif +# Module directories. + ${MKDIR} ${LUA_MODLIBDIR} + ${MKDIR} ${LUA_MODSHAREDIR} + +.include <bsd.port.post.mk> diff --git a/lang/lua50/pkg-plist b/lang/lua50/pkg-plist index ce4ed92536d9..8ed37a9a4bc4 100644 --- a/lang/lua50/pkg-plist +++ b/lang/lua50/pkg-plist @@ -1,18 +1,71 @@ -bin/lua -bin/luac -include/lauxlib.h -include/lua.h -include/lualib.h -lib/liblua.a -lib/liblua.so -lib/liblua.so.5 -lib/liblualib.a -lib/liblualib.so -lib/liblualib.so.5 -%%DOCSDIR%%/contents.html -%%DOCSDIR%%/logo.gif -%%DOCSDIR%%/lua.html -%%DOCSDIR%%/luac.html -%%DOCSDIR%%/manual.html -%%DOCSDIR%%/readme.html -@dirrm %%DOCSDIR%% +@exec mkdir -p %D/share/lua/%%LUA_VER%% +@exec mkdir -p %D/lib/lua/%%LUA_VER%% +bin/lua-%%LUA_VER%% +%%LUA_BINDIR%%/lua +%%LUA_BINDIR%%/luac +bin/luac-%%LUA_VER%% +%%LUA_INCDIR%%/lauxlib.h +%%LUA_INCDIR%%/lua.h +%%LUA_INCDIR%%/lualib.h +lib/liblua-%%LUA_VER%%.so +lib/liblua-%%LUA_VER%%.so.%%LUA_VER_SH%% +lib/liblualib-%%LUA_VER%%.so +lib/liblualib-%%LUA_VER%%.so.%%LUA_VER_SH%% +%%LUA_LIBDIR%%/liblua-%%LUA_VER%%.so.%%LUA_VER_SH%% +%%LUA_LIBDIR%%/liblua.a +%%LUA_LIBDIR%%/liblua.so +%%LUA_LIBDIR%%/liblualib-%%LUA_VER%%.so.%%LUA_VER_SH%% +%%LUA_LIBDIR%%/liblualib.a +%%LUA_LIBDIR%%/liblualib.so +%%PORTDOCS%%%%DOCSDIR%%/README +%%PORTDOCS%%%%DOCSDIR%%/contents.html +%%PORTDOCS%%%%DOCSDIR%%/etc/Makefile +%%PORTDOCS%%%%DOCSDIR%%/etc/README +%%PORTDOCS%%%%DOCSDIR%%/etc/bin2c.c +%%PORTDOCS%%%%DOCSDIR%%/etc/compat.lua +%%PORTDOCS%%%%DOCSDIR%%/etc/doall.lua +%%PORTDOCS%%%%DOCSDIR%%/etc/lua.ico +%%PORTDOCS%%%%DOCSDIR%%/etc/lua.magic +%%PORTDOCS%%%%DOCSDIR%%/etc/lua.xpm +%%PORTDOCS%%%%DOCSDIR%%/etc/luser_number.h +%%PORTDOCS%%%%DOCSDIR%%/etc/luser_tests.h +%%PORTDOCS%%%%DOCSDIR%%/etc/min.c +%%PORTDOCS%%%%DOCSDIR%%/etc/noparser.c +%%PORTDOCS%%%%DOCSDIR%%/etc/saconfig.c +%%PORTDOCS%%%%DOCSDIR%%/etc/trace.c +%%PORTDOCS%%%%DOCSDIR%%/logo.gif +%%PORTDOCS%%%%DOCSDIR%%/lua.html +%%PORTDOCS%%%%DOCSDIR%%/luac.html +%%PORTDOCS%%%%DOCSDIR%%/manual.html +%%PORTDOCS%%%%DOCSDIR%%/readme.html +%%PORTDOCS%%%%DOCSDIR%%/test/README +%%PORTDOCS%%%%DOCSDIR%%/test/bisect.lua +%%PORTDOCS%%%%DOCSDIR%%/test/cf.lua +%%PORTDOCS%%%%DOCSDIR%%/test/echo.lua +%%PORTDOCS%%%%DOCSDIR%%/test/env.lua +%%PORTDOCS%%%%DOCSDIR%%/test/factorial.lua +%%PORTDOCS%%%%DOCSDIR%%/test/fib.lua +%%PORTDOCS%%%%DOCSDIR%%/test/fibfor.lua +%%PORTDOCS%%%%DOCSDIR%%/test/globals.lua +%%PORTDOCS%%%%DOCSDIR%%/test/hello.lua +%%PORTDOCS%%%%DOCSDIR%%/test/life.lua +%%PORTDOCS%%%%DOCSDIR%%/test/luac.lua +%%PORTDOCS%%%%DOCSDIR%%/test/printf.lua +%%PORTDOCS%%%%DOCSDIR%%/test/readonly.lua +%%PORTDOCS%%%%DOCSDIR%%/test/sieve.lua +%%PORTDOCS%%%%DOCSDIR%%/test/sort.lua +%%PORTDOCS%%%%DOCSDIR%%/test/table.lua +%%PORTDOCS%%%%DOCSDIR%%/test/trace-calls.lua +%%PORTDOCS%%%%DOCSDIR%%/test/trace-globals.lua +%%PORTDOCS%%%%DOCSDIR%%/test/undefined.lua +%%PORTDOCS%%%%DOCSDIR%%/test/xd.lua +@dirrm share/lua/%%LUA_VER%% +@dirrmtry share/lua +%%PORTDOCS%%@dirrm %%DOCSDIR%%/test +%%PORTDOCS%%@dirrm %%DOCSDIR%%/etc +%%PORTDOCS%%@dirrm %%DOCSDIR%% +@dirrm %%LUA_LIBDIR%% +@dirrm lib/lua/%%LUA_VER%% +@dirrmtry lib/lua +@dirrm %%LUA_INCDIR%% +@dirrm %%LUA_BINDIR%% diff --git a/lang/ruby-lua4/Makefile b/lang/ruby-lua4/Makefile index a123e4cd649a..cadd68d71d47 100644 --- a/lang/ruby-lua4/Makefile +++ b/lang/ruby-lua4/Makefile @@ -11,28 +11,33 @@ CATEGORIES= lang ruby MASTER_SITES= ${MASTER_SITE_LOCAL} MASTER_SITE_SUBDIR= knu PKGNAMEPREFIX= ${RUBY_PKGNAMEPREFIX} -PKGNAMESUFFIX= 4 DISTNAME= ruby${PORTNAME}-${PORTVERSION} DIST_SUBDIR= ruby MAINTAINER= ports@FreeBSD.org COMMENT= A Ruby extension to make Lua script language as a class -LIB_DEPENDS= lua.4:${PORTSDIR}/lang/lua4 - -CONFLICTS= ${RUBY_PKGNAMEPREFIX}lua5-[0-9]* - +USE_LUA= 4.0 USE_ZIP= yes USE_RUBY= yes USE_RUBY_EXTCONF= yes RUBY_EXTCONF= luaconf.rb +RUBY_MODNAME= ${PORTNAME}-${LUA_VER} NO_WRKSUBDIR= yes INSTALL_TARGET= site-install EXAMPLES= html_ssi_lua.rb test_* +post-patch: + @${REINPLACE_CMD} -Ee 's/[[:<:]](lua(lib)?)[[:>:]]/\1-${LUA_VER}/' \ + ${WRKSRC}/${RUBY_EXTCONF} + +post-configure: + @${REINPLACE_CMD} -Ee 's|^(CPPFLAGS =.*)|\1 -I${LUA_INCDIR}|' \ + ${WRKSRC}/${MAKEFILE} + post-install: .if !defined(NOPORTDOCS) ${MKDIR} ${RUBY_MODEXAMPLESDIR} diff --git a/lang/ruby-lua4/pkg-plist b/lang/ruby-lua4/pkg-plist index dff815fb1d93..ca609f492d67 100644 --- a/lang/ruby-lua4/pkg-plist +++ b/lang/ruby-lua4/pkg-plist @@ -1,4 +1,4 @@ -%%RUBY_SITEARCHLIBDIR%%/lua.so +%%RUBY_SITEARCHLIBDIR%%/lua-%%LUA_VER%%.so %%PORTDOCS%%%%RUBY_MODDOCDIR%%/rubylua.txt %%PORTDOCS%%@dirrm %%RUBY_MODDOCDIR%% %%PORTDOCS%%%%RUBY_MODEXAMPLESDIR%%/html_ssi_lua.rb diff --git a/lang/tolua++/Makefile b/lang/tolua++/Makefile index e6d1d950c890..5df222084a30 100644 --- a/lang/tolua++/Makefile +++ b/lang/tolua++/Makefile @@ -9,7 +9,7 @@ PORTNAME= tolua++ PORTVERSION= 1.0.4 CATEGORIES= lang devel MASTER_SITES= http://www.codenix.com/~tolua/ -DISTNAME= tolua++-current +DISTFILES= tolua++-current${EXTRACT_SUFX} MAINTAINER= aaron@FreeBSD.org COMMENT= An extended version of tolua, a tool to integrate C/C++ code with Lua @@ -22,6 +22,12 @@ USE_BZIP2= yes INSTALLS_SHLIB= yes NO_BUILD= yes +post-patch: +.for f in LOCALBASE LUA_VER LUA_INCDIR LUA_LIBDIR + @${REINPLACE_CMD} -i "" -e 's|%%${f}%%|${${f}}|g' \ + ${WRKSRC}/config_posix.py +.endfor + do-build: @cd ${WRKSRC} && scons diff --git a/lang/tolua++/files/patch-config_posix.py b/lang/tolua++/files/patch-config_posix.py index f6771d7e4d4c..3d001f49dd63 100644 --- a/lang/tolua++/files/patch-config_posix.py +++ b/lang/tolua++/files/patch-config_posix.py @@ -1,18 +1,20 @@ ---- config_posix.py.orig Thu Jan 20 20:01:08 2005 -+++ config_posix.py Wed Jan 18 11:05:32 2006 +--- ./config_posix.py.orig Fri Jan 21 00:01:08 2005 ++++ ./config_posix.py Sun Aug 27 14:25:40 2006 @@ -5,7 +5,7 @@ # flags for the compiler #CCFLAGS = [] -CCFLAGS = ['-O2', '-ansi', '-Wall'] -+CCFLAGS = ['-O2', '-ansi', '-Wall', '-I/usr/local/include'] ++CCFLAGS = ['-O2', '-ansi', '-Wall', '-I%%LOCALBASE%%/include', '-I%%LUA_INCDIR%%'] # this is the default directory for installation. Files will be installed on # <prefix>/bin, <prefix>/lib and <prefix>/include when you run 'scons install' -@@ -17,5 +17,5 @@ +@@ -16,6 +16,6 @@ + prefix = '/usr/local' # libraries - LIBS = ['lua', 'lualib', 'm'] +-LIBS = ['lua', 'lualib', 'm'] - -+LINKFLAGS = ['-L/usr/local/lib'] ++LIBS = ['lua-%%LUA_VER%%', 'lualib-%%LUA_VER%%', 'm'] ++LINKFLAGS = ['-L%%LOCALBASE%%/lib', '-L%%LUA_LIBDIR%%'] diff --git a/lang/tolua++50/Makefile b/lang/tolua++50/Makefile index e6d1d950c890..5df222084a30 100644 --- a/lang/tolua++50/Makefile +++ b/lang/tolua++50/Makefile @@ -9,7 +9,7 @@ PORTNAME= tolua++ PORTVERSION= 1.0.4 CATEGORIES= lang devel MASTER_SITES= http://www.codenix.com/~tolua/ -DISTNAME= tolua++-current +DISTFILES= tolua++-current${EXTRACT_SUFX} MAINTAINER= aaron@FreeBSD.org COMMENT= An extended version of tolua, a tool to integrate C/C++ code with Lua @@ -22,6 +22,12 @@ USE_BZIP2= yes INSTALLS_SHLIB= yes NO_BUILD= yes +post-patch: +.for f in LOCALBASE LUA_VER LUA_INCDIR LUA_LIBDIR + @${REINPLACE_CMD} -i "" -e 's|%%${f}%%|${${f}}|g' \ + ${WRKSRC}/config_posix.py +.endfor + do-build: @cd ${WRKSRC} && scons diff --git a/lang/tolua++50/files/patch-config_posix.py b/lang/tolua++50/files/patch-config_posix.py index f6771d7e4d4c..3d001f49dd63 100644 --- a/lang/tolua++50/files/patch-config_posix.py +++ b/lang/tolua++50/files/patch-config_posix.py @@ -1,18 +1,20 @@ ---- config_posix.py.orig Thu Jan 20 20:01:08 2005 -+++ config_posix.py Wed Jan 18 11:05:32 2006 +--- ./config_posix.py.orig Fri Jan 21 00:01:08 2005 ++++ ./config_posix.py Sun Aug 27 14:25:40 2006 @@ -5,7 +5,7 @@ # flags for the compiler #CCFLAGS = [] -CCFLAGS = ['-O2', '-ansi', '-Wall'] -+CCFLAGS = ['-O2', '-ansi', '-Wall', '-I/usr/local/include'] ++CCFLAGS = ['-O2', '-ansi', '-Wall', '-I%%LOCALBASE%%/include', '-I%%LUA_INCDIR%%'] # this is the default directory for installation. Files will be installed on # <prefix>/bin, <prefix>/lib and <prefix>/include when you run 'scons install' -@@ -17,5 +17,5 @@ +@@ -16,6 +16,6 @@ + prefix = '/usr/local' # libraries - LIBS = ['lua', 'lualib', 'm'] +-LIBS = ['lua', 'lualib', 'm'] - -+LINKFLAGS = ['-L/usr/local/lib'] ++LIBS = ['lua-%%LUA_VER%%', 'lualib-%%LUA_VER%%', 'm'] ++LINKFLAGS = ['-L%%LOCALBASE%%/lib', '-L%%LUA_LIBDIR%%'] diff --git a/lang/tolua/Makefile b/lang/tolua/Makefile index 02c083a00bda..6e07b3331eff 100644 --- a/lang/tolua/Makefile +++ b/lang/tolua/Makefile @@ -15,15 +15,25 @@ MASTER_SITES= ftp://ftp.tecgraf.puc-rio.br/pub/users/celes/tolua/ \ MAINTAINER= edwin@mavetju.org COMMENT= toLua: accessing C/C++ code from Lua -LIB_DEPENDS= lua:${PORTSDIR}/lang/lua50 - -WRKSRC= ${WRKDIR}/${PORTNAME}-5.0 USE_GMAKE= yes -CONFLICTS= tolua4-.* +USE_LUA= 5.0 +WRKSRC= ${WRKDIR}/${PORTNAME}-5.0 + +post-patch: + @${REINPLACE_CMD} -e 's|make|$${MAKE}|' ${WRKSRC}/${MAKEFILE} + @${REINPLACE_CMD} -Ee \ + 's|^(CC=).*|\1 ${CC}|; \ + s|^(CCPP=).*|\1 ${CXX}|; \ + s|^(LUA=).*|\1 ${LOCALBASE}|; \ + s|^(LUA(INC\|LIB)=).*|\1 $${LUA_\2DIR}|; \ + s|^(CPPFLAGS)(=.*)|\1+\2 -lstdc++|; \ + s|^(CFLAGS)(=.*)|\1+\2|;' \ + ${WRKSRC}/config do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/bin/tolua ${PREFIX}/bin - ${INSTALL_DATA} ${WRKSRC}/include/tolua.h ${PREFIX}/include - ${INSTALL_DATA} ${WRKSRC}/lib/libtolua.a ${PREFIX}/lib + ${INSTALL_PROGRAM} ${WRKSRC}/bin/tolua ${LUA_BINDIR} + ${LN} -sf ${LUA_SUBDIR}/tolua ${PREFIX}/bin/tolua-${LUA_VER} + ${INSTALL_DATA} ${WRKSRC}/include/tolua.h ${LUA_INCDIR} + ${INSTALL_DATA} ${WRKSRC}/lib/libtolua.a ${LUA_LIBDIR} .include <bsd.port.mk> diff --git a/lang/tolua/files/patch-Makefile b/lang/tolua/files/patch-Makefile index ea3d00107550..e69de29bb2d1 100644 --- a/lang/tolua/files/patch-Makefile +++ b/lang/tolua/files/patch-Makefile @@ -1,22 +0,0 @@ ---- Makefile.orig Thu Jul 31 23:27:52 2003 -+++ Makefile Sun Nov 21 18:50:08 2004 -@@ -1,13 +1,13 @@ - # makefile for tolua hierarchy - - tolua: -- cd src/lib; make all -- cd src/bin; make all -+ cd src/lib; ${MAKE} all -+ cd src/bin; ${MAKE} all - - tests: -- cd src/tests; make all -+ cd src/tests; ${MAKE} all - - all clean klean: -- cd src/lib; make $@ -- cd src/bin; make $@ -- cd src/tests; make $@ -+ cd src/lib; ${MAKE} $@ -+ cd src/bin; ${MAKE} $@ -+ cd src/tests; ${MAKE} $@ diff --git a/lang/tolua/files/patch-config b/lang/tolua/files/patch-config index 1bd699de6573..e69de29bb2d1 100644 --- a/lang/tolua/files/patch-config +++ b/lang/tolua/files/patch-config @@ -1,30 +0,0 @@ ---- config.orig Tue Jun 8 06:09:19 2004 -+++ config Sun Nov 21 19:24:24 2004 -@@ -3,8 +3,9 @@ - # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT ====================== - - # you need an ANSI C compiler. gcc is a popular one. --CC= gcc --CCPP = g++ -+#CC= ${CC} -+CC = cc -+CCPP = c++ - WARN= -ansi -Wall - - # on SGI's, cc is ANSI. -@@ -22,6 +23,7 @@ - - # set lua path - LUA=/usr/local/lua-5.0 -+LUA=${LOCALBASE} - LUAINC=$(LUA)/include - LUALIB=$(LUA)/lib - -@@ -30,5 +32,5 @@ - INC= -I$(TOLUA)/include -I$(LUAINC) - LIB= -L$(TOLUA)/lib -L$(LUALIB) - --CFLAGS= -O2 $(WARN) $(INC) --CPPFLAGS= -O2 $(WARN) $(INC) -+CFLAGS+= -O2 $(WARN) $(INC) -+CPPFLAGS+= -O2 $(WARN) $(INC) -lstdc++ diff --git a/lang/tolua/pkg-plist b/lang/tolua/pkg-plist index 488452014d8f..ef0070c93b27 100644 --- a/lang/tolua/pkg-plist +++ b/lang/tolua/pkg-plist @@ -1,3 +1,4 @@ -bin/tolua -lib/libtolua.a -include/tolua.h +%%LUA_BINDIR%%/tolua +bin/tolua-%%LUA_VER%% +%%LUA_LIBDIR%%/libtolua.a +%%LUA_INCDIR%%/tolua.h diff --git a/lang/tolua4/Makefile b/lang/tolua4/Makefile index 9330f0722101..c0534a2dd6b6 100644 --- a/lang/tolua4/Makefile +++ b/lang/tolua4/Makefile @@ -6,7 +6,7 @@ # $FreeBSD$ # -PORTNAME= tolua4 +PORTNAME= tolua PORTVERSION= 4.0a CATEGORIES= lang MASTER_SITES= ftp://ftp.tecgraf.puc-rio.br/pub/users/celes/tolua/ \ @@ -16,15 +16,24 @@ DISTNAME= tolua-4.0a MAINTAINER= edwin@mavetju.org COMMENT= toLua: accessing C/C++ code from Lua -LIB_DEPENDS= lua.4:${PORTSDIR}/lang/lua4 - -WRKSRC= ${WRKDIR}/tolua USE_GMAKE= yes -CONFLICTS= tolua-5.* +USE_LUA= 4.0 +WRKSRC= ${WRKDIR}/tolua + +LATEST_LINK= ${PORTNAME}${LUA_VER_STR} + +post-patch: + @${REINPLACE_CMD} -Ee \ + 's|^(CC=).*|\1 ${CC}|; \ + s|^(LUA=).*|\1 ${LOCALBASE}|; \ + s|^(LUA(INC\|LIB)=.*)|\1/lua${LUA_VER_STR}|; \ + s|^(CFLAGS)(=.*)|\1+\2|;' \ + ${WRKSRC}/config do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/bin/tolua ${PREFIX}/bin - ${INSTALL_DATA} ${WRKSRC}/include/tolua.h ${PREFIX}/include - ${INSTALL_DATA} ${WRKSRC}/lib/libtolua.a ${PREFIX}/lib + ${INSTALL_PROGRAM} ${WRKSRC}/bin/tolua ${LUA_BINDIR} + ${LN} -sf ${LUA_SUBDIR}/tolua ${PREFIX}/bin/tolua-${LUA_VER} + ${INSTALL_DATA} ${WRKSRC}/include/tolua.h ${LUA_INCDIR} + ${INSTALL_DATA} ${WRKSRC}/lib/libtolua.a ${LUA_LIBDIR} .include <bsd.port.mk> diff --git a/lang/tolua4/files/patch-config b/lang/tolua4/files/patch-config index 1786f1f143e2..e69de29bb2d1 100644 --- a/lang/tolua4/files/patch-config +++ b/lang/tolua4/files/patch-config @@ -1,26 +0,0 @@ ---- config.orig Sun Nov 21 20:12:01 2004 -+++ config Sun Nov 21 20:12:39 2004 -@@ -3,7 +3,7 @@ - # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT ====================== - - # you need an ANSI C compiler. gcc is a popular one. --CC= gcc -+#CC= gcc - WARN= -ansi -Wall - - # on SGI's, cc is ANSI. -@@ -20,7 +20,7 @@ - AR= ar rcu - - # set lua path --LUA=/usr/local/lua -+LUA=${LOCALBASE} - LUAINC=$(LUA)/include - LUALIB=$(LUA)/lib - -@@ -29,4 +29,4 @@ - INC= -I$(LUAINC) -I$(TOLUA)/include - LIB= -L$(LUALIB) - --CFLAGS= -O2 $(WARN) $(INC) -+CFLAGS+= -O2 $(WARN) $(INC) diff --git a/lang/tolua4/pkg-plist b/lang/tolua4/pkg-plist index 488452014d8f..6348f5bce05b 100644 --- a/lang/tolua4/pkg-plist +++ b/lang/tolua4/pkg-plist @@ -1,3 +1,4 @@ -bin/tolua -lib/libtolua.a -include/tolua.h +%%LUA_BINDIR%%/tolua +bin/tolua-%%LUA_VER%% +%%LUA_INCDIR%%/tolua.h +%%LUA_LIBDIR%%/libtolua.a diff --git a/lang/tolua50/Makefile b/lang/tolua50/Makefile index 02c083a00bda..6e07b3331eff 100644 --- a/lang/tolua50/Makefile +++ b/lang/tolua50/Makefile @@ -15,15 +15,25 @@ MASTER_SITES= ftp://ftp.tecgraf.puc-rio.br/pub/users/celes/tolua/ \ MAINTAINER= edwin@mavetju.org COMMENT= toLua: accessing C/C++ code from Lua -LIB_DEPENDS= lua:${PORTSDIR}/lang/lua50 - -WRKSRC= ${WRKDIR}/${PORTNAME}-5.0 USE_GMAKE= yes -CONFLICTS= tolua4-.* +USE_LUA= 5.0 +WRKSRC= ${WRKDIR}/${PORTNAME}-5.0 + +post-patch: + @${REINPLACE_CMD} -e 's|make|$${MAKE}|' ${WRKSRC}/${MAKEFILE} + @${REINPLACE_CMD} -Ee \ + 's|^(CC=).*|\1 ${CC}|; \ + s|^(CCPP=).*|\1 ${CXX}|; \ + s|^(LUA=).*|\1 ${LOCALBASE}|; \ + s|^(LUA(INC\|LIB)=).*|\1 $${LUA_\2DIR}|; \ + s|^(CPPFLAGS)(=.*)|\1+\2 -lstdc++|; \ + s|^(CFLAGS)(=.*)|\1+\2|;' \ + ${WRKSRC}/config do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/bin/tolua ${PREFIX}/bin - ${INSTALL_DATA} ${WRKSRC}/include/tolua.h ${PREFIX}/include - ${INSTALL_DATA} ${WRKSRC}/lib/libtolua.a ${PREFIX}/lib + ${INSTALL_PROGRAM} ${WRKSRC}/bin/tolua ${LUA_BINDIR} + ${LN} -sf ${LUA_SUBDIR}/tolua ${PREFIX}/bin/tolua-${LUA_VER} + ${INSTALL_DATA} ${WRKSRC}/include/tolua.h ${LUA_INCDIR} + ${INSTALL_DATA} ${WRKSRC}/lib/libtolua.a ${LUA_LIBDIR} .include <bsd.port.mk> diff --git a/lang/tolua50/files/patch-Makefile b/lang/tolua50/files/patch-Makefile index ea3d00107550..e69de29bb2d1 100644 --- a/lang/tolua50/files/patch-Makefile +++ b/lang/tolua50/files/patch-Makefile @@ -1,22 +0,0 @@ ---- Makefile.orig Thu Jul 31 23:27:52 2003 -+++ Makefile Sun Nov 21 18:50:08 2004 -@@ -1,13 +1,13 @@ - # makefile for tolua hierarchy - - tolua: -- cd src/lib; make all -- cd src/bin; make all -+ cd src/lib; ${MAKE} all -+ cd src/bin; ${MAKE} all - - tests: -- cd src/tests; make all -+ cd src/tests; ${MAKE} all - - all clean klean: -- cd src/lib; make $@ -- cd src/bin; make $@ -- cd src/tests; make $@ -+ cd src/lib; ${MAKE} $@ -+ cd src/bin; ${MAKE} $@ -+ cd src/tests; ${MAKE} $@ diff --git a/lang/tolua50/files/patch-config b/lang/tolua50/files/patch-config index 1bd699de6573..e69de29bb2d1 100644 --- a/lang/tolua50/files/patch-config +++ b/lang/tolua50/files/patch-config @@ -1,30 +0,0 @@ ---- config.orig Tue Jun 8 06:09:19 2004 -+++ config Sun Nov 21 19:24:24 2004 -@@ -3,8 +3,9 @@ - # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT ====================== - - # you need an ANSI C compiler. gcc is a popular one. --CC= gcc --CCPP = g++ -+#CC= ${CC} -+CC = cc -+CCPP = c++ - WARN= -ansi -Wall - - # on SGI's, cc is ANSI. -@@ -22,6 +23,7 @@ - - # set lua path - LUA=/usr/local/lua-5.0 -+LUA=${LOCALBASE} - LUAINC=$(LUA)/include - LUALIB=$(LUA)/lib - -@@ -30,5 +32,5 @@ - INC= -I$(TOLUA)/include -I$(LUAINC) - LIB= -L$(TOLUA)/lib -L$(LUALIB) - --CFLAGS= -O2 $(WARN) $(INC) --CPPFLAGS= -O2 $(WARN) $(INC) -+CFLAGS+= -O2 $(WARN) $(INC) -+CPPFLAGS+= -O2 $(WARN) $(INC) -lstdc++ diff --git a/lang/tolua50/pkg-plist b/lang/tolua50/pkg-plist index 488452014d8f..ef0070c93b27 100644 --- a/lang/tolua50/pkg-plist +++ b/lang/tolua50/pkg-plist @@ -1,3 +1,4 @@ -bin/tolua -lib/libtolua.a -include/tolua.h +%%LUA_BINDIR%%/tolua +bin/tolua-%%LUA_VER%% +%%LUA_LIBDIR%%/libtolua.a +%%LUA_INCDIR%%/tolua.h |