1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-21 08:42:23 +00:00

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
This commit is contained in:
Baptiste Daroussin 2015-01-17 02:19:59 +00:00
parent f5bc29b921
commit 6a4dc8a394
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=377213
9 changed files with 202 additions and 4 deletions

View File

@ -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_VERSION}
#
# 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
#

View File

@ -137,6 +137,7 @@
SUBDIR += lua-mode.el
SUBDIR += lua51
SUBDIR += lua52
SUBDIR += lua53
SUBDIR += luajit
SUBDIR += malbolge
SUBDIR += maude

80
lang/lua53/Makefile Normal file
View File

@ -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>

2
lang/lua53/distinfo Normal file
View File

@ -0,0 +1,2 @@
SHA256 (lua-5.3.0.tar.gz) = ae4a5eb2d660515eb191bfe3e061f2b8ffe94dce73d32cfd0de090ddcc0ddb01
SIZE (lua-5.3.0.tar.gz) = 278045

View File

@ -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}

View File

@ -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)

View File

@ -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

21
lang/lua53/pkg-descr Normal file
View File

@ -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/

14
lang/lua53/pkg-plist Normal file
View File

@ -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