Index: Makefile =================================================================== --- Makefile +++ Makefile @@ -3,17 +3,16 @@ PORTNAME= lua PORTVERSION= 5.3.4 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= lang MASTER_SITES= http://www.lua.org/ftp/ PKGNAMESUFFIX= 53 MAINTAINER= russ.haley@gmail.com -COMMENT= Small, compilable scripting language providing easy access to C code +COMMENT= Small, embeddable scripting language providing easy access to C code LICENSE= MIT -USES= libedit LUA_VER= 5.3 USE_LDCONFIG= yes @@ -24,57 +23,39 @@ # 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 \ +LUA_CMD = ${PORTNAME}${PKGNAMESUFFIX} +LUAC_CMD = ${PORTNAME}c${PKGNAMESUFFIX} +LUA_LIB_STATIC=liblua-${LUA_VER}.a +LUA_LIB_SHARED=liblua-${LUA_VER}.so +LUA_PC_FILE=${PORTNAME}-${LUA_VER}.pc +ALL_TARGET=freebsd +MAKE_ARGS+= CC="${CC}" \ + LUA_T=${LUA_CMD}\ + LUAC_T=${LUAC_CMD} \ + LUA_A=${LUA_LIB_STATIC} \ + LUA_SO=${LUA_LIB_SHARED} \ + LUA_SONAME=${LUA_LIB_SHARED} \ + TO_BIN="${LUA_CMD} ${LUAC_CMD}" \ + TO_LIB="${LUA_LIB_SHARED} ${LUA_LIB_STATIC}" \ + INSTALL_TOP=${STAGEDIR}${PREFIX} \ + INSTALL_INC=${STAGEDIR}${PREFIX}/include/${PORTNAME}${PKGNAMESUFFIX} \ 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_FILES= ${LUA_PC_FILE} SUB_LIST= version=${PORTVERSION} \ includedir=${LUA_INCDIR} \ libdir=${LUA_LIBDIR} \ - soname=lua-${LUA_VER} + soname=${PORTNAME}-${LUA_VER} -CFLAGS+= -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 ${WRKSRC}/src/lua.c - post-install: - @${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/liblua-${LUA_VER}.so + @${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/${LUA_LIB_SHARED} @${MV} ${STAGEDIR}${PREFIX}/man/man1/lua.1 \ - ${STAGEDIR}${PREFIX}/man/man1/lua53.1 + ${STAGEDIR}${PREFIX}/man/man1/${LUA_CMD}.1 @${MV} ${STAGEDIR}${PREFIX}/man/man1/luac.1 \ - ${STAGEDIR}${PREFIX}/man/man1/luac53.1 - ${INSTALL_DATA} ${WRKDIR}/lua-${LUA_VER}.pc \ + ${STAGEDIR}${PREFIX}/man/man1/${LUAC_CMD}.1 + ${INSTALL_DATA} ${WRKDIR}/${LUA_PC_FILE} \ ${STAGEDIR}${PREFIX}/libdata/pkgconfig .include Index: files/patch-src__Makefile =================================================================== --- files/patch-src__Makefile +++ files/patch-src__Makefile @@ -1,4 +1,4 @@ ---- src/Makefile.orig 2015-01-05 16:04:52 UTC +--- src/Makefile.orig 2015-05-27 11:10:11 UTC +++ src/Makefile @@ -6,12 +6,12 @@ # Your platform. See PLATS for possible values. @@ -55,3 +55,12 @@ $(RANLIB) $@ $(LUA_T): $(LUA_O) $(LUA_A) +@@ -102,7 +106,7 @@ c89: + + + freebsd: +- $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -lreadline" ++ $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -fPIC" SYSLIBS="-Wl,-E -ledit" + + generic: $(ALL) + Index: files/patch-src__ldebug.c =================================================================== --- files/patch-src__ldebug.c +++ files/patch-src__ldebug.c @@ -1,6 +1,6 @@ --- src/ldebug.c.orig 2016-10-19 12:32:10 UTC +++ src/ldebug.c -@@ -653,6 +653,7 @@ l_noret luaG_runerror (lua_State *L, const char *fmt, +@@ -653,6 +653,7 @@ l_noret luaG_runerror (lua_State *L, con CallInfo *ci = L->ci; const char *msg; va_list argp; Index: files/patch-src__lgc.c =================================================================== --- files/patch-src__lgc.c +++ files/patch-src__lgc.c @@ -1,6 +1,6 @@ --- src/lgc.c.orig 2016-12-22 13:08:50 UTC +++ src/lgc.c -@@ -643,8 +643,9 @@ static void clearkeys (global_State *g, GCObject *l, G +@@ -643,8 +643,9 @@ static void clearkeys (global_State *g, for (n = gnode(h, 0); n < limit; n++) { if (!ttisnil(gval(n)) && (iscleared(g, gkey(n)))) { setnilvalue(gval(n)); /* remove value ... */ Index: files/patch-src__liolib.c =================================================================== --- files/patch-src__liolib.c +++ files/patch-src__liolib.c @@ -1,4 +1,4 @@ ---- src/liolib.c.orig 2015-04-03 18:41:57 UTC +--- src/liolib.c.orig 2016-12-20 18:37:00 UTC +++ src/liolib.c @@ -16,6 +16,7 @@ #include Index: files/patch-src__lparser.c =================================================================== --- files/patch-src__lparser.c +++ files/patch-src__lparser.c @@ -1,6 +1,6 @@ --- src/lparser.c.orig 2016-08-01 19:51:24 UTC +++ src/lparser.c -@@ -1392,7 +1392,7 @@ static void test_then_block (LexState *ls, int *escape +@@ -1392,7 +1392,7 @@ static void test_then_block (LexState *l luaK_goiffalse(ls->fs, &v); /* will jump to label if condition is true */ enterblock(fs, &bl, 0); /* must enter block before 'goto' */ gotostat(ls, v.t); /* handle goto/break */ Index: files/patch-src_lua.c =================================================================== --- files/patch-src_lua.c +++ files/patch-src_lua.c @@ -0,0 +1,12 @@ +--- src/lua.c.orig 2017-01-12 17:14:26 UTC ++++ src/lua.c +@@ -79,8 +79,7 @@ + + #if defined(LUA_USE_READLINE) /* { */ + +-#include +-#include ++#include + #define lua_readline(L,b,p) ((void)L, ((b)=readline(p)) != NULL) + #define lua_saveline(L,line) ((void)L, add_history(line)) + #define lua_freeline(L,b) ((void)L, free(b))