Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Jan 2015 02:19:59 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r377213 - in head: Mk/Uses lang lang/lua53 lang/lua53/files
Message-ID:  <201501170219.t0H2JxRY039343@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Sat Jan 17 02:19:59 2015
New Revision: 377213
URL: https://svnweb.freebsd.org/changeset/ports/377213
QAT: https://qat.redports.org/buildarchive/r377213/

Log:
  Add lua 5.3.0
  Highlights from this new version:
  Main new features are support for integers, bitwise operators, and a basic utf-8
  library
  
  Complete list of changes: http://www.lua.org/manual/5.3/readme.html#changes
  List of incompatibilities with lua 5.2:
  http://www.lua.org/manual/5.3/manual.html#8

Added:
  head/lang/lua53/
  head/lang/lua53/Makefile   (contents, props changed)
  head/lang/lua53/distinfo   (contents, props changed)
  head/lang/lua53/files/
  head/lang/lua53/files/lua-5.3.pc.in   (contents, props changed)
  head/lang/lua53/files/patch-src__Makefile   (contents, props changed)
  head/lang/lua53/files/patch-src__liolib.c   (contents, props changed)
  head/lang/lua53/pkg-descr   (contents, props changed)
  head/lang/lua53/pkg-plist   (contents, props changed)
Modified:
  head/Mk/Uses/lua.mk
  head/lang/Makefile

Modified: head/Mk/Uses/lua.mk
==============================================================================
--- head/Mk/Uses/lua.mk	Sat Jan 17 02:00:44 2015	(r377212)
+++ head/Mk/Uses/lua.mk	Sat Jan 17 02:19:59 2015	(r377213)
@@ -3,11 +3,14 @@
 # Provide support for lua
 # 
 # MAINTAINER: lua@FreeBSD.org
-
+# Usage:
+#
+# USES+=	lua:[version]
+#
 .if !defined(_INCLUDE_USES_LUA_MK)
 _INCLUDE_USES_LUA_MK=	yes
 
-_LUA_VALID_VERSIONS=	52 51
+_LUA_VALID_VERSIONS=	53 52 51
 
 .include "${PORTSDIR}/Mk/bsd.default-versions.mk"
 _LUA_DEFAULT_VERSION=	${LUA_DEFAULT:S/.//}
@@ -26,8 +29,8 @@ _LUA_WANTED_VERSION:=	${_LUA_DEFAULT_VER
 #
 # Parse one or more ver arguments
 #
-.if ${lua_ARGS:M5[1-2]}
-_LUA_WANTED_VERSIONS:=	${lua_ARGS:M5[1-2]}
+.if ${lua_ARGS:M5[1-3]}
+_LUA_WANTED_VERSIONS:=	${lua_ARGS:M5[1-3]}
 .endif
 
 #

Modified: head/lang/Makefile
==============================================================================
--- head/lang/Makefile	Sat Jan 17 02:00:44 2015	(r377212)
+++ head/lang/Makefile	Sat Jan 17 02:19:59 2015	(r377213)
@@ -137,6 +137,7 @@
     SUBDIR += lua-mode.el
     SUBDIR += lua51
     SUBDIR += lua52
+    SUBDIR += lua53
     SUBDIR += luajit
     SUBDIR += malbolge
     SUBDIR += maude

Added: head/lang/lua53/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/lua53/Makefile	Sat Jan 17 02:19:59 2015	(r377213)
@@ -0,0 +1,80 @@
+# Created by: GreenDog <fiziologus@gmail.com>
+# $FreeBSD$
+
+PORTNAME=	lua
+PORTVERSION=	5.3.0
+CATEGORIES=	lang
+MASTER_SITES=	http://www.lua.org/ftp/
+PKGNAMESUFFIX=	53
+
+MAINTAINER=	lua@FreeBSD.org
+COMMENT=	Small, compilable scripting language providing easy access to C code
+
+LICENSE=	MIT
+
+LUA_VER=	5.3
+LIB_DEPENDS=	libedit.so.0:${PORTSDIR}/devel/libedit
+USE_LDCONFIG=	yes
+
+# Overriding __MAKE_CONF makes sure that we don't re-parse
+# /etc/make.conf during do-build, which would jeopardize the build
+# if, for instance, the user set CFLAGS=mumble
+# NOTE: /etc/make.conf is read BEFORE Makefile, so we already
+# have its settings when we get here.
+# See http://wiki.freebsd.org/MatthiasAndree/LuaLessonsLearnt
+MAKE_ARGS=	__MAKE_CONF=${NONEXISTENT}
+# liblua.so requires libm, so make sure it has an explicit dependency
+# so that applications need not second-guess lua's dependencies.
+CPPFLAGS+=	-I${LOCALBASE}/include
+LDFLAGS+=	-lm -pthread
+BUILD_WRKSRC=	${WRKSRC}/src
+MAKE_ARGS+=	MYCFLAGS="${CFLAGS} ${CPPFLAGS} -DLUA_USE_LINUX" \
+		MYLDFLAGS="${LDFLAGS}" \
+		MYLIBS="-Wl,-E -L${LOCALBASE}/lib -ledit" \
+		CC="${CC}" \
+		LUA_T=lua53 \
+		LUAC_T=luac53 \
+		LUA_A=liblua-${LUA_VER}.a \
+		LUA_SO=liblua-${LUA_VER}.so \
+		LUA_SONAME=liblua-${LUA_VER}.so \
+		TO_BIN="lua53 luac53" \
+		TO_LIB="liblua-${LUA_VER}.a liblua-${LUA_VER}.so" \
+		INSTALL_TOP=${STAGEDIR}${PREFIX} \
+		INSTALL_INC=${STAGEDIR}${PREFIX}/include/lua53 \
+		INSTALL_EXEC="${INSTALL_PROGRAM}"
+
+# Cope with the lack of support for Lua 5.2 in bsd.lua.mk.  These
+# overrides, which are required below, should be removed once bsd.lua.mk
+# understands this lua version.
+LUA_PREFIX?=	${PREFIX}
+LUA_SUBDIR?=	lua${PKGNAMESUFFIX}
+LUA_INCDIR?=	${LUA_PREFIX}/include/${LUA_SUBDIR}
+LUA_LIBDIR?=	${LUA_PREFIX}/lib
+
+SUB_FILES=	lua-${LUA_VER}.pc
+SUB_LIST=	version=${PORTVERSION} \
+		includedir=${LUA_INCDIR} \
+		libdir=${LUA_LIBDIR} \
+		soname=lua-${LUA_VER}
+
+CFLAGS_amd64=	-fPIC
+CFLAGS_powerpc=	-fPIC
+
+post-patch:
+	@${REINPLACE_CMD} -e 's,rand *(,random(,g' \
+		${WRKSRC}/src/lmathlib.c
+	@${REINPLACE_CMD} -e "/LUA_ROOT/s|/usr/local|${LUA_PREFIX}| ; \
+		s,readline/,editline/,g ; \
+		/history\.h/d" \
+		${WRKSRC}/src/luaconf.h
+
+post-install:
+	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/liblua-${LUA_VER}.so
+	@${MV} ${STAGEDIR}${PREFIX}/man/man1/lua.1 \
+		${STAGEDIR}${PREFIX}/man/man1/lua53.1
+	@${MV} ${STAGEDIR}${PREFIX}/man/man1/luac.1 \
+		${STAGEDIR}${PREFIX}/man/man1/luac53.1
+	${INSTALL_DATA} ${WRKDIR}/lua-${LUA_VER}.pc \
+		${STAGEDIR}${PREFIX}/libdata/pkgconfig
+
+.include <bsd.port.mk>

Added: head/lang/lua53/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/lua53/distinfo	Sat Jan 17 02:19:59 2015	(r377213)
@@ -0,0 +1,2 @@
+SHA256 (lua-5.3.0.tar.gz) = ae4a5eb2d660515eb191bfe3e061f2b8ffe94dce73d32cfd0de090ddcc0ddb01
+SIZE (lua-5.3.0.tar.gz) = 278045

Added: head/lang/lua53/files/lua-5.3.pc.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/lua53/files/lua-5.3.pc.in	Sat Jan 17 02:19:59 2015	(r377213)
@@ -0,0 +1,10 @@
+version=%%version%%
+libdir=%%libdir%%
+includedir=%%includedir%%
+soname=%%soname%%
+
+Name: Lua
+Description: An Extensible Extension Language
+Version: ${version}
+Libs: -L${libdir} -l${soname} -lm
+Cflags: -I${includedir}

Added: head/lang/lua53/files/patch-src__Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/lua53/files/patch-src__Makefile	Sat Jan 17 02:19:59 2015	(r377213)
@@ -0,0 +1,57 @@
+--- src/Makefile.orig	2015-01-05 16:04:52 UTC
++++ src/Makefile
+@@ -6,12 +6,12 @@
+ # Your platform. See PLATS for possible values.
+ PLAT= none
+ 
+-CC= gcc -std=gnu99
+-CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS)
++CC?= gcc -std=gnu99
++CFLAGS?= -O2 -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS)
+ LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
+ LIBS= -lm $(SYSLIBS) $(MYLIBS)
+ 
+-AR= ar rcu
++AR= ar
+ RANLIB= ranlib
+ RM= rm -f
+ 
+@@ -19,8 +19,8 @@ SYSCFLAGS=
+ SYSLDFLAGS=
+ SYSLIBS=
+ 
+-MYCFLAGS=
+-MYLDFLAGS=
++MYCFLAGS?=
++MYLDFLAGS?=
+ MYLIBS=
+ MYOBJS=
+ 
+@@ -38,12 +38,13 @@ BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
+ 
+ LUA_T=	lua
+ LUA_O=	lua.o
++LUA_SO=	liblua.so
+ 
+ LUAC_T=	luac
+ LUAC_O=	luac.o
+ 
+ ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
+-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
++ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO)
+ ALL_A= $(LUA_A)
+ 
+ # Targets start here.
+@@ -55,8 +56,11 @@ o:	$(ALL_O)
+ 
+ a:	$(ALL_A)
+ 
++$(LUA_SO):	$(CORE_O) $(LIB_O)
++	$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(MYLDFLAGS) -shared -Wl,-soname=$(LUA_SONAME) $?
++
+ $(LUA_A): $(BASE_O)
+-	$(AR) $@ $(BASE_O)
++	$(AR) $(ARFLAGS) $@ $(BASE_O)
+ 	$(RANLIB) $@
+ 
+ $(LUA_T): $(LUA_O) $(LUA_A)

Added: head/lang/lua53/files/patch-src__liolib.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/lua53/files/patch-src__liolib.c	Sat Jan 17 02:19:59 2015	(r377213)
@@ -0,0 +1,10 @@
+--- ./src/liolib.c.orig	2013-01-05 22:46:54.000000000 +0100
++++ ./src/liolib.c	2013-01-05 22:47:32.000000000 +0100
+@@ -19,6 +19,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <unistd.h>
+ 
+ #define liolib_c
+ #define LUA_LIB

Added: head/lang/lua53/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/lua53/pkg-descr	Sat Jan 17 02:19:59 2015	(r377213)
@@ -0,0 +1,21 @@
+Lua is a programming language originally designed for extending applications,
+but also frequently used as a general-purpose, stand-alone language. Lua
+combines simple procedural syntax (similar to Pascal) with powerful data
+description constructs based on associative arrays and extensible semantics.
+Lua is dynamically typed, interpreted from bytecodes, and has automatic memory
+management with garbage collection, making it ideal for configuration,
+scripting, and rapid prototyping. 
+
+A fundamental concept in the design of Lua is to provide meta-mechanisms for
+implementing features, instead of providing a host of features directly in
+the language. For example, although Lua is not a pure object-oriented
+language, it does provide meta-mechanisms for implementing classes and
+inheritance. Lua's meta-mechanisms bring an economy of concepts and keep the
+language small, while allowing the semantics to be extended in unconventional
+ways. Extensible semantics is a distinguishing feature of Lua. 
+
+Lua is implemented as a small library of C functions, written in ANSI C, and
+compiles unmodified in all known platforms. The implementation goals are
+simplicity, efficiency, portability, and low embedding cost. 
+
+WWW: http://www.lua.org/

Added: head/lang/lua53/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/lua53/pkg-plist	Sat Jan 17 02:19:59 2015	(r377213)
@@ -0,0 +1,14 @@
+bin/lua53
+bin/luac53
+include/lua53/lauxlib.h
+include/lua53/lua.h
+include/lua53/lua.hpp
+include/lua53/luaconf.h
+include/lua53/lualib.h
+lib/liblua-5.3.a
+lib/liblua-5.3.so
+libdata/pkgconfig/lua-5.3.pc
+man/man1/lua53.1.gz
+man/man1/luac53.1.gz
+@dir lib/lua/5.3
+@dir %%DATADIR%%/5.3



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501170219.t0H2JxRY039343>