From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 37B92158094 for ; Mon, 5 Sep 2022 14:47:01 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7C200E0845; Mon, 5 Sep 2022 14:47:00 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5FFC2E0845 for ; Mon, 5 Sep 2022 14:47:00 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2DB89340B9C for ; Mon, 5 Sep 2022 14:46:59 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id BDBED5B2 for ; Mon, 5 Sep 2022 14:46:57 +0000 (UTC) From: "David Seifert" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "David Seifert" Message-ID: <1662389145.ed8a6d784aea561e5e2af33a70f800c6bb570bf9.soap@gentoo> Subject: [gentoo-commits] proj/lua-patches:5.3.6 commit in: doc/, src/, / X-VCS-Repository: proj/lua-patches X-VCS-Files: Makefile.am configure.ac doc/lua.1 doc/lua5.3.1 doc/luac.1 doc/luac5.3.1 src/lopcodes.c src/lopcodes.h src/lua5.3.pc.in src/luaconf.h src/luaconf.h.in src/lundump.h test-wrapper.sh X-VCS-Directories: doc/ src/ / X-VCS-Committer: soap X-VCS-Committer-Name: David Seifert X-VCS-Revision: ed8a6d784aea561e5e2af33a70f800c6bb570bf9 X-VCS-Branch: 5.3.6 Date: Mon, 5 Sep 2022 14:46:57 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: bc0a6267-50a0-449d-a563-c5230ecfe5ed X-Archives-Hash: 473b99627cac7ba74fca31e0a4c28df1 commit: ed8a6d784aea561e5e2af33a70f800c6bb570bf9 Author: David Seifert gentoo org> AuthorDate: Mon Sep 5 14:45:45 2022 +0000 Commit: David Seifert gentoo org> CommitDate: Mon Sep 5 14:45:45 2022 +0000 URL: https://gitweb.gentoo.org/proj/lua-patches.git/commit/?id=ed8a6d78 Add Autotools * inspired by Fedora's patches, but mostly rewritten for Gentoo's multi-versioned approach. Signed-off-by: David Seifert gentoo.org> Makefile.am | 73 +++++++++++++++++++++++++++++++++++++++++ configure.ac | 49 +++++++++++++++++++++++++++ doc/{lua.1 => lua5.3.1} | 0 doc/{luac.1 => luac5.3.1} | 0 src/lopcodes.c | 4 +-- src/lopcodes.h | 4 +-- src/lua5.3.pc.in | 18 ++++++++++ src/{luaconf.h => luaconf.h.in} | 8 ++--- src/lundump.h | 2 +- test-wrapper.sh | 13 ++++++++ 10 files changed, 161 insertions(+), 10 deletions(-) diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..c412322 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,73 @@ +######## +# doc/ # +######## + +dist_doc_DATA = README +dist_man1_MANS = doc/lua5.3.1 doc/luac5.3.1 +dist_html_DATA = \ + doc/contents.html doc/index.css doc/logo.gif doc/lua.css doc/manual.css \ + doc/manual.html doc/osi-certified-72x60.png doc/readme.html + +######## +# src/ # +######## + +AM_CFLAGS = -Wall +AM_CPPFLAGS = -I$(builddir)/src # for luaconf.h + +luadir = $(includedir)/lua5.3 +lua_HEADERS = src/lua.h src/lualib.h src/lauxlib.h src/lua.hpp +nodist_lua_HEADERS = src/luaconf.h + +lib_LTLIBRARIES = src/liblua5.3.la +src_liblua5_3_la_LIBADD = $(LIBM) +src_liblua5_3_la_SOURCES = \ + src/lapi.c src/lapi.h src/lauxlib.c src/lbaselib.c src/lcode.c src/lcode.h \ + src/lcorolib.c src/lctype.c src/lctype.h src/ldblib.c src/ldebug.c \ + src/ldebug.h src/ldo.c src/ldo.h src/ldump.c src/lfunc.c src/lfunc.h \ + src/lgc.c src/lbitlib.c src/lgc.h src/linit.c src/liolib.c src/llex.c \ + src/llex.h src/llimits.h src/lmathlib.c src/lmem.c src/lmem.h src/loadlib.c \ + src/lobject.c src/lobject.h src/lopcodes.c src/lopcodes.h \ + src/loslib.c src/lparser.c src/lparser.h src/lprefix.h src/lstate.c \ + src/lstate.h src/lstring.c src/lstring.h src/lstrlib.c src/ltable.c \ + src/ltable.h src/ltablib.c src/ltm.c src/ltm.h src/lundump.c src/lundump.h \ + src/lutf8lib.c src/lvm.c src/lvm.h src/lzio.c src/lzio.h + +bin_PROGRAMS = lua5.3 luac5.3 + +lua5_3_SOURCES = src/lua.c +lua5_3_CPPFLAGS = $(AM_CPPFLAGS) $(READLINE_CFLAGS) +lua5_3_LDADD = src/liblua5.3.la $(READLINE_LIBS) + +luac5_3_SOURCES = src/luac.c +luac5_3_LDADD = src/liblua5.3.la + +EXTRA_DIST = src/luaconf.h.in +BUILT_SOURCES = src/luaconf.h +CLEANFILES = $(BUILT_SOURCES) + +pkgconfig_DATA = src/lua5.3.pc + +edit = $(SED) \ + -e 's,@prefix[@],$(prefix),g' \ + -e 's,@datadir[@],$(datadir),g' \ + -e 's,@libdir[@],$(libdir),g' + +src/luaconf.h: $(srcdir)/src/luaconf.h.in + rm -f $@ && $(edit) $(srcdir)/src/luaconf.h.in >$@ + +########## +# tests/ # +########## + +TESTS = tests/all.lua +TESTS_ENVIRONMENT = env LUA=$(abs_builddir)/lua5.3 $(abs_srcdir)/test-wrapper.sh + +EXTRA_DIST += test-wrapper.sh \ + tests/all.lua tests/api.lua tests/attrib.lua tests/big.lua tests/bitwise.lua \ + tests/calls.lua tests/closure.lua tests/code.lua tests/constructs.lua \ + tests/coroutine.lua tests/db.lua tests/errors.lua tests/events.lua \ + tests/files.lua tests/gc.lua tests/goto.lua tests/literals.lua \ + tests/locals.lua tests/main.lua tests/math.lua tests/nextvar.lua \ + tests/pm.lua tests/sort.lua tests/strings.lua tests/tpack.lua tests/utf8.lua \ + tests/vararg.lua tests/verybig.lua diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..94c6f02 --- /dev/null +++ b/configure.ac @@ -0,0 +1,49 @@ +AC_PREREQ([2.69]) +AC_INIT([lua5.3], [5.3.6], [https://bugs.gentoo.org/], [lua], [http://www.lua.org]) + +AC_CONFIG_SRCDIR([src/lapi.c]) +AC_CONFIG_MACRO_DIR([m4]) + +AM_INIT_AUTOMAKE([1.15 foreign dist-xz no-dist-gzip serial-tests subdir-objects -Wall]) + +AC_PROG_CC +AC_PROG_SED +AM_PROG_AR +LT_INIT([disable-static]) +LT_LIB_M + +PKG_INSTALLDIR + +AC_ARG_WITH([readline], + [AS_HELP_STRING([--with-readline], [Use readline for interpreter input [default=yes]])]) + +# Check for readline +AS_IF([test "x$with_readline" != "xno"], [ + PKG_CHECK_MODULES([READLINE], [readline]) + AC_DEFINE([LUA_USE_READLINE], [1], [Building with readline support]) + READLINE_REQUIRES_PRIVATE=readline +]) +AC_SUBST([READLINE_REQUIRES_PRIVATE]) + +AS_CASE([${host}], + [*-mingw*], [ + AC_DEFINE([LUA_BUILD_AS_DLL], [1], [Building a DLL under Win32]) + ], + [*-darwin*], [ + AC_DEFINE([LUA_USE_MACOSX], [1], [Use macOS routines]) + ], + [*-linux*], [ + AC_DEFINE([LUA_USE_LINUX], [1], [Use Linux routines]) + AC_SEARCH_LIBS([dlopen], [dl dld], [], [ + AC_MSG_ERROR([unable to find the dlopen() function]) + ]) + ], [ + AC_DEFINE([LUA_USE_POSIX], [1], [Use POSIX routines]) + AC_SEARCH_LIBS([dlopen], [dl dld], [], [ + AC_MSG_ERROR([unable to find the dlopen() function]) + ]) + ] +) + +AC_CONFIG_FILES([Makefile src/lua5.3.pc]) +AC_OUTPUT diff --git a/doc/lua.1 b/doc/lua5.3.1 similarity index 100% rename from doc/lua.1 rename to doc/lua5.3.1 diff --git a/doc/luac.1 b/doc/luac5.3.1 similarity index 100% rename from doc/luac.1 rename to doc/luac5.3.1 diff --git a/src/lopcodes.c b/src/lopcodes.c index 5ca3eb2..3bb4701 100644 --- a/src/lopcodes.c +++ b/src/lopcodes.c @@ -17,7 +17,7 @@ /* ORDER OP */ -LUAI_DDEF const char *const luaP_opnames[NUM_OPCODES+1] = { +const char *const luaP_opnames[NUM_OPCODES+1] = { "MOVE", "LOADK", "LOADKX", @@ -71,7 +71,7 @@ LUAI_DDEF const char *const luaP_opnames[NUM_OPCODES+1] = { #define opmode(t,a,b,c,m) (((t)<<7) | ((a)<<6) | ((b)<<4) | ((c)<<2) | (m)) -LUAI_DDEF const lu_byte luaP_opmodes[NUM_OPCODES] = { +const lu_byte luaP_opmodes[NUM_OPCODES] = { /* T A B C mode opcode */ opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_MOVE */ ,opmode(0, 1, OpArgK, OpArgN, iABx) /* OP_LOADK */ diff --git a/src/lopcodes.h b/src/lopcodes.h index 6feaa1c..fae3e1f 100644 --- a/src/lopcodes.h +++ b/src/lopcodes.h @@ -278,7 +278,7 @@ enum OpArgMask { OpArgK /* argument is a constant or register/constant */ }; -LUAI_DDEC const lu_byte luaP_opmodes[NUM_OPCODES]; +extern const lu_byte luaP_opmodes[NUM_OPCODES]; #define getOpMode(m) (cast(enum OpMode, luaP_opmodes[m] & 3)) #define getBMode(m) (cast(enum OpArgMask, (luaP_opmodes[m] >> 4) & 3)) @@ -287,7 +287,7 @@ LUAI_DDEC const lu_byte luaP_opmodes[NUM_OPCODES]; #define testTMode(m) (luaP_opmodes[m] & (1 << 7)) -LUAI_DDEC const char *const luaP_opnames[NUM_OPCODES+1]; /* opcode names */ +extern const char *const luaP_opnames[NUM_OPCODES+1]; /* opcode names */ /* number of list items to accumulate before a SETLIST instruction */ diff --git a/src/lua5.3.pc.in b/src/lua5.3.pc.in new file mode 100644 index 0000000..ab8c88f --- /dev/null +++ b/src/lua5.3.pc.in @@ -0,0 +1,18 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@/lua5.3 +datarootdir=@datarootdir@ +datadir=@datadir@ + +Name: Lua +Description: An Extensible Extension Language +Version: @PACKAGE_VERSION@ +Requires.private: @READLINE_REQUIRES_PRIVATE@ +Libs: -L${libdir} -llua5.3 +Libs.private: @LIBM@ @LIBS@ +Cflags: -I${includedir} + +# information required by lua-utils.eclass::_lua_export +INSTALL_LMOD=${datadir}/lua/5.3 +INSTALL_CMOD=${libdir}/lua/5.3 diff --git a/src/luaconf.h b/src/luaconf.h.in similarity index 98% rename from src/luaconf.h rename to src/luaconf.h.in index 9eeeea6..9865a76 100644 --- a/src/luaconf.h +++ b/src/luaconf.h.in @@ -61,14 +61,12 @@ #if defined(LUA_USE_LINUX) #define LUA_USE_POSIX #define LUA_USE_DLOPEN /* needs an extra library: -ldl */ -#define LUA_USE_READLINE /* needs some extra libraries */ #endif #if defined(LUA_USE_MACOSX) #define LUA_USE_POSIX #define LUA_USE_DLOPEN /* MacOS does not need -ldl */ -#define LUA_USE_READLINE /* needs an extra library: -lreadline */ #endif @@ -200,9 +198,9 @@ #else /* }{ */ -#define LUA_ROOT "/usr/local/" -#define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR "/" -#define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR "/" +#define LUA_ROOT "@prefix@/" +#define LUA_LDIR "@datadir@/lua/" LUA_VDIR "/" +#define LUA_CDIR "@libdir@/lua/" LUA_VDIR "/" #define LUA_PATH_DEFAULT \ LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \ LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" \ diff --git a/src/lundump.h b/src/lundump.h index ce492d6..c6485fe 100644 --- a/src/lundump.h +++ b/src/lundump.h @@ -26,7 +26,7 @@ LUAI_FUNC LClosure* luaU_undump (lua_State* L, ZIO* Z, const char* name); /* dump one chunk; from ldump.c */ -LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, +int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip); #endif diff --git a/test-wrapper.sh b/test-wrapper.sh new file mode 100755 index 0000000..57320d6 --- /dev/null +++ b/test-wrapper.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env sh +set -e + +# https://www.lua.org/tests/ +# There are two sets: +# 1. basic +# 2. complete +# +# The basic subset is selected by passing -e'_U=true' +# The complete set is noted to contain tests that may consume too much memory or have non-portable tests. +# attrib.lua for example needs some multilib customization (have to compile the stuff in libs/ for each ABI) + +cd "${srcdir}"/tests && "${LUA}" -e_U=true $(basename ${1})