summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--files/lua/lua.pc11
-rw-r--r--groups/221.native_packages_dev.group13
-rw-r--r--patches/lua-5.3.4_pre.local.patch293
-rw-r--r--patches/lua-5.4.3_pre.local.patch126
4 files changed, 145 insertions, 298 deletions
diff --git a/files/lua/lua.pc b/files/lua/lua.pc
new file mode 100644
index 0000000..fd65d9c
--- /dev/null
+++ b/files/lua/lua.pc
@@ -0,0 +1,11 @@
+prefix=
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: Lua
+Description: An Extensible Extension Language
+Version: 5.4
+Requires:
+Libs: -L${libdir} -llua
+Cflags: -I${includedir}
diff --git a/groups/221.native_packages_dev.group b/groups/221.native_packages_dev.group
index 66e0a33..b3ef65a 100644
--- a/groups/221.native_packages_dev.group
+++ b/groups/221.native_packages_dev.group
@@ -58,13 +58,16 @@ ac_cv_prog_gnu_m4_gnu=yes"};
: ${PKG_GENGETOPT_SHA256SUM:=b941aec9011864978dd7fdeb052b1943535824169d2aa2b0e7eae9ab807584ac};
: ${PKG_GENGETOPT_VERSION:=2.23};
: ${PKG_GENGETOPT_URL:=https://ftp.gnu.org/gnu/gengetopt/gengetopt-${PKG_GENGETOPT_VERSION}.tar.xz};
-: ${PKG_LUA_SHA256SUM:=f681aa518233bc407e23acf0f5887c884f17436f000d453b2491a9f11a52400c};
-: ${PKG_LUA_VERSION:=5.3.4};
+: ${PKG_LUA_SHA256SUM:=f8612276169e3bfcbcfb8f226195bfc6e466fe13042f1076cbde92b7ec96bbfb};
+: ${PKG_LUA_VERSION:=5.4.3};
: ${PKG_LUA_URL:=https://www.lua.org/ftp/lua-${PKG_LUA_VERSION}.tar.gz};
+: ${PKG_LUA_CFLAGS_BUILD:="${DEFAULT_CFLAGS:+${DEFAULT_CFLAGS} }--sysroot=${PREFIX_NATIVE}"};
+: ${PKG_LUA_CFLAGS_BUILD_EXTRA:="-DLUA_COMPAT_5_3 -DLUA_USE_LINUX -DLUA_USE_READLINE"};
+: ${PKG_LUA_LDFLAGS_BUILD_EXTRA:="--sysroot=${PREFIX_NATIVE} -lreadline"};
: ${PKG_LUA_IN_TREE:=1};
-: ${PKG_LUA_CONFIGURE_ARGS_EXTRA:="--with-readline --with-compat-module"};
-: ${PKG_LUA_FORCE_AUTORECONF:=1};
-: ${PKG_LUA_INSTALL_FILES_V2:="@liblua.so=lib/liblua.so.0"};
+: ${PKG_LUA_INSTALL_FILES_V2:="
+ +%[_files]/lua.pc=lib/pkgconfig/lua.pc
+ m0644=lib/pkgconfig/lua.pc"};
: ${PKG_INDENT_SHA256SUM:=b745a5dfc68f86a483d7f96dc1cda7aafd1e78ecba3c7d8ad304709e91e1defb};
: ${PKG_INDENT_VERSION:=2.2.12};
: ${PKG_INDENT_URL:=https://ftp.gnu.org/gnu/indent/indent-${PKG_INDENT_VERSION}.tar.xz};
diff --git a/patches/lua-5.3.4_pre.local.patch b/patches/lua-5.3.4_pre.local.patch
deleted file mode 100644
index 0f3858f..0000000
--- a/patches/lua-5.3.4_pre.local.patch
+++ /dev/null
@@ -1,293 +0,0 @@
-From 8a848c7ada873efa2b0878cee7f6871478fb47e5 Mon Sep 17 00:00:00 2001
-From: Neal Gompa <ngompa13@gmail.com>
-Date: Sat, 28 Apr 2018 09:22:35 -0400
-Subject: [PATCH] Autotoolize Lua 5.3.4
-
-This is a super-patch of the Red Hat/Fedora patches for building Lua
-using Autotools.
-
-It is made up of the following patches:
-* lua-5.3.0-autotoolize.patch
-* lua-5.3.0-idsize.patch
-* lua-5.2.2-configure-linux.patch
-* lua-5.3.0-configure-compat-module.patch
-
-The canonical source of these patches is: https://src.fedoraproject.org/rpms/lua
-
-Note that on minor version bumps, the full version must be replaced
-in configure.ac to match.
-
-That is, all instances of "5.3.4" must be replaced with the new 5.3.x
-version. This can be accomplished with sed on this patch.
-
-Cf. https://src.fedoraproject.org/rpms/lua/blob/ed24e54f3b10a67e141af985ff63b49337667b5d/f/lua.spec#_103-104
-
-Before bumping Lua, check to see if the Fedora patch set for autotoolizing
-has changed and use those to rebase this super-patch.
----
- Makefile.am | 3 +
- configure.ac | 88 ++++++++++++++++++++++++
- doc/Makefile.am | 4 ++
- src/.gitignore | 15 ++++
- src/Makefile.am | 46 +++++++++++++
- src/lua.pc.in | 13 ++++
- src/{luaconf.h => luaconf.h.template.in} | 14 ++--
- 7 files changed, 179 insertions(+), 4 deletions(-)
- create mode 100644 Makefile.am
- create mode 100644 configure.ac
- create mode 100644 doc/Makefile.am
- create mode 100644 src/.gitignore
- create mode 100644 src/Makefile.am
- create mode 100644 src/lua.pc.in
- rename src/{luaconf.h => luaconf.h.template.in} (98%)
-
-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..61c4dcd
---- /dev/null
-+++ b/configure.ac
-@@ -0,0 +1,88 @@
-+AC_PREREQ(2.59)
-+AC_INIT([lua], [5.3.4], [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(
-+ [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
-+#define LUA_COMPAT_5_2"
-+fi
-+AC_SUBST(COMPAT_DEFS)
-+
-+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 -ldl"
-+
-+# 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 ;;
-+ *-linux*) use_os=linux ;;
-+ *) 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" == "xlinux"; then
-+ POSIX_DEFS="#define LUA_USE_LINUX"
-+ LUA_DL_DEFS="#define LUA_DL_DLOPEN"
-+ LUA_LIBS="$LUA_LIBS -ldl"
-+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..44aac47
---- /dev/null
-+++ b/src/.gitignore
-@@ -0,0 +1,15 @@
-+lua
-+lua.pc
-+luac
-+luaconf.h
-+luaconf.h.template
-+lua
-+lua.pc
-+luac
-+luaconf.h
-+luaconf.h.template
-+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..33f5b2e
---- /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 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/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
-similarity index 98%
-rename from src/luaconf.h
-rename to src/luaconf.h.template.in
-index f37bea0..c7ff227 100644
---- a/src/luaconf.h
-+++ b/src/luaconf.h.template.in
-@@ -11,6 +11,12 @@
- #include <limits.h>
- #include <stddef.h>
-
-+@POSIX_DEFS@
-+@LUA_DL_DEFS@
-+@LUA_BUILD_AS_DLL_DEFS@
-+@READLINE_DEFS@
-+@COMPAT_DEFS@
-+
-
- /*
- ** ===================================================================
-@@ -200,9 +206,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;" \
-@@ -738,7 +744,7 @@
- @@ of a function in debug information.
- ** CHANGE it if you want a different size.
- */
--#define LUA_IDSIZE 60
-+#define LUA_IDSIZE 512
-
-
- /*
---
-2.17.0
-
diff --git a/patches/lua-5.4.3_pre.local.patch b/patches/lua-5.4.3_pre.local.patch
new file mode 100644
index 0000000..7c9314c
--- /dev/null
+++ b/patches/lua-5.4.3_pre.local.patch
@@ -0,0 +1,126 @@
+diff -ru lua-5.4.3.orig/Makefile lua-5.4.3/Makefile
+--- lua-5.4.3.orig/Makefile 2021-03-02 21:04:35.000000000 +0100
++++ lua-5.4.3/Makefile 2021-10-18 18:33:35.605852816 +0200
+@@ -10,13 +10,14 @@
+ # so take care if INSTALL_TOP is not an absolute path. See the local target.
+ # You may want to make INSTALL_LMOD and INSTALL_CMOD consistent with
+ # LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h.
+-INSTALL_TOP= /usr/local
+-INSTALL_BIN= $(INSTALL_TOP)/bin
+-INSTALL_INC= $(INSTALL_TOP)/include
+-INSTALL_LIB= $(INSTALL_TOP)/lib
+-INSTALL_MAN= $(INSTALL_TOP)/man/man1
+-INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
+-INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V
++PREFIX= /
++INSTALL_TOP= $(PREFIX)
++INSTALL_BIN= $(DESTDIR)$(INSTALL_TOP)/bin
++INSTALL_INC= $(DESTDIR)$(INSTALL_TOP)/include/lua$V
++INSTALL_LIB= $(DESTDIR)$(INSTALL_TOP)/lib
++INSTALL_MAN= $(DESTDIR)$(INSTALL_TOP)/man/man1
++INSTALL_LMOD= $(DESTDIR)$(INSTALL_TOP)/share/lua/$V
++INSTALL_CMOD= $(DESTDIR)$(INSTALL_TOP)/lib/lua/$V
+
+ # How to install. If your install program does not support "-p", then
+ # you may have to run ranlib on the installed liblua.a.
+@@ -54,12 +55,11 @@
+ $(PLATS) help test clean:
+ @cd src && $(MAKE) $@
+
+-install: dummy
+- cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
+- cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
+- cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
+- cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
+- cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
++install:
++ mkdir -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB)
++ cd src; $(LIBTOOL) --mode=install $(INSTALL_EXEC) lua luac $(INSTALL_BIN)
++ cd src; $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
++ cd src; $(LIBTOOL) --mode=install $(INSTALL_DATA) liblua.la $(INSTALL_LIB)
+
+ uninstall:
+ cd src && cd $(INSTALL_BIN) && $(RM) $(TO_BIN)
+diff -ru lua-5.4.3.orig/src/luaconf.h lua-5.4.3/src/luaconf.h
+--- lua-5.4.3.orig/src/luaconf.h 2021-03-15 14:32:52.000000000 +0100
++++ lua-5.4.3/src/luaconf.h 2021-10-18 18:34:55.701853395 +0200
+@@ -217,7 +217,7 @@
+
+ #else /* }{ */
+
+-#define LUA_ROOT "/usr/local/"
++#define LUA_ROOT "/"
+ #define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR "/"
+ #define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR "/"
+
+diff -ru lua-5.4.3.orig/src/Makefile lua-5.4.3/src/Makefile
+--- lua-5.4.3.orig/src/Makefile 2021-02-09 19:47:17.000000000 +0100
++++ lua-5.4.3/src/Makefile 2021-10-18 19:07:15.598332456 +0200
+@@ -7,8 +7,8 @@
+ PLAT= guess
+
+ CC= gcc -std=gnu99
+-CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_3 $(SYSCFLAGS) $(MYCFLAGS)
+-LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
++CFLAGS ?= -O2 -Wall -Wextra -DLUA_COMPAT_5_3 $(SYSCFLAGS) $(MYCFLAGS)
++LDFLAGS ?= $(SYSLDFLAGS) $(MYLDFLAGS)
+ LIBS= -lm $(SYSLIBS) $(MYLIBS)
+
+ AR= ar rcu
+@@ -50,7 +50,8 @@
+ # Targets start here.
+ default: $(PLAT)
+
+-all: $(ALL_T)
++#all: $(ALL_T)
++all: gentoo_all
+
+ o: $(ALL_O)
+
+@@ -60,10 +61,10 @@
+ $(AR) $@ $(BASE_O)
+ $(RANLIB) $@
+
+-$(LUA_T): $(LUA_O) $(LUA_A)
++origin$(LUA_T): $(LUA_O) $(LUA_A)
+ $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
+
+-$(LUAC_T): $(LUAC_O) $(LUA_A)
++origin$(LUAC_T): $(LUAC_O) $(LUA_A)
+ $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
+
+ test:
+@@ -220,3 +221,33 @@
+ lobject.h ltm.h lzio.h
+
+ # (end of Makefile)
++
++LIBTOOL = /usr/bin/libtool --quiet --tag=CC
++LIB_VERSION = 9:3:4
++RPATH = /lib
++V = 5.4
++R = $V.3
++
++# The following rules use libtool for compiling and linking in order to
++# provide shared library support.
++
++LIB_NAME = liblua.la
++LIB_OBJS = $(CORE_O:.o=.lo) $(LIB_O:.o=.lo)
++
++%.lo %.o: %.c
++ $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
++
++$(LIB_NAME): $(LIB_OBJS)
++ $(LIBTOOL) --mode=link $(CC) -version-info $(LIB_VERSION) \
++ -rpath $(RPATH) $(LDFLAGS) -o $(LIB_NAME) $(LIB_OBJS) $(LIB_LIBS)
++
++$(LUA_T): $(LUA_O:.o=.lo) $(LIB_NAME)
++ $(LIBTOOL) --mode=link $(CC) -export-dynamic $(LDFLAGS) -o $@ $(LUA_O:.o=.lo) $(LIB_NAME) $(LUA_LIBS)
++
++$(LUAC_T): $(LUAC_O:.o=.lo) $(LIB_NAME)
++ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ $(LUAC_O:.o=.lo) $(LIB_NAME)
++
++gentoo_clean:
++ $(LIBTOOL) --mode=clean $(RM) $(ALL_O:.o=.lo) $(LIB_NAME) lua luac
++
++gentoo_all: $(LIB_NAME) $(LUA_T) $(LUAC_T)