aboutsummaryrefslogtreecommitdiffstats
path: root/lang/lua4
diff options
context:
space:
mode:
authorlinimon <linimon@FreeBSD.org>2006-09-15 16:17:11 +0800
committerlinimon <linimon@FreeBSD.org>2006-09-15 16:17:11 +0800
commitf2d8437c35c46dc1131c982c1f25abcd7d641fb3 (patch)
tree61136cc420c647223541df746f011f5307a7b184 /lang/lua4
parent6c16383d95de00351d4ecaf674a95f310d209a6b (diff)
downloadfreebsd-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/lua4')
-rw-r--r--lang/lua4/Makefile96
-rw-r--r--lang/lua4/files/patch-aa19
-rw-r--r--lang/lua4/pkg-plist84
3 files changed, 137 insertions, 62 deletions
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%%