summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authoralnsn <alnsn@pkgsrc.org>2014-05-03 13:00:44 +0000
committeralnsn <alnsn@pkgsrc.org>2014-05-03 13:00:44 +0000
commitda499f3dfeb25e7fe783f8ed7744f37e674f9f78 (patch)
treec339de9879e29da7d839e2bc71a8658a92217e0b /lang
parent7e4185969545b7f45005a211a33edc8e59a7ad74 (diff)
downloadpkgsrc-da499f3dfeb25e7fe783f8ed7744f37e674f9f78.tar.gz
Multiversion support for Lua.
Diffstat (limited to 'lang')
-rw-r--r--lang/lua/application.mk6
-rw-r--r--lang/lua/luaversion.mk17
-rw-r--r--lang/lua/module.mk35
-rw-r--r--lang/lua/tool.mk38
-rw-r--r--lang/lua51/Makefile11
-rw-r--r--lang/lua51/PLIST94
-rw-r--r--lang/lua51/buildlink3.mk14
-rw-r--r--lang/lua51/distinfo7
-rw-r--r--lang/lua51/patches/patch-aa23
-rw-r--r--lang/lua51/patches/patch-ab17
-rw-r--r--lang/lua51/patches/patch-etc_lua.pc13
-rw-r--r--lang/lua52/Makefile15
-rw-r--r--lang/lua52/PLIST38
-rw-r--r--lang/lua52/buildlink3.mk12
-rw-r--r--lang/lua52/distinfo6
-rw-r--r--lang/lua52/files/lua.pc.in6
-rw-r--r--lang/lua52/patches/patch-aa20
-rw-r--r--lang/lua52/patches/patch-ab12
18 files changed, 261 insertions, 123 deletions
diff --git a/lang/lua/application.mk b/lang/lua/application.mk
index eace97b1b23..45e5a1d76e0 100644
--- a/lang/lua/application.mk
+++ b/lang/lua/application.mk
@@ -1,4 +1,4 @@
-# $NetBSD: application.mk,v 1.3 2013/10/30 09:09:59 obache Exp $
+# $NetBSD: application.mk,v 1.4 2014/05/03 13:00:44 alnsn Exp $
#
# This makefile fragment is intended to be included by packages that
# install Lua scripts.
@@ -11,11 +11,13 @@
# Keywords: Lua
#
+.if !defined(LUA_LUAVERSION_MK)
.include "../../lang/lua/luaversion.mk"
+.endif
.if defined(REPLACE_LUA)
REPLACE_INTERPRETER+= lua
REPLACE.lua.old= .*lua
-REPLACE.lua.new= ${LOCALBASE}/bin/lua
+REPLACE.lua.new= ${LUA_INTERPRETER}
REPLACE_FILES.lua= ${REPLACE_LUA}
.endif
diff --git a/lang/lua/luaversion.mk b/lang/lua/luaversion.mk
index 40b6de560f0..bb96f485529 100644
--- a/lang/lua/luaversion.mk
+++ b/lang/lua/luaversion.mk
@@ -1,4 +1,4 @@
-# $NetBSD: luaversion.mk,v 1.4 2013/11/05 11:26:44 obache Exp $
+# $NetBSD: luaversion.mk,v 1.5 2014/05/03 13:00:44 alnsn Exp $
# This file determins which Lua version is used as a dependency for
# a package.
@@ -47,6 +47,17 @@
#
# Example: lua51
#
+# LUA_INCDIR
+# Relative path to include files.
+#
+# Example: include/lua-51
+#
+# LUA_INTERPRETER
+# Full path to Lua interpreter.
+#
+# LUA_COMPILER
+# Full path to Lua bytecode compiler (luac).
+#
# Keywords: Lua
#
@@ -127,4 +138,8 @@ PKG_FAIL_REASION+= "No valid Lua version found"
.include "${LUA_PKGSRCDIR}/version.mk"
_LUA_DOT_VERSION= ${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}
+LUA_INCDIR= include/lua-${_LUA_DOT_VERSION}
+LUA_INTERPRETER= ${LOCALBASE}/bin/lua${_LUA_DOT_VERSION}
+LUA_COMPILER= ${LOCALBASE}/bin/luac${_LUA_DOT_VERSION}
+
.endif # LUA_LUAVERSION_MK
diff --git a/lang/lua/module.mk b/lang/lua/module.mk
index 83128cb68d4..62b05d17c77 100644
--- a/lang/lua/module.mk
+++ b/lang/lua/module.mk
@@ -1,16 +1,39 @@
-# $NetBSD: module.mk,v 1.5 2013/10/30 06:18:09 dholland Exp $
+# $NetBSD: module.mk,v 1.6 2014/05/03 13:00:44 alnsn Exp $
#
# This Makefile fragment is intended to be included by packages that
-# install Lua packages.
+# install Lua modules.
+#
+# === Defined variables ===
+#
+# LUA_LDIR
+# Path where Lua modules are installed.
+#
+# LUA_CDIR
+# Path where Lua C modules are installed. Not defined if
+# NO_BUILD variable is set to "yes".
+#
+# LUA_DOCDIR
+# Path where documentation files are installed.
+#
+# LUA_EXAMPLESDIR
+# Path where example files are installed.
+#
+# Keywords: lua
+#
.if !defined(LUA_MODULE_MK)
LUA_MODULE_MK= # defined
+.if !defined(LUA_LUAVERSION_MK)
.include "../../lang/lua/luaversion.mk"
+.endif
LUA_LDIR= share/lua/${_LUA_DOT_VERSION}
PLIST_SUBST+= LUA_LDIR=${LUA_LDIR}
+PRINT_PLIST_AWK+= /^${LUA_LDIR:S|/|\\/|g}/ \
+ { gsub(/${LUA_LDIR:S|/|\\/|g}/, "$${LUA_LDIR}") }
+
.if defined(NO_BUILD) && empty(NO_BUILD:M[Nn][Oo])
DEPENDS+= ${LUA_BASEDEPENDS}
@@ -18,12 +41,16 @@ DEPENDS+= ${LUA_BASEDEPENDS}
LUA_CDIR= lib/lua/${_LUA_DOT_VERSION}
PLIST_SUBST+= LUA_CDIR=${LUA_CDIR}
-PRINT_PLIST_AWK+= /^${LUA_LDIR:S|/|\\/|g}/ \
- { gsub(/${LUA_LDIR:S|/|\\/|g}/, "$${LUA_LDIR}") }
PRINT_PLIST_AWK+= /^${LUA_CDIR:S|/|\\/|g}/ \
{ gsub(/${LUA_CDIR:S|/|\\/|g}/, "$${LUA_CDIR}") }
.include "${LUA_PKGSRCDIR}/buildlink3.mk"
.endif
+LUA_DOCDIR= share/doc/${PKGBASE}
+PLIST_SUBST+= LUA_DOCDIR=${LUA_DOCDIR}
+
+LUA_EXAMPLESDIR= share/examples/${PKGBASE}
+PLIST_SUBST+= LUA_EXAMPLESDIR=${LUA_EXAMPLESDIR}
+
.endif # LUA_MODULE_MK
diff --git a/lang/lua/tool.mk b/lang/lua/tool.mk
new file mode 100644
index 00000000000..28f8e581191
--- /dev/null
+++ b/lang/lua/tool.mk
@@ -0,0 +1,38 @@
+# $NetBSD: tool.mk,v 1.1 2014/05/03 13:00:44 alnsn Exp $
+#
+# Create `lua' interpreter wrapper for applicable Lua bin.
+#
+# This mk fragment can be included in all packages that uses `lua'
+# as a tool without version suffix.
+#
+# Keywords: Lua
+#
+
+.if !defined(LUA_TOOL_MK)
+LUA_TOOL_MK= defined
+
+.if !defined(LUA_LUAVERSION_MK)
+.include "../../lang/lua/luaversion.mk"
+.endif
+
+BUILDLINK_TARGETS+= buildlink-bin-lua buildlink-bin-luac
+
+.PHONY: buildlink-bin-lua
+buildlink-bin-lua:
+ ${RUN} \
+ f="${LUA_INTERPRETER}"; \
+ t="${BUILDLINK_DIR}/bin/lua"; \
+ if ${TEST} -f $$f -a ! -f $$t ; then \
+ ${LN} -sf $$f $$t; \
+ fi
+
+.PHONY: buildlink-bin-luac
+buildlink-bin-luac:
+ ${RUN} \
+ f="${LUA_COMPILER}"; \
+ t="${BUILDLINK_DIR}/bin/luac"; \
+ if ${TEST} -f $$f -a ! -f $$t ; then \
+ ${LN} -sf $$f $$t; \
+ fi
+
+.endif # LUA_TOOL_MK
diff --git a/lang/lua51/Makefile b/lang/lua51/Makefile
index 1c5ef8e47f2..481b4334851 100644
--- a/lang/lua51/Makefile
+++ b/lang/lua51/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2013/10/30 06:18:09 dholland Exp $
+# $NetBSD: Makefile,v 1.2 2014/05/03 13:00:44 alnsn Exp $
DISTNAME= lua-${LUA_VERSION}
PKGNAME= lua51-${LUA_VERSION}
@@ -26,8 +26,8 @@ CFLAGS+= -DLUA_ROOT=\"${PREFIX}/\"
MAKE_FLAGS+= CC=cc
-DOCDIR= ${PREFIX}/share/doc/lua
-EGDIR= ${PREFIX}/share/examples/lua
+DOCDIR= ${PREFIX}/share/doc/lua-5.1
+EGDIR= ${PREFIX}/share/examples/lua-5.1
.if ${OPSYS} == "FreeBSD"
BUILD_TARGET= freebsd
@@ -74,8 +74,9 @@ post-install:
cd ${WRKSRC}/etc; for f in README *.c *.ico *.lua; do \
${INSTALL_DATA} "$$f" ${DESTDIR}${EGDIR}/etc; \
done
- ${INSTALL_DATA} ${WRKSRC}/etc/lua.pc ${DESTDIR}${PREFIX}/lib/pkgconfig
+ ${INSTALL_DATA} ${WRKSRC}/etc/lua.pc \
+ ${DESTDIR}${PREFIX}/lib/pkgconfig/lua-5.1.pc
-.include "../../devel/readline/buildlink3.mk"
+.include "../../mk/readline.buildlink3.mk"
.include "../../mk/dlopen.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/lang/lua51/PLIST b/lang/lua51/PLIST
index 94f42a2b4ed..412e3db2e7f 100644
--- a/lang/lua51/PLIST
+++ b/lang/lua51/PLIST
@@ -1,49 +1,49 @@
-@comment $NetBSD: PLIST,v 1.1 2013/10/30 06:18:09 dholland Exp $
-bin/lua
-bin/luac
-include/lauxlib.h
-include/lua.h
-include/lua.hpp
-include/luaconf.h
-include/lualib.h
-lib/liblua.la
-lib/pkgconfig/lua.pc
-man/man1/lua.1
-man/man1/luac.1
-share/doc/lua/COPYRIGHT
-share/doc/lua/HISTORY
-share/doc/lua/README
-share/doc/lua/contents.html
-share/doc/lua/logo.gif
-share/doc/lua/lua.html
-share/doc/lua/luac.html
-share/doc/lua/manual.html
-share/doc/lua/readme.html
-share/examples/lua/README
-share/examples/lua/bisect.lua
-share/examples/lua/cf.lua
-share/examples/lua/echo.lua
-share/examples/lua/env.lua
-share/examples/lua/etc/README
-share/examples/lua/etc/all.c
-share/examples/lua/etc/lua.ico
-share/examples/lua/etc/min.c
-share/examples/lua/etc/noparser.c
-share/examples/lua/etc/strict.lua
-share/examples/lua/factorial.lua
-share/examples/lua/fib.lua
-share/examples/lua/fibfor.lua
-share/examples/lua/globals.lua
-share/examples/lua/hello.lua
-share/examples/lua/life.lua
-share/examples/lua/luac.lua
-share/examples/lua/printf.lua
-share/examples/lua/readonly.lua
-share/examples/lua/sieve.lua
-share/examples/lua/sort.lua
-share/examples/lua/table.lua
-share/examples/lua/trace-calls.lua
-share/examples/lua/trace-globals.lua
-share/examples/lua/xd.lua
+@comment $NetBSD: PLIST,v 1.2 2014/05/03 13:00:44 alnsn Exp $
+bin/lua5.1
+bin/luac5.1
+include/lua-5.1/lauxlib.h
+include/lua-5.1/lua.h
+include/lua-5.1/lua.hpp
+include/lua-5.1/luaconf.h
+include/lua-5.1/lualib.h
+lib/liblua5.1.la
+lib/pkgconfig/lua-5.1.pc
+man/man1/lua5.1.1
+man/man1/luac5.1.1
+share/doc/lua-5.1/COPYRIGHT
+share/doc/lua-5.1/HISTORY
+share/doc/lua-5.1/README
+share/doc/lua-5.1/contents.html
+share/doc/lua-5.1/logo.gif
+share/doc/lua-5.1/lua.html
+share/doc/lua-5.1/luac.html
+share/doc/lua-5.1/manual.html
+share/doc/lua-5.1/readme.html
+share/examples/lua-5.1/README
+share/examples/lua-5.1/bisect.lua
+share/examples/lua-5.1/cf.lua
+share/examples/lua-5.1/echo.lua
+share/examples/lua-5.1/env.lua
+share/examples/lua-5.1/etc/README
+share/examples/lua-5.1/etc/all.c
+share/examples/lua-5.1/etc/lua.ico
+share/examples/lua-5.1/etc/min.c
+share/examples/lua-5.1/etc/noparser.c
+share/examples/lua-5.1/etc/strict.lua
+share/examples/lua-5.1/factorial.lua
+share/examples/lua-5.1/fib.lua
+share/examples/lua-5.1/fibfor.lua
+share/examples/lua-5.1/globals.lua
+share/examples/lua-5.1/hello.lua
+share/examples/lua-5.1/life.lua
+share/examples/lua-5.1/luac.lua
+share/examples/lua-5.1/printf.lua
+share/examples/lua-5.1/readonly.lua
+share/examples/lua-5.1/sieve.lua
+share/examples/lua-5.1/sort.lua
+share/examples/lua-5.1/table.lua
+share/examples/lua-5.1/trace-calls.lua
+share/examples/lua-5.1/trace-globals.lua
+share/examples/lua-5.1/xd.lua
@pkgdir share/lua/5.1
@pkgdir lib/lua/5.1
diff --git a/lang/lua51/buildlink3.mk b/lang/lua51/buildlink3.mk
index 541a9a4323f..6463de8d92f 100644
--- a/lang/lua51/buildlink3.mk
+++ b/lang/lua51/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.2 2013/10/30 08:59:36 obache Exp $
+# $NetBSD: buildlink3.mk,v 1.3 2014/05/03 13:00:44 alnsn Exp $
BUILDLINK_TREE+= lua51
@@ -8,7 +8,17 @@ LUA51_BUILDLINK3_MK:=
BUILDLINK_API_DEPENDS.lua51+= lua51>=5.1.1<5.2
BUILDLINK_PKGSRCDIR.lua51?= ../../lang/lua51
-.include "../../devel/readline/buildlink3.mk"
+.if defined(BUILDLINK_DEPMETHOD.lua)
+BUILDLINK_DEPMETHOD.lua51?= ${BUILDLINK_DEPMETHOD.lua}
+.endif
+
+# -llua -> -llua5.1
+BUILDLINK_TRANSFORM+= l:lua:lua5.1
+BUILDLINK_INCDIRS.lua51+= include/lua-5.1
+
+BUILDLINK_FNAME_TRANSFORM.lua51+= -e 's|lib/pkgconfig/lua-5.1.pc|lib/pkgconfig/lua.pc|'
+
+.include "../../mk/readline.buildlink3.mk"
.endif # LUA51_BUILDLINK3_MK
BUILDLINK_TREE+= -lua51
diff --git a/lang/lua51/distinfo b/lang/lua51/distinfo
index c658de241f0..06b9ddfd5c9 100644
--- a/lang/lua51/distinfo
+++ b/lang/lua51/distinfo
@@ -1,8 +1,9 @@
-$NetBSD: distinfo,v 1.1 2013/10/30 06:18:09 dholland Exp $
+$NetBSD: distinfo,v 1.2 2014/05/03 13:00:44 alnsn Exp $
SHA1 (lua-5.1.5.tar.gz) = b3882111ad02ecc6b972f8c1241647905cb2e3fc
RMD160 (lua-5.1.5.tar.gz) = b0c2234675335a8bf158a125b6778cf800c754a0
Size (lua-5.1.5.tar.gz) = 221213 bytes
-SHA1 (patch-aa) = 25bcd22d3fc319c51356b7f976d0215eb04900db
-SHA1 (patch-ab) = 6f0964957112afbbc77648c86ae2a6ddd20c3389
+SHA1 (patch-aa) = 4af5fcbd1c76bc7b0815a330c43d1e5eb715e6ff
+SHA1 (patch-ab) = 53e8e2693e3afa819079e253f212988a44357412
SHA1 (patch-ac) = bd2348dcb273de09ddc09da906c93de6cc209c5c
+SHA1 (patch-etc_lua.pc) = fa737dc85922d8b4d9f2d61fafb8fcdebf53b059
diff --git a/lang/lua51/patches/patch-aa b/lang/lua51/patches/patch-aa
index 240e51a7662..a1f6b57505e 100644
--- a/lang/lua51/patches/patch-aa
+++ b/lang/lua51/patches/patch-aa
@@ -1,7 +1,7 @@
-$NetBSD: patch-aa,v 1.1 2013/10/30 06:18:10 dholland Exp $
+$NetBSD: patch-aa,v 1.2 2014/05/03 13:00:44 alnsn Exp $
---- Makefile.orig 2008-08-12 01:40:48.000000000 +0100
-+++ Makefile 2009-12-17 16:36:32.000000000 +0000
+--- Makefile.orig 2012-02-10 09:50:23.000000000 +0000
++++ Makefile
@@ -9,11 +9,11 @@ PLAT= none
# Where to install. The installation starts in the src and doc directories,
@@ -9,7 +9,8 @@ $NetBSD: patch-aa,v 1.1 2013/10/30 06:18:10 dholland Exp $
-INSTALL_TOP= /usr/local
+INSTALL_TOP= ${PREFIX}
INSTALL_BIN= $(INSTALL_TOP)/bin
- INSTALL_INC= $(INSTALL_TOP)/include
+-INSTALL_INC= $(INSTALL_TOP)/include
++INSTALL_INC= $(INSTALL_TOP)/include/lua-5.1
INSTALL_LIB= $(INSTALL_TOP)/lib
-INSTALL_MAN= $(INSTALL_TOP)/man/man1
+INSTALL_MAN= $(INSTALL_TOP)/${PKGMANDIR}/man1
@@ -25,16 +26,19 @@ $NetBSD: patch-aa,v 1.1 2013/10/30 06:18:10 dholland Exp $
#
# If you don't have install you can use cp instead.
# INSTALL= cp -p
-@@ -43,7 +43,7 @@ PLATS= aix ansi bsd freebsd generic linu
+@@ -41,9 +41,9 @@ RANLIB= ranlib
+ PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
+
# What to install.
- TO_BIN= lua luac
+-TO_BIN= lua luac
++TO_BIN= lua5.1 luac5.1
TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp
-TO_LIB= liblua.a
-+TO_LIB= liblua.la
++TO_LIB= liblua5.1.la
TO_MAN= lua.1 luac.1
# Lua version and release.
-@@ -59,11 +59,11 @@ test: dummy
+@@ -59,11 +59,12 @@ test: dummy
src/lua test/hello.lua
install: dummy
@@ -47,7 +51,8 @@ $NetBSD: patch-aa,v 1.1 2013/10/30 06:18:10 dholland Exp $
+ cd src && $(LIBTOOL) --tag=CC --mode=install $(BSD_INSTALL_PROGRAM) $(TO_BIN) $(DESTDIR)$(INSTALL_BIN)
+ cd src && $(INSTALL_DATA) $(TO_INC) $(DESTDIR)$(INSTALL_INC)
+ cd src && $(LIBTOOL) --tag=CC --mode=install $(BSD_INSTALL_LIB) $(TO_LIB) $(DESTDIR)$(INSTALL_LIB)
-+ cd doc && $(INSTALL_DATA) $(TO_MAN) $(DESTDIR)$(INSTALL_MAN)
++ cd doc && $(INSTALL_DATA) lua.1 $(DESTDIR)$(INSTALL_MAN)/lua5.1.1
++ cd doc && $(INSTALL_DATA) luac.1 $(DESTDIR)$(INSTALL_MAN)/luac5.1.1
ranlib:
cd src && cd $(INSTALL_LIB) && $(RANLIB) $(TO_LIB)
diff --git a/lang/lua51/patches/patch-ab b/lang/lua51/patches/patch-ab
index 320d7e6b283..222e51becf0 100644
--- a/lang/lua51/patches/patch-ab
+++ b/lang/lua51/patches/patch-ab
@@ -1,4 +1,4 @@
-$NetBSD: patch-ab,v 1.1 2013/10/30 06:18:10 dholland Exp $
+$NetBSD: patch-ab,v 1.2 2014/05/03 13:00:44 alnsn Exp $
--- src/Makefile.orig 2012-02-13 20:41:22.000000000 +0000
+++ src/Makefile
@@ -28,8 +28,8 @@ $NetBSD: patch-ab,v 1.1 2013/10/30 06:18:10 dholland Exp $
-LUA_A= liblua.a
-CORE_O= lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \
-+LUA_XA= liblua.a
-+LUA_A= liblua.la
++LUA_XA= liblua5.1.a
++LUA_A= liblua5.1.la
+XCORE_O= lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \
lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o \
lundump.o lvm.o lzio.o
@@ -39,13 +39,16 @@ $NetBSD: patch-ab,v 1.1 2013/10/30 06:18:10 dholland Exp $
+CORE_O= $(XCORE_O:.o=.lo)
+LIB_O= $(XLIB_O:.o=.lo)
- LUA_T= lua
+-LUA_T= lua
-LUA_O= lua.o
+-
+-LUAC_T= luac
+-LUAC_O= luac.o print.o
++LUA_T= lua5.1
+LUA_XO= lua.o
+LUA_O= $(LUA_XO:.o=.lo)
-
- LUAC_T= luac
--LUAC_O= luac.o print.o
++
++LUAC_T= luac5.1
+LUAC_XO= luac.o print.o
+LUAC_O= $(LUAC_XO:.o=.lo)
diff --git a/lang/lua51/patches/patch-etc_lua.pc b/lang/lua51/patches/patch-etc_lua.pc
new file mode 100644
index 00000000000..84595333a53
--- /dev/null
+++ b/lang/lua51/patches/patch-etc_lua.pc
@@ -0,0 +1,13 @@
+$NetBSD: patch-etc_lua.pc,v 1.1 2014/05/03 13:00:44 alnsn Exp $
+
+--- etc/lua.pc.orig 2014-04-18 14:08:28.000000000 +0000
++++ etc/lua.pc
+@@ -19,7 +19,7 @@ INSTALL_CMOD= ${prefix}/lib/lua/${V}
+ # canonical vars
+ exec_prefix=${prefix}
+ libdir=${exec_prefix}/lib
+-includedir=${prefix}/include
++includedir=${prefix}/include/lua-5.1
+
+ Name: Lua
+ Description: An Extensible Extension Language
diff --git a/lang/lua52/Makefile b/lang/lua52/Makefile
index 387eb791e2f..cd2744c2b36 100644
--- a/lang/lua52/Makefile
+++ b/lang/lua52/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2013/10/30 06:18:10 dholland Exp $
+# $NetBSD: Makefile,v 1.2 2014/05/03 13:00:45 alnsn Exp $
DISTNAME= lua-${LUA_VERSION}
PKGNAME= lua52-${LUA_VERSION}
@@ -25,7 +25,7 @@ MAKE_ENV+= INSTALL_DATA=${INSTALL_DATA:Q}
CFLAGS+= -DLUA_ROOT=\"${PREFIX}/\"
PKGCONFIG_OVERRIDE= ${WRKSRC}/lua.pc
-INSTALLATION_DIRS+= lib/pkgconfig share/doc/lua
+INSTALLATION_DIRS+= lib/pkgconfig share/doc/lua-5.2
.if ${OPSYS} == "FreeBSD"
BUILD_TARGET= freebsd
@@ -43,16 +43,21 @@ BUILD_TARGET= aix
BUILD_TARGET= generic
.endif
+DOCDIR= ${PREFIX}/share/doc/lua-5.2
+
pre-configure:
sed -e 's,@PREFIX@,${PREFIX},g' \
-e 's,@VER@,${PKGVERSION_NOREV:R},g' \
-e 's,@REV@,${PKGVERSION_NOREV},g' \
${FILESDIR}/lua.pc.in > ${WRKSRC}/lua.pc
+ cp ${WRKSRC}/doc/lua.1 ${WRKSRC}/doc/lua5.2.1
+ cp ${WRKSRC}/doc/luac.1 ${WRKSRC}/doc/luac5.2.1
post-install:
- ${INSTALL_DATA} ${WRKSRC}/lua.pc ${DESTDIR}${PREFIX}/lib/pkgconfig
- ${INSTALL_DATA} ${WRKSRC}/doc/*.??? ${DESTDIR}${PREFIX}/share/doc/lua
- ${INSTALL_DATA} ${WRKSRC}/doc/*.???? ${DESTDIR}${PREFIX}/share/doc/lua
+ ${INSTALL_DATA} ${WRKSRC}/doc/*.[a-z][a-z][a-z] \
+ ${WRKSRC}/doc/*.html ${DESTDIR}${DOCDIR}
+ ${INSTALL_DATA} ${WRKSRC}/lua.pc \
+ ${DESTDIR}${PREFIX}/lib/pkgconfig/lua-5.2.pc
.include "../../mk/readline.buildlink3.mk"
.include "../../mk/dlopen.buildlink3.mk"
diff --git a/lang/lua52/PLIST b/lang/lua52/PLIST
index 6a5e8ad82a7..83c23b3fe55 100644
--- a/lang/lua52/PLIST
+++ b/lang/lua52/PLIST
@@ -1,21 +1,21 @@
-@comment $NetBSD: PLIST,v 1.1 2013/10/30 06:18:10 dholland Exp $
-bin/lua
-bin/luac
-include/lauxlib.h
-include/lua.h
-include/lua.hpp
-include/luaconf.h
-include/lualib.h
-lib/liblua.la
-lib/pkgconfig/lua.pc
-man/man1/lua.1
-man/man1/luac.1
-share/doc/lua/contents.html
-share/doc/lua/logo.gif
-share/doc/lua/lua.css
-share/doc/lua/manual.css
-share/doc/lua/manual.html
-share/doc/lua/osi-certified-72x60.png
-share/doc/lua/readme.html
+@comment $NetBSD: PLIST,v 1.2 2014/05/03 13:00:45 alnsn Exp $
+bin/lua5.2
+bin/luac5.2
+include/lua-5.2/lauxlib.h
+include/lua-5.2/lua.h
+include/lua-5.2/lua.hpp
+include/lua-5.2/luaconf.h
+include/lua-5.2/lualib.h
+lib/liblua5.2.la
+lib/pkgconfig/lua-5.2.pc
+man/man1/lua5.2.1
+man/man1/luac5.2.1
+share/doc/lua-5.2/contents.html
+share/doc/lua-5.2/logo.gif
+share/doc/lua-5.2/lua.css
+share/doc/lua-5.2/manual.css
+share/doc/lua-5.2/manual.html
+share/doc/lua-5.2/osi-certified-72x60.png
+share/doc/lua-5.2/readme.html
@pkgdir share/lua/5.2
@pkgdir lib/lua/5.2
diff --git a/lang/lua52/buildlink3.mk b/lang/lua52/buildlink3.mk
index 101431e59cd..d5545b67ffa 100644
--- a/lang/lua52/buildlink3.mk
+++ b/lang/lua52/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.2 2013/10/30 09:02:06 obache Exp $
+# $NetBSD: buildlink3.mk,v 1.3 2014/05/03 13:00:45 alnsn Exp $
BUILDLINK_TREE+= lua52
@@ -8,6 +8,16 @@ LUA52_BUILDLINK3_MK:=
BUILDLINK_API_DEPENDS.lua52+= lua52>=5.2.0<5.3
BUILDLINK_PKGSRCDIR.lua52?= ../../lang/lua52
+.if defined(BUILDLINK_DEPMETHOD.lua)
+BUILDLINK_DEPMETHOD.lua52?= ${BUILDLINK_DEPMETHOD.lua}
+.endif
+
+# -llua -> -llua5.2
+BUILDLINK_TRANSFORM+= l:lua:lua5.2
+BUILDLINK_INCDIRS.lua52+= include/lua-5.2
+
+BUILDLINK_FNAME_TRANSFORM.lua52+= -e 's|lib/pkgconfig/lua-5.2.pc|lib/pkgconfig/lua.pc|'
+
.include "../../mk/readline.buildlink3.mk"
.endif # LUA52_BUILDLINK3_MK
diff --git a/lang/lua52/distinfo b/lang/lua52/distinfo
index 9d578966513..8e59e889eae 100644
--- a/lang/lua52/distinfo
+++ b/lang/lua52/distinfo
@@ -1,8 +1,8 @@
-$NetBSD: distinfo,v 1.2 2014/01/02 19:57:39 wiz Exp $
+$NetBSD: distinfo,v 1.3 2014/05/03 13:00:45 alnsn Exp $
SHA1 (lua-5.2.3.tar.gz) = 926b7907bc8d274e063d42804666b40a3f3c124c
RMD160 (lua-5.2.3.tar.gz) = b8714669c8c0f8272104effd8a9675921ddb2fa5
Size (lua-5.2.3.tar.gz) = 251195 bytes
-SHA1 (patch-aa) = 5fa5c7fecc7fd50dc9d88d441ad9373f59ecb841
-SHA1 (patch-ab) = 4f2f05f6a5e4cfffe8f9ef7bf4de6f054074baa4
+SHA1 (patch-aa) = ce0763ed1515f670b8a5d543af3753320cf06309
+SHA1 (patch-ab) = 92f711427090021d89b8fcb1d3633ca6300c830d
SHA1 (patch-ac) = b8b9c0068210795e5eb22512767ac2e98bca8cbc
diff --git a/lang/lua52/files/lua.pc.in b/lang/lua52/files/lua.pc.in
index 787d06f6d8d..f290c3d0485 100644
--- a/lang/lua52/files/lua.pc.in
+++ b/lang/lua52/files/lua.pc.in
@@ -1,4 +1,4 @@
-# $NetBSD: lua.pc.in,v 1.1 2013/10/30 06:18:10 dholland Exp $
+# $NetBSD: lua.pc.in,v 1.2 2014/05/03 13:00:45 alnsn Exp $
# lua.pc is not any longer distributed, but is still required by other packages.
prefix= @PREFIX@
@@ -11,11 +11,11 @@ INSTALL_CMOD= ${prefix}/lib/lua/@VER@
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
-includedir=${prefix}/include
+includedir=${prefix}/include/lua-5.2
Name: Lua
Description: An Extensible Extension Language
Version: @REV@
Requires:
-Libs: -L${libdir} -llua -lm
+Libs: -L${libdir} -llua5.2 -lm
Cflags: -I${includedir}
diff --git a/lang/lua52/patches/patch-aa b/lang/lua52/patches/patch-aa
index 66315e4a442..c4e982656ff 100644
--- a/lang/lua52/patches/patch-aa
+++ b/lang/lua52/patches/patch-aa
@@ -1,6 +1,6 @@
-$NetBSD: patch-aa,v 1.1 2013/10/30 06:18:10 dholland Exp $
+$NetBSD: patch-aa,v 1.2 2014/05/03 13:00:45 alnsn Exp $
---- Makefile.orig 2012-05-17 14:05:54.000000000 +0000
+--- Makefile.orig 2013-11-10 00:49:35.000000000 +0000
+++ Makefile
@@ -10,11 +10,11 @@ PLAT= none
# so take care if INSTALL_TOP is not an absolute path. See the local target.
@@ -9,7 +9,8 @@ $NetBSD: patch-aa,v 1.1 2013/10/30 06:18:10 dholland Exp $
-INSTALL_TOP= /usr/local
+INSTALL_TOP= ${PREFIX}
INSTALL_BIN= $(INSTALL_TOP)/bin
- INSTALL_INC= $(INSTALL_TOP)/include
+-INSTALL_INC= $(INSTALL_TOP)/include
++INSTALL_INC= $(INSTALL_TOP)/include/lua-5.2
INSTALL_LIB= $(INSTALL_TOP)/lib
-INSTALL_MAN= $(INSTALL_TOP)/man/man1
+INSTALL_MAN= $(INSTALL_TOP)/${PKGMANDIR}/man1
@@ -25,15 +26,20 @@ $NetBSD: patch-aa,v 1.1 2013/10/30 06:18:10 dholland Exp $
#
# If you don't have "install" you can use "cp" instead.
# INSTALL= cp -p
-@@ -41,7 +41,7 @@ PLATS= aix ansi bsd freebsd generic linu
+@@ -39,10 +39,10 @@ RM= rm -f
+ PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
+
# What to install.
- TO_BIN= lua luac
+-TO_BIN= lua luac
++TO_BIN= lua5.2 luac5.2
TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
-TO_LIB= liblua.a
-+TO_LIB= liblua.la
- TO_MAN= lua.1 luac.1
+-TO_MAN= lua.1 luac.1
++TO_LIB= liblua5.2.la
++TO_MAN= lua5.2.1 luac5.2.1
# Lua version and release.
+ V= 5.2
@@ -58,11 +58,11 @@ test: dummy
src/lua -v
diff --git a/lang/lua52/patches/patch-ab b/lang/lua52/patches/patch-ab
index f07b7a55f87..02750b89b07 100644
--- a/lang/lua52/patches/patch-ab
+++ b/lang/lua52/patches/patch-ab
@@ -1,6 +1,6 @@
-$NetBSD: patch-ab,v 1.1 2013/10/30 06:18:10 dholland Exp $
+$NetBSD: patch-ab,v 1.2 2014/05/03 13:00:45 alnsn Exp $
---- src/Makefile.orig 2012-12-27 10:51:43.000000000 +0000
+--- src/Makefile.orig 2013-11-11 11:45:49.000000000 +0000
+++ src/Makefile
@@ -6,8 +6,7 @@
# Your platform. See PLATS for possible values.
@@ -26,7 +26,7 @@ $NetBSD: patch-ab,v 1.1 2013/10/30 06:18:10 dholland Exp $
PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
-LUA_A= liblua.a
-+LUA_A= liblua.la
++LUA_A= liblua5.2.la
CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \
lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o \
ltm.o lundump.o lvm.o lzio.o
@@ -35,12 +35,14 @@ $NetBSD: patch-ab,v 1.1 2013/10/30 06:18:10 dholland Exp $
-BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
+BASE_O= $(CORE_O:.o=.lo) $(LIB_O:.o=.lo) $(MYOBJS:.o=.lo)
- LUA_T= lua
+-LUA_T= lua
-LUA_O= lua.o
++LUA_T= lua5.2
+LUA_O= lua.lo
- LUAC_T= luac
+-LUAC_T= luac
-LUAC_O= luac.o
++LUAC_T= luac5.2
+LUAC_O= luac.lo
ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)