From 5ba464150dd161c5327216a92642dfe293efb68a Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Fri, 16 Jan 2015 10:14:21 -0500 Subject: [PATCH] lua 5.3 (with 5.2 library as to not break the whole freaking universe while we rebuild things) --- .gitignore | 1 + lua-5.2.3-autotoolize.patch | 204 ++++++++++++++++++++++++ lua-5.3.0-autotoolize.patch | 192 ++++++++++++++++++++++ lua-5.3.0-configure-compat-module.patch | 34 ++++ lua-5.3.0-idsize.patch | 12 ++ lua-5.3.0-luac-shared-link-fix.patch | 54 +++++++ lua.spec | 81 ++++++++-- sources | 1 + 8 files changed, 568 insertions(+), 11 deletions(-) create mode 100644 lua-5.2.3-autotoolize.patch create mode 100644 lua-5.3.0-autotoolize.patch create mode 100644 lua-5.3.0-configure-compat-module.patch create mode 100644 lua-5.3.0-idsize.patch create mode 100644 lua-5.3.0-luac-shared-link-fix.patch diff --git a/.gitignore b/.gitignore index 0a718cf..ea11c29 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ lua-5.1.4/ /i386/ /lua-5.2.2.tar.gz /lua-5.2.3.tar.gz +/lua-5.3.0.tar.gz diff --git a/lua-5.2.3-autotoolize.patch b/lua-5.2.3-autotoolize.patch new file mode 100644 index 0000000..02a59fe --- /dev/null +++ b/lua-5.2.3-autotoolize.patch @@ -0,0 +1,204 @@ +diff --git a/Makefile.am b/Makefile.am +new file mode 100644 +index 0000000..8d968c4 +--- /dev/null ++++ b/Makefile.am +@@ -0,0 +1,3 @@ ++SUBDIRS = src doc ++ ++EXTRA_DIST = README +diff --git a/configure.ac b/configure.ac +new file mode 100644 +index 0000000..3af6625 +--- /dev/null ++++ b/configure.ac +@@ -0,0 +1,69 @@ ++AC_PREREQ(2.59) ++AC_INIT([lua], [5.2.3], [https://bugzilla.redhat.com/], [lua-at], [http://www.lua.org]) ++AC_SUBST([MAJOR_VERSION], [5.2]) ++ ++AC_CONFIG_HEADERS([config.h]) ++AC_CONFIG_SRCDIR([src/lapi.c]) ++ ++AM_INIT_AUTOMAKE([1.9 foreign]) ++ ++AC_PROG_CC ++AC_PROG_LIBTOOL ++ ++AC_ARG_WITH( ++ [readline], ++ [AC_HELP_STRING([--with-readline], [Use readline for interpreter input [default=yes]])], ++ [use_readline=$withval], ++ [use_readline=yes] ++) ++ ++LUA_LIBS="-lm" ++ ++# Check for readline ++READLINE_DEFS="#undef LUA_USE_READLINE" ++if test "x$use_readline" == "xyes"; then ++ AC_CHECK_LIB([readline], [readline], [:], [use_readline=no], [-lncurses]) ++ AC_CHECK_HEADERS([readline/readline.h readline/history.h], [], [use_readline=no]) ++ if test "x$use_readline" == "xno"; then ++ AC_MSG_WARN([readline headers could not be found, disabling readline support]) ++ else ++ READLINE_DEFS="#define LUA_USE_READLINE" ++ READLINE_LIBS="-lreadline -lncurses" ++ fi ++fi ++AC_SUBST(READLINE_DEFS) ++AC_SUBST(READLINE_LIBS) ++ ++case "$host" in ++ *-mingw*) use_os=win32 ;; ++ *-darwin*) use_os=macosx ;; ++ *) use_os=posix ;; ++esac ++ ++POSIX_DEFS="#undef LUA_USE_POSIX" ++LUA_DL_DEFS="#undef LUA_USE_DLOPEN" ++LUA_BUILD_AS_DLL_DEFS="#undef LUA_BUILD_AS_DLL" ++ ++if test "x$use_os" == "xwin32"; then ++ LUA_BUILD_AS_DLL_DEFS="#define LUA_BUILD_AS_DLL" ++elif test "x$use_os" == "xmacosx"; then ++ POSIX_DEFS="#define LUA_USE_POSIX" ++ LUA_DL_DEFS="#define LUA_DL_DYLD" ++elif test "x$use_os" == "xposix"; then ++ POSIX_DEFS="#define LUA_USE_POSIX" ++ LUA_DL_DEFS="#define LUA_DL_DLOPEN" ++ LUA_LIBS="$LUA_LIBS -ldl" ++fi ++AC_SUBST(POSIX_DEFS) ++AC_SUBST(LUA_DL_DEFS) ++AC_SUBST(LUA_BUILD_AS_DLL_DEFS) ++ ++AC_SUBST(LUA_LIBS) ++ ++AC_CONFIG_FILES([Makefile ++ src/Makefile ++ src/lua.pc ++ src/luaconf.h.template ++ doc/Makefile ++]) ++AC_OUTPUT +diff --git a/doc/Makefile.am b/doc/Makefile.am +new file mode 100644 +index 0000000..3705696 +--- /dev/null ++++ b/doc/Makefile.am +@@ -0,0 +1,4 @@ ++man1_MANS = lua.1 luac.1 ++ ++EXTRA_DIST = \ ++ contents.html logo.gif lua.1 luac.1 lua.css manual.css manual.html osi-certified-72x60.png readme.html +diff --git a/src/.gitignore b/src/.gitignore +new file mode 100644 +index 0000000..0abd9dd +--- /dev/null ++++ b/src/.gitignore +@@ -0,0 +1,5 @@ ++lua ++lua.pc ++luac ++luaconf.h ++luaconf.h.template +diff --git a/src/Makefile.am b/src/Makefile.am +new file mode 100644 +index 0000000..6c7c79f +--- /dev/null ++++ b/src/Makefile.am +@@ -0,0 +1,46 @@ ++AM_CFLAGS = -Wall ++ ++include_HEADERS = lua.h lualib.h lauxlib.h lua.hpp ++ ++nodist_include_HEADERS = luaconf.h ++ ++lib_LTLIBRARIES = liblua.la ++liblua_la_LDFLAGS = -release @MAJOR_VERSION@ ++liblua_la_SOURCES = \ ++ lapi.c lauxlib.c lbaselib.c lbitlib.c lcode.c lcorolib.c lctype.c ldblib.c \ ++ ldebug.c ldo.c ldump.c lfunc.c lgc.c linit.c liolib.c llex.c lmathlib.c lmem.c \ ++ loadlib.c lobject.c lopcodes.c loslib.c lparser.c lstate.c lstring.c lstrlib.c \ ++ ltable.c ltablib.c ltm.c lundump.c lvm.c lzio.c \ ++ lapi.h lcode.h lctype.h ldebug.h ldo.h lfunc.h lgc.h llex.h llimits.h \ ++ lmem.h lobject.h lopcodes.h lparser.h lstate.h lstring.h ltable.h ltm.h \ ++ lundump.h lvm.h lzio.h ++ ++pkgconfigdir = $(libdir)/pkgconfig ++pkgconfig_DATA = lua.pc ++ ++bin_PROGRAMS = lua luac ++ ++lua_SOURCES = lua.c ++lua_LDADD = liblua.la @LUA_LIBS@ @READLINE_LIBS@ ++lua_DEPENDENCIES = liblua.la ++ ++luac_SOURCES = luac.c ++# Statically link liblua against luac since luac uses symbols not exported in liblua ++luac_LDADD = .libs/liblua.a @LUA_LIBS@ ++luac_DEPENDENCIES = liblua.la ++ ++EXTRA_DIST = luaconf.h.template ++BUILT_SOURCES = luaconf.h ++CLEANFILES = luaconf.h luaconf.h.template ++ ++readline_defs = @READLINE_DEFS@ ++ ++edit = sed \ ++ -e 's,%prefix%,$(prefix),g' \ ++ -e 's,%lua_datadir%,$(datadir),g' \ ++ -e 's,%lua_libdir%,$(libdir),g' ++ ++luaconf.h : luaconf.h.template ++ rm -f $@ $@.tmp ++ $(edit) $< >$@.tmp ++ mv $@.tmp $@ +diff --git a/src/lua.pc.in b/src/lua.pc.in +new file mode 100644 +index 0000000..25faa8d +--- /dev/null ++++ b/src/lua.pc.in +@@ -0,0 +1,13 @@ ++V= @MAJOR_VERSION@ ++R= @VERSION@ ++prefix= @prefix@ ++exec_prefix=${prefix} ++libdir= @libdir@ ++includedir=${prefix}/include ++ ++Name: Lua ++Description: An Extensible Extension Language ++Version: ${R} ++Requires: ++Libs: -llua @LUA_LIBS@ ++Cflags: -I${includedir} +diff --git a/src/luaconf.h b/src/luaconf.h.template.in +--- a/src/luaconf.h.template.in ++++ b/src/luaconf.h.template.in +@@ -11,6 +11,11 @@ + #include + #include + ++@POSIX_DEFS@ ++@LUA_DL_DEFS@ ++@LUA_BUILD_AS_DLL_DEFS@ ++@READLINE_DEFS@ ++ + + /* + ** ================================================================== +@@ -100,9 +105,9 @@ + #else /* }{ */ + + #define LUA_VDIR LUA_VERSION_MAJOR "." LUA_VERSION_MINOR "/" +-#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 "@pkgdatadir@/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;" "./?.lua" diff --git a/lua-5.3.0-autotoolize.patch b/lua-5.3.0-autotoolize.patch new file mode 100644 index 0000000..3e4723a --- /dev/null +++ b/lua-5.3.0-autotoolize.patch @@ -0,0 +1,192 @@ +diff -up lua-5.3.0/configure.ac.autoxxx lua-5.3.0/configure.ac +--- lua-5.3.0/configure.ac.autoxxx 2015-01-15 10:20:03.826889574 -0500 ++++ lua-5.3.0/configure.ac 2015-01-15 10:20:03.826889574 -0500 +@@ -0,0 +1,69 @@ ++AC_PREREQ(2.59) ++AC_INIT([lua], [5.3.0], [https://bugzilla.redhat.com/], [lua-at], [http://www.lua.org]) ++AC_SUBST([MAJOR_VERSION], [5.3]) ++ ++AC_CONFIG_HEADERS([config.h]) ++AC_CONFIG_SRCDIR([src/lapi.c]) ++ ++AM_INIT_AUTOMAKE([1.9 foreign]) ++ ++AC_PROG_CC ++AC_PROG_LIBTOOL ++ ++AC_ARG_WITH( ++ [readline], ++ [AC_HELP_STRING([--with-readline], [Use readline for interpreter input [default=yes]])], ++ [use_readline=$withval], ++ [use_readline=yes] ++) ++ ++LUA_LIBS="-lm" ++ ++# Check for readline ++READLINE_DEFS="#undef LUA_USE_READLINE" ++if test "x$use_readline" == "xyes"; then ++ AC_CHECK_LIB([readline], [readline], [:], [use_readline=no], [-lncurses]) ++ AC_CHECK_HEADERS([readline/readline.h readline/history.h], [], [use_readline=no]) ++ if test "x$use_readline" == "xno"; then ++ AC_MSG_WARN([readline headers could not be found, disabling readline support]) ++ else ++ READLINE_DEFS="#define LUA_USE_READLINE" ++ READLINE_LIBS="-lreadline -lncurses" ++ fi ++fi ++AC_SUBST(READLINE_DEFS) ++AC_SUBST(READLINE_LIBS) ++ ++case "$host" in ++ *-mingw*) use_os=win32 ;; ++ *-darwin*) use_os=macosx ;; ++ *) use_os=posix ;; ++esac ++ ++POSIX_DEFS="#undef LUA_USE_POSIX" ++LUA_DL_DEFS="#undef LUA_USE_DLOPEN" ++LUA_BUILD_AS_DLL_DEFS="#undef LUA_BUILD_AS_DLL" ++ ++if test "x$use_os" == "xwin32"; then ++ LUA_BUILD_AS_DLL_DEFS="#define LUA_BUILD_AS_DLL" ++elif test "x$use_os" == "xmacosx"; then ++ POSIX_DEFS="#define LUA_USE_POSIX" ++ LUA_DL_DEFS="#define LUA_DL_DYLD" ++elif test "x$use_os" == "xposix"; then ++ POSIX_DEFS="#define LUA_USE_POSIX" ++ LUA_DL_DEFS="#define LUA_DL_DLOPEN" ++ LUA_LIBS="$LUA_LIBS -ldl" ++fi ++AC_SUBST(POSIX_DEFS) ++AC_SUBST(LUA_DL_DEFS) ++AC_SUBST(LUA_BUILD_AS_DLL_DEFS) ++ ++AC_SUBST(LUA_LIBS) ++ ++AC_CONFIG_FILES([Makefile ++ src/Makefile ++ src/lua.pc ++ src/luaconf.h.template ++ doc/Makefile ++]) ++AC_OUTPUT +diff -up lua-5.3.0/doc/Makefile.am.autoxxx lua-5.3.0/doc/Makefile.am +--- lua-5.3.0/doc/Makefile.am.autoxxx 2015-01-15 10:20:03.826889574 -0500 ++++ lua-5.3.0/doc/Makefile.am 2015-01-15 10:20:03.826889574 -0500 +@@ -0,0 +1,4 @@ ++man1_MANS = lua.1 luac.1 ++ ++EXTRA_DIST = \ ++ contents.html logo.gif lua.1 luac.1 lua.css manual.css manual.html osi-certified-72x60.png readme.html +diff -up lua-5.3.0/Makefile.am.autoxxx lua-5.3.0/Makefile.am +--- lua-5.3.0/Makefile.am.autoxxx 2015-01-15 10:20:03.826889574 -0500 ++++ lua-5.3.0/Makefile.am 2015-01-15 10:20:03.826889574 -0500 +@@ -0,0 +1,3 @@ ++SUBDIRS = src doc ++ ++EXTRA_DIST = README +diff -up lua-5.3.0/src/.gitignore.autoxxx lua-5.3.0/src/.gitignore +--- lua-5.3.0/src/.gitignore.autoxxx 2015-01-15 10:20:03.826889574 -0500 ++++ lua-5.3.0/src/.gitignore 2015-01-15 10:20:03.826889574 -0500 +@@ -0,0 +1,5 @@ ++lua ++lua.pc ++luac ++luaconf.h ++luaconf.h.template +diff -up lua-5.3.0/src/luaconf.h.template.in.autoxxx lua-5.3.0/src/luaconf.h.template.in +--- lua-5.3.0/src/luaconf.h.template.in.autoxxx 2015-01-15 10:20:03.828889562 -0500 ++++ lua-5.3.0/src/luaconf.h.template.in 2015-01-15 10:22:37.420027778 -0500 +@@ -11,6 +11,11 @@ + #include + #include + ++@POSIX_DEFS@ ++@LUA_DL_DEFS@ ++@LUA_BUILD_AS_DLL_DEFS@ ++@READLINE_DEFS@ ++ + + /* + ** =================================================================== +@@ -175,9 +180,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 "@pkgdatadir@/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 -up lua-5.3.0/src/lua.pc.in.autoxxx lua-5.3.0/src/lua.pc.in +--- lua-5.3.0/src/lua.pc.in.autoxxx 2015-01-15 10:20:03.827889568 -0500 ++++ lua-5.3.0/src/lua.pc.in 2015-01-15 10:20:03.827889568 -0500 +@@ -0,0 +1,13 @@ ++V= @MAJOR_VERSION@ ++R= @VERSION@ ++prefix= @prefix@ ++exec_prefix=${prefix} ++libdir= @libdir@ ++includedir=${prefix}/include ++ ++Name: Lua ++Description: An Extensible Extension Language ++Version: ${R} ++Requires: ++Libs: -llua @LUA_LIBS@ ++Cflags: -I${includedir} +diff -up lua-5.3.0/src/Makefile.am.autoxxx lua-5.3.0/src/Makefile.am +--- lua-5.3.0/src/Makefile.am.autoxxx 2015-01-15 10:20:03.826889574 -0500 ++++ lua-5.3.0/src/Makefile.am 2015-01-15 10:20:03.826889574 -0500 +@@ -0,0 +1,46 @@ ++AM_CFLAGS = -Wall ++ ++include_HEADERS = lua.h lualib.h lauxlib.h lua.hpp ++ ++nodist_include_HEADERS = luaconf.h ++ ++lib_LTLIBRARIES = liblua.la ++liblua_la_LDFLAGS = -release @MAJOR_VERSION@ ++liblua_la_SOURCES = \ ++ lapi.c lauxlib.c lbaselib.c lbitlib.c lcode.c lcorolib.c lctype.c ldblib.c \ ++ ldebug.c ldo.c ldump.c lfunc.c lgc.c linit.c liolib.c llex.c lmathlib.c lmem.c \ ++ loadlib.c lobject.c lopcodes.c loslib.c lparser.c lstate.c lstring.c lstrlib.c \ ++ ltable.c ltablib.c ltm.c lundump.c lutf8lib.c lvm.c lzio.c \ ++ lapi.h lcode.h lctype.h ldebug.h ldo.h lfunc.h lgc.h llex.h llimits.h \ ++ lmem.h lobject.h lopcodes.h lparser.h lstate.h lstring.h ltable.h ltm.h \ ++ lundump.h lvm.h lzio.h ++ ++pkgconfigdir = $(libdir)/pkgconfig ++pkgconfig_DATA = lua.pc ++ ++bin_PROGRAMS = lua luac ++ ++lua_SOURCES = lua.c ++lua_LDADD = liblua.la @LUA_LIBS@ @READLINE_LIBS@ ++lua_DEPENDENCIES = liblua.la ++ ++luac_SOURCES = luac.c ++# Statically link liblua against luac since luac uses symbols not exported in liblua ++luac_LDADD = .libs/liblua.a @LUA_LIBS@ ++luac_DEPENDENCIES = liblua.la ++ ++EXTRA_DIST = luaconf.h.template ++BUILT_SOURCES = luaconf.h ++CLEANFILES = luaconf.h luaconf.h.template ++ ++readline_defs = @READLINE_DEFS@ ++ ++edit = sed \ ++ -e 's,%prefix%,$(prefix),g' \ ++ -e 's,%lua_datadir%,$(datadir),g' \ ++ -e 's,%lua_libdir%,$(libdir),g' ++ ++luaconf.h : luaconf.h.template ++ rm -f $@ $@.tmp ++ $(edit) $< >$@.tmp ++ mv $@.tmp $@ diff --git a/lua-5.3.0-configure-compat-module.patch b/lua-5.3.0-configure-compat-module.patch new file mode 100644 index 0000000..567a5fc --- /dev/null +++ b/lua-5.3.0-configure-compat-module.patch @@ -0,0 +1,34 @@ +diff -up lua-5.2.2/configure.ac.compat-module lua-5.2.2/configure.ac +--- lua-5.2.2/configure.ac.compat-module 2013-05-10 10:16:05.344137597 -0400 ++++ lua-5.2.2/configure.ac 2013-05-10 10:16:05.357137596 -0400 +@@ -11,6 +11,19 @@ AC_PROG_CC + AC_PROG_LIBTOOL + + AC_ARG_WITH( ++ [compat-module], ++ [AC_HELP_STRING([--with-compat-module], [Enable LUA_COMPAT_MODULE functions [default=no]])], ++ [use_compat_module=$withval], ++ [use_compat_module=no] ++) ++ ++COMPAT_DEFS="#undef LUA_COMPAT_ALL" ++if test "x$use_compat_module" == "xyes"; then ++ COMPAT_DEFS="#define LUA_COMPAT_5_1" ++fi ++AC_SUBST(COMPAT_DEFS) ++ ++AC_ARG_WITH( + [readline], + [AC_HELP_STRING([--with-readline], [Use readline for interpreter input [default=yes]])], + [use_readline=$withval], +diff -up lua-5.2.2/src/luaconf.h.template.in.compat-module lua-5.2.2/src/luaconf.h.template.in +--- lua-5.2.2/src/luaconf.h.template.in.compat-module 2013-05-10 10:25:42.586116963 -0400 ++++ lua-5.2.2/src/luaconf.h.template.in 2013-05-10 10:26:29.957115269 -0400 +@@ -15,6 +15,7 @@ + @LUA_DL_DEFS@ + @LUA_BUILD_AS_DLL_DEFS@ + @READLINE_DEFS@ ++@COMPAT_DEFS@ + + + /* diff --git a/lua-5.3.0-idsize.patch b/lua-5.3.0-idsize.patch new file mode 100644 index 0000000..16107fe --- /dev/null +++ b/lua-5.3.0-idsize.patch @@ -0,0 +1,12 @@ +diff -up lua-5.3.0/src/luaconf.h.template.in.idsize lua-5.3.0/src/luaconf.h.template.in +--- lua-5.3.0/src/luaconf.h.template.in.idsize 2015-01-15 10:23:20.515801344 -0500 ++++ lua-5.3.0/src/luaconf.h.template.in 2015-01-15 10:23:48.955651916 -0500 +@@ -693,7 +693,7 @@ + @@ of a function in debug information. + ** CHANGE it if you want a different size. + */ +-#define LUA_IDSIZE 60 ++#define LUA_IDSIZE 512 + + + /* diff --git a/lua-5.3.0-luac-shared-link-fix.patch b/lua-5.3.0-luac-shared-link-fix.patch new file mode 100644 index 0000000..b65e7f0 --- /dev/null +++ b/lua-5.3.0-luac-shared-link-fix.patch @@ -0,0 +1,54 @@ +diff -up lua-5.3.0/src/lopcodes.c.luac-shared lua-5.3.0/src/lopcodes.c +--- lua-5.3.0/src/lopcodes.c.luac-shared 2015-01-05 08:48:33.000000000 -0500 ++++ lua-5.3.0/src/lopcodes.c 2015-01-15 10:24:16.014509744 -0500 +@@ -17,7 +17,7 @@ + + /* ORDER OP */ + +-LUAI_DDEF const char *const luaP_opnames[NUM_OPCODES+1] = { ++LUA_API const char *const luaP_opnames[NUM_OPCODES+1] = { + "MOVE", + "LOADK", + "LOADKX", +@@ -71,7 +71,7 @@ LUAI_DDEF const char *const luaP_opnames + + #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] = { ++LUA_API 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 -up lua-5.3.0/src/lopcodes.h.luac-shared lua-5.3.0/src/lopcodes.h +--- lua-5.3.0/src/lopcodes.h.luac-shared 2014-10-25 07:50:46.000000000 -0400 ++++ lua-5.3.0/src/lopcodes.h 2015-01-15 10:24:16.015509738 -0500 +@@ -276,7 +276,7 @@ enum OpArgMask { + OpArgK /* argument is a constant or register/constant */ + }; + +-LUAI_DDEC const lu_byte luaP_opmodes[NUM_OPCODES]; ++LUA_API 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)) +@@ -285,7 +285,7 @@ LUAI_DDEC const lu_byte luaP_opmodes[NUM + #define testTMode(m) (luaP_opmodes[m] & (1 << 7)) + + +-LUAI_DDEC const char *const luaP_opnames[NUM_OPCODES+1]; /* opcode names */ ++LUA_API const char *const luaP_opnames[NUM_OPCODES+1]; /* opcode names */ + + + /* number of list items to accumulate before a SETLIST instruction */ +diff -up lua-5.3.0/src/lundump.h.luac-shared lua-5.3.0/src/lundump.h +--- lua-5.3.0/src/lundump.h.luac-shared 2015-01-15 10:24:16.015509738 -0500 ++++ lua-5.3.0/src/lundump.h 2015-01-15 10:25:12.651209770 -0500 +@@ -27,7 +27,7 @@ LUAI_FUNC LClosure* luaU_undump (lua_Sta + const char* name); + + /* dump one chunk; from ldump.c */ +-LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, ++LUA_API int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, + void* data, int strip); + + #endif diff --git a/lua.spec b/lua.spec index 644d720..d526747 100644 --- a/lua.spec +++ b/lua.spec @@ -1,7 +1,14 @@ -%global major_version 5.2 +%global major_version 5.3 +# If you are incrementing major_version, enable bootstrapping and adjust accordingly. +# Version should be the latest prior build. If you don't do this, RPM will break and +# everything will grind to a halt. +%global bootstrap 1 +%global bootstrap_major_version 5.2 +%global bootstrap_version %{bootstrap_major_version}.3 + Name: lua -Version: %{major_version}.3 +Version: %{major_version}.0 Release: 1%{?dist} Summary: Powerful light-weight programming language Group: Development/Languages @@ -10,13 +17,21 @@ URL: http://www.lua.org/ Source0: http://www.lua.org/ftp/lua-%{version}.tar.gz # copied from doc/readme.html on 2014-07-18 Source1: mit.txt -Patch0: %{name}-5.2.2-autotoolize.patch -Patch1: %{name}-5.2.2-idsize.patch -Patch2: %{name}-5.2.2-luac-shared-link-fix.patch +%if 0%{?bootstrap} +Source2: http://www.lua.org/ftp/lua-%{bootstrap_version}.tar.gz +%endif +Patch0: %{name}-5.3.0-autotoolize.patch +Patch1: %{name}-5.3.0-idsize.patch +Patch2: %{name}-5.3.0-luac-shared-link-fix.patch Patch3: %{name}-5.2.2-configure-linux.patch -Patch4: %{name}-5.2.2-configure-compat-module.patch -# http://www.lua.org/bugs.html -Patch5: lua-5.2.3-ephemeronfix.patch +Patch4: %{name}-5.3.0-configure-compat-module.patch +%if 0%{?bootstrap} +Patch5: %{name}-5.2.3-autotoolize.patch +Patch6: %{name}-5.2.2-idsize.patch +Patch7: %{name}-5.2.2-luac-shared-link-fix.patch +Patch8: %{name}-5.2.2-configure-compat-module.patch +%endif + BuildRequires: automake autoconf libtool readline-devel ncurses-devel Provides: lua(abi) = %{major_version} @@ -49,7 +64,7 @@ This package contains the static version of liblua for %{name}. %prep -%setup -q +%setup -q -a 2 cp %{SOURCE1} . mv src/luaconf.h src/luaconf.h.template.in %patch0 -p1 -E -z .autoxxx @@ -57,9 +72,20 @@ mv src/luaconf.h src/luaconf.h.template.in %patch2 -p1 -z .luac-shared %patch3 -p1 -z .configure-linux %patch4 -p1 -z .configure-compat-all -%patch5 -p1 -b .ephemeronfix autoreconf -i +%if 0%{?bootstrap} +cd lua-%{bootstrap_version}/ +mv src/luaconf.h src/luaconf.h.template.in +%patch5 -p1 -b .autoxxx +%patch6 -p1 -b .idsize +%patch7 -p1 -b .luac-shared +%patch3 -p1 -z .configure-linux +%patch8 -p1 -z .configure-compat-all +autoreconf -i +cd .. +%endif + %build %configure --with-readline --with-compat-module @@ -72,6 +98,19 @@ sed -i 's|@pkgdatadir@|%{_datadir}|g' src/luaconf.h.template # only one which needs this and otherwise we get License troubles make %{?_smp_mflags} LIBS="-lm -ldl" luac_LDADD="liblua.la -lm -ldl" +%if 0%{?bootstrap} +pushd lua-%{bootstrap_version} +%configure --with-readline --with-compat-module +sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool +sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool +# Autotools give me a headache sometimes. +sed -i 's|@pkgdatadir@|%{_datadir}|g' src/luaconf.h.template + +# hack so that only /usr/bin/lua gets linked with readline as it is the +# only one which needs this and otherwise we get License troubles +make %{?_smp_mflags} LIBS="-lm -ldl" luac_LDADD="liblua.la -lm -ldl" +popd +%endif %install make install DESTDIR=$RPM_BUILD_ROOT @@ -79,14 +118,30 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.la mkdir -p $RPM_BUILD_ROOT%{_libdir}/lua/%{major_version} mkdir -p $RPM_BUILD_ROOT%{_datadir}/lua/%{major_version} +%if 0%{?bootstrap} +pushd lua-%{bootstrap_version} +mkdir $RPM_BUILD_ROOT/installdir +make install DESTDIR=$RPM_BUILD_ROOT/installdir +cp -a $RPM_BUILD_ROOT/installdir/%{_libdir}/liblua-%{bootstrap_major_version}.so $RPM_BUILD_ROOT%{_libdir}/ +mkdir -p $RPM_BUILD_ROOT%{_libdir}/lua/%{bootstrap_major_version} +mkdir -p $RPM_BUILD_ROOT%{_datadir}/lua/%{bootstrap_major_version} +rm -rf $RPM_BUILD_ROOT/installdir +popd +%endif %files %{!?_licensedir:%global license %%doc} %license mit.txt + %doc README doc/*.html doc/*.css doc/*.gif doc/*.png %{_bindir}/lua %{_bindir}/luac -%{_libdir}/liblua-5.2.so +%{_libdir}/liblua-%{major_version}.so +%if 0%{?bootstrap} +%{_libdir}/liblua-%{bootstrap_major_version}.so +%dir %{_libdir}/lua/%{bootstrap_major_version} +%dir %{_datadir}/lua/%{bootstrap_major_version} +%endif %{_mandir}/man1/lua*.1* %dir %{_libdir}/lua %dir %{_libdir}/lua/%{major_version} @@ -104,6 +159,10 @@ mkdir -p $RPM_BUILD_ROOT%{_datadir}/lua/%{major_version} %changelog +* Thu Jan 15 2015 Tom Callaway - 5.3.0-1 +- update to 5.3.0 +- add bootstrapping glue + * Wed Dec 10 2014 Tom Callaway - 5.2.3-1 - update to 5.2.3 diff --git a/sources b/sources index 9b1e356..10a2d7c 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ dc7f94ec6ff15c985d2d6ad0f1b35654 lua-5.2.3.tar.gz +a1b0a7e92d0c85bbff7a8d27bf29f8af lua-5.3.0.tar.gz