public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/lua/files/, dev-lang/lua/
@ 2020-01-23 23:36 Robin H. Johnson
  0 siblings, 0 replies; 8+ messages in thread
From: Robin H. Johnson @ 2020-01-23 23:36 UTC (permalink / raw
  To: gentoo-commits

commit:     719f9a18c8709bf355d7ea80c09cd4e87f0a11fe
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 23 23:35:30 2020 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Thu Jan 23 23:36:34 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=719f9a18

dev-lang/lua: EAPI bump

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 .../lua/files/lua-5.1.5-disable-deprecated.patch   |  59 +++++++++++
 dev-lang/lua/files/lua-5.1.5-gentoo-build.patch    | 118 +++++++++++++++++++++
 dev-lang/lua/files/lua-5.1.5-readline.patch        |  17 +++
 dev-lang/lua/lua-5.1.5-r5.ebuild                   | 113 ++++++++++++++++++++
 4 files changed, 307 insertions(+)

diff --git a/dev-lang/lua/files/lua-5.1.5-disable-deprecated.patch b/dev-lang/lua/files/lua-5.1.5-disable-deprecated.patch
new file mode 100644
index 00000000000..d1d7fb10115
--- /dev/null
+++ b/dev-lang/lua/files/lua-5.1.5-disable-deprecated.patch
@@ -0,0 +1,59 @@
+diff -rdu old/src/luaconf.h new/src/luaconf.h
+--- old/src/luaconf.h	2008-02-12 17:00:03.000000000 +0000
++++ new/src/luaconf.h	2008-02-12 17:07:55.000000000 +0000
+@@ -340,14 +340,14 @@
+ ** CHANGE it to undefined as soon as your programs use only '...' to
+ ** access vararg parameters (instead of the old 'arg' table).
+ */
+-#define LUA_COMPAT_VARARG
++#undef LUA_COMPAT_VARARG
+ 
+ /*
+ @@ LUA_COMPAT_MOD controls compatibility with old math.mod function.
+ ** CHANGE it to undefined as soon as your programs use 'math.fmod' or
+ ** the new '%' operator instead of 'math.mod'.
+ */
+-#define LUA_COMPAT_MOD
++#undef LUA_COMPAT_MOD
+ 
+ /*
+ @@ LUA_COMPAT_LSTR controls compatibility with old long string nesting
+@@ -355,14 +355,14 @@
+ ** CHANGE it to 2 if you want the old behaviour, or undefine it to turn
+ ** off the advisory error when nesting [[...]].
+ */
+-#define LUA_COMPAT_LSTR		1
++#undef LUA_COMPAT_LSTR
+ 
+ /*
+ @@ LUA_COMPAT_GFIND controls compatibility with old 'string.gfind' name.
+ ** CHANGE it to undefined as soon as you rename 'string.gfind' to
+ ** 'string.gmatch'.
+ */
+-#define LUA_COMPAT_GFIND
++#undef LUA_COMPAT_GFIND
+ 
+ /*
+ @@ LUA_COMPAT_OPENLIB controls compatibility with old 'luaL_openlib'
+@@ -370,7 +370,7 @@
+ ** CHANGE it to undefined as soon as you replace to 'luaL_register'
+ ** your uses of 'luaL_openlib'
+ */
+-#define LUA_COMPAT_OPENLIB
++#undef LUA_COMPAT_OPENLIB
+ 
+ 
+ 
+diff -rdu old/test/sieve.lua new/test/sieve.lua
+Rename deprecated functions in test scripts
+--- old/test/sieve.lua~	2002-10-31 03:52:58.000000000 +0100
++++ new/test/sieve.lua	2008-02-20 17:44:22.468281121 +0100
+@@ -14,7 +14,7 @@
+     while 1 do
+       local n = g()
+       if n == nil then return end
+-      if math.mod(n, p) ~= 0 then coroutine.yield(n) end
++      if math.fmod(n, p) ~= 0 then coroutine.yield(n) end
+     end
+   end)
+ end

diff --git a/dev-lang/lua/files/lua-5.1.5-gentoo-build.patch b/dev-lang/lua/files/lua-5.1.5-gentoo-build.patch
new file mode 100644
index 00000000000..62c4ed33648
--- /dev/null
+++ b/dev-lang/lua/files/lua-5.1.5-gentoo-build.patch
@@ -0,0 +1,118 @@
+--- old/Makefile	2012-02-10 10:50:23.000000000 +0100
++++ new/Makefile	2019-07-12 12:00:30.807725876 +0200
+@@ -22,7 +22,8 @@
+ 
+ # How to install. If your install program does not support "-p", then you
+ # may have to run ranlib on the installed liblua.a (do "make ranlib").
+-INSTALL= install -p
++INSTALL?= install -p
++INSTALL_LINK= ln -s
+ INSTALL_EXEC= $(INSTALL) -m 0755
+ INSTALL_DATA= $(INSTALL) -m 0644
+ #
+@@ -33,7 +34,7 @@
+ 
+ # Utilities.
+ MKDIR= mkdir -p
+-RANLIB= ranlib
++RANLIB?= ranlib
+ 
+ # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
+ 
+@@ -47,13 +48,17 @@
+ TO_MAN= lua.1 luac.1
+ 
+ # Lua version and release.
++M= 5
+ V= 5.1
+ R= 5.1.5
+ 
++# Export to sub-make
++export M R
++
+ all:	$(PLAT)
+ 
+ $(PLATS) clean:
+-	cd src && $(MAKE) $@
++	cd src && $(MKDIR) .libs && $(MAKE) $@
+ 
+ test:	dummy
+ 	src/lua test/hello.lua
+@@ -61,6 +66,8 @@
+ 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_EXEC) $(TO_LIB:.a=.so.$(R)) $(INSTALL_LIB)
++	cd src && $(INSTALL_LINK) $(TO_LIB:.a=.so.$(R)) $(INSTALL_LIB)/$(TO_LIB:.a=.so.$(M))
+ 	cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
+ 	cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
+ 	cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
+--- old/src/Makefile	2012-02-13 21:41:22.000000000 +0100
++++ new/src/Makefile	2019-07-12 11:31:02.945290602 +0200
+@@ -7,12 +7,14 @@
+ # Your platform. See PLATS for possible values.
+ PLAT= none
+ 
+-CC= gcc
+-CFLAGS= -O2 -Wall $(MYCFLAGS)
+-AR= ar rcu
+-RANLIB= ranlib
++CC?= gcc
++CFLAGS?= -O2 -Wall $(MYCFLAGS)
++SOFLAGS= -shared -fPIC -DPIC -Wl,-O1 -Wl,--as-needed -Wl,-soname -Wl,$(LUA_A:.a=.so.$(M)) $(MYLDFLAGS)
++AR?= ar
++ARFLAGS?= rcu
++RANLIB?= ranlib
+ RM= rm -f
+-LIBS= -lm $(MYLIBS)
++LIBS?= -lm $(MYLIBS)
+ 
+ MYCFLAGS=
+ MYLDFLAGS=
+@@ -35,8 +37,11 @@
+ LUAC_T=	luac
+ LUAC_O=	luac.o print.o
+ 
+-ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O)
+-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
++LUAS_T=	$(LUA_A:.a=.so.$(R))
++LUAS_O=	$(addprefix .libs/,$(CORE_O) $(LIB_O) $(LUA_O))
++
++ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O) $(LUAS_O)
++ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUAS_T)
+ ALL_A= $(LUA_A)
+ 
+ default: $(PLAT)
+@@ -48,9 +53,12 @@
+ a:	$(ALL_A)
+ 
+ $(LUA_A): $(CORE_O) $(LIB_O)
+-	$(AR) $@ $(CORE_O) $(LIB_O)	# DLL needs all object files
++	$(AR) $(ARFLAGS) $@ $(CORE_O) $(LIB_O)	# DLL needs all object files
+ 	$(RANLIB) $@
+ 
++$(LUAS_T): $(LUAS_O)
++	$(CC) -o $@ $(SOFLAGS) $(LUAS_O) $(LIBS)
++
+ $(LUA_T): $(LUA_O) $(LUA_A)
+ 	$(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
+ 
+@@ -67,7 +75,7 @@
+ 	@echo "PLAT = $(PLAT)"
+ 	@echo "CC = $(CC)"
+ 	@echo "CFLAGS = $(CFLAGS)"
+-	@echo "AR = $(AR)"
++	@echo "AR = $(AR) $(ARFLAGS)"
+ 	@echo "RANLIB = $(RANLIB)"
+ 	@echo "RM = $(RM)"
+ 	@echo "MYCFLAGS = $(MYCFLAGS)"
+@@ -120,6 +128,9 @@
+ 
+ # DO NOT DELETE
+ 
++.libs/%o: %c
++	$(CC) $(CFLAGS) -fPIC -DPIC -c -o $@ $<
++
+ lapi.o: lapi.c lua.h luaconf.h lapi.h lobject.h llimits.h ldebug.h \
+   lstate.h ltm.h lzio.h lmem.h ldo.h lfunc.h lgc.h lstring.h ltable.h \
+   lundump.h lvm.h

diff --git a/dev-lang/lua/files/lua-5.1.5-readline.patch b/dev-lang/lua/files/lua-5.1.5-readline.patch
new file mode 100644
index 00000000000..2b5221a8ab4
--- /dev/null
+++ b/dev-lang/lua/files/lua-5.1.5-readline.patch
@@ -0,0 +1,17 @@
+--- old/src/luaconf.h	2006-04-10 20:27:23.000000000 +0200
++++ new/src/luaconf.h	2006-11-15 14:53:07.000000000 +0100
+@@ -36,7 +36,6 @@
+ #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)
+--- old/src/Makefile	2012-02-13 21:41:22.000000000 +0100
++++ old/src/Makefile	2019-07-09 09:53:00.000000000 +0100
+@@ -98,3 +98,3 @@
+ linux:  
+-	$(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"
++	$(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl"
+ 

diff --git a/dev-lang/lua/lua-5.1.5-r5.ebuild b/dev-lang/lua/lua-5.1.5-r5.ebuild
new file mode 100644
index 00000000000..f6bb7d48bff
--- /dev/null
+++ b/dev-lang/lua/lua-5.1.5-r5.ebuild
@@ -0,0 +1,113 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils multilib multilib-minimal portability toolchain-funcs versionator flag-o-matic
+
+DESCRIPTION="A powerful light-weight programming language designed for extending applications"
+HOMEPAGE="http://www.lua.org/"
+SRC_URI="http://www.lua.org/ftp/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="+deprecated emacs readline doc"
+
+RDEPEND="readline? ( >=sys-libs/readline-6.2_p5-r1:0=[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}"
+PDEPEND="emacs? ( app-emacs/lua-mode )"
+
+MULTILIB_WRAPPED_HEADERS=(
+	/usr/include/luaconf.h
+)
+
+src_prepare() {
+	# Correct documentation link
+	sed -i -e 's:\(/README\)\("\):\1.gz\2:g' doc/readme.html || die
+
+	# Using dynamic linked lua is not recommended for performance
+	# reasons. http://article.gmane.org/gmane.comp.lang.lua.general/18519
+	# Mainly, this is of concern if your arch is poor with GPRs, like x86.
+
+	# Therefore both lua interpreter and compiler are statically linked to
+	# the core library modules.
+
+	# Note: This patch only adds the required targets to the makefiles
+	# instead of relying upon libtool, which fails cross-compiling. Both
+	# shared and static versions of lua libraries are installed.
+	epatch "${FILESDIR}"/${P}-gentoo-build.patch
+
+	# Rename deprecated functions in scripts
+	use deprecated || epatch "${FILESDIR}"/${P}-disable-deprecated.patch
+
+	# Remove readline dependency if not requested
+	use readline || epatch "${FILESDIR}"/${P}-disable-readline.patch
+
+	epatch "${FILESDIR}/${P}-fix_vararg_calls.patch"
+
+	# Required by EAPI >= 6
+	eapply_user
+
+	# Add documentation URIs if needed
+	use doc && \
+		HTML_DOCS=( doc/*.{html,css,png,gif} ) && \
+		DOCS="HISTORY README"
+
+	# custom Makefiles
+	multilib_copy_sources
+}
+
+multilib_src_configure() {
+	# Fix directories according to FHS/Gentoo policy paths and ABI
+	sed -i \
+		-e 's:/usr/local:'${EPREFIX}'/usr:' \
+		-e 's:/man/:/share/man/:' \
+		-e "s:\([/\"]\)\<lib\>:\1$(get_libdir):g" \
+		Makefile etc/lua.pc src/luaconf.h doc/manual.html || die
+}
+
+multilib_src_compile() {
+	append-cflags "-DLUA_USE_LINUX"
+	append-ldflags "-Wl,-E"
+	tc-export AR CC CPP LD RANLIB
+	emake \
+		MYLDFLAGS="${LDFLAGS}" \
+		MYCFLAGS="${CFLAGS}" \
+		linux
+}
+
+multilib_src_install() {
+	emake -j1 install INSTALL_TOP="${ED}/usr"
+
+	insinto usr/$(get_libdir)/pkgconfig
+	doins etc/lua.pc
+}
+
+multilib_src_install_all() {
+	einstalldocs -r
+
+	doicon etc/lua.ico
+
+	doman doc/lua.1 doc/luac.1
+}
+
+multilib_src_test() {
+	# These tests MUST succeed for the ebuild to succeed
+	local MUST_SUCCEED="bisect cf echo env factorial fib fibfor hello printf sieve
+	sort trace-calls trace-globals"
+
+	# These tests MUST fail for the ebuild to succeed
+	local MUST_FAIL="readonly"
+
+	cd "${BUILD_DIR}" || die
+
+	local test
+	for test in ${MUST_SUCCEED}; do
+		src/lua test/${test}.lua || die "test $test failed"
+	done
+
+	for test in ${MUST_FAIL}; do
+		src/lua test/${test}.lua && die "test $test failed"
+	done
+}


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/lua/files/, dev-lang/lua/
@ 2020-11-16 14:34 William Hubbs
  0 siblings, 0 replies; 8+ messages in thread
From: William Hubbs @ 2020-11-16 14:34 UTC (permalink / raw
  To: gentoo-commits

commit:     48e616adccbebbdf28baa025ae832c5e17f99c65
Author:     William Hubbs <williamh <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 16 14:31:19 2020 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Mon Nov 16 14:31:19 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=48e616ad

dev-lang/lua: 5.4.1 bump

Closes: https://bugs.gentoo.org/754318
Signed-off-by: William Hubbs <williamh <AT> gentoo.org>

 dev-lang/lua/Manifest                      |   2 +
 dev-lang/lua/files/lua-5.4-makefiles.patch |  99 ++++++++++++++
 dev-lang/lua/lua-5.4.1.ebuild              | 200 +++++++++++++++++++++++++++++
 3 files changed, 301 insertions(+)

diff --git a/dev-lang/lua/Manifest b/dev-lang/lua/Manifest
index 56014cc9fe1..2b0364166fe 100644
--- a/dev-lang/lua/Manifest
+++ b/dev-lang/lua/Manifest
@@ -4,3 +4,5 @@ DIST lua-5.2.4.tar.gz 252651 BLAKE2B 6f20308d8413438f8446040e8de16274837cb55e626
 DIST lua-5.3.4-tests.tar.gz 103438 BLAKE2B ac82708022e7729039111c3df4fe24302c8d0efb224afb4828871ac085a3d64c41d674a6f9369035de01ed1f7f75a3d2ce16917f37e774e923216aac0be03e09 SHA512 79575d100a2efabc8243f55b55d912443e09ef7e8b0219cb93541d85c2ba802fb9538015e1228703f09ca57bdb28a640a8f1fa0735716ba1e4bca2179c712dfb
 DIST lua-5.3.5.tar.gz 303543 BLAKE2B 8890fa70fcfb869296bc74c754dc30621a3786d4b38dd35ef9e57ca46ee4b3df12dac1b86109be0823847499ff6b0d95de11f446c4c22de440ae3bb704e5068b SHA512 4f9516acc4659dfd0a9e911bfa00c0788f0ad9348e5724fe8fb17aac59e9c0060a64378f82be86f8534e49c6c013e7488ad17321bafcc787831d3d67406bd0f4
 DIST lua-5.3.6.tar.gz 303770 BLAKE2B 07c37c56f43095a4f6ca8eb8b3adf19afd53107c02b62b2bcb3619565cb2100d5f823493eef93092d5e312b30fc28885a6d9e8f0ba5a23b5bed86dc4515a5d61 SHA512 ccc380d5e114d54504de0bfb0321ca25ec325d6ff1bfee44b11870b660762d1a9bf120490c027a0088128b58bb6b5271bbc648400cab84d2dc22b512c4841681
+DIST lua-5.4.1-tests.tar.gz 128646 BLAKE2B 2dae666e89bacf986228a33fc665bbc510e738d9f8791933f5048e4bbecaf6cd59c5e70e488d332b16960225aac3b9fae46e500f3b54856bb6aabe8cd3a5c932 SHA512 ac7cf113d96f8fe2af4f104297a70debd3bede5997627fc18db6b5d9c78ff49e05a165f5855894def5656c6dcc2d7d9ccce741c90da17698a5c714a33828f49a
+DIST lua-5.4.1.tar.gz 353965 BLAKE2B e5b46fcf2eb2ea9bd235793cefec2bf19f185ed51b11bc6133bda4e3639f09194378b2fd55544972ee32576751e80bba87b3b61ec3d4a0910592d6e5cb4a4c77 SHA512 49ffbe814ec41e515fc8502b6958151c6c56aa171412f0b211ad9de934be2c958c3709d49435885ddea0fa6765ed511dafb3537558950ff3b4261338214f1571

diff --git a/dev-lang/lua/files/lua-5.4-makefiles.patch b/dev-lang/lua/files/lua-5.4-makefiles.patch
new file mode 100644
index 00000000000..461abb9b0d9
--- /dev/null
+++ b/dev-lang/lua/files/lua-5.4-makefiles.patch
@@ -0,0 +1,99 @@
+diff --git a/Makefile b/Makefile
+index 1797df9..90284d8 100644
+--- a/Makefile
++++ b/Makefile
+@@ -10,11 +10,11 @@ PLAT= guess
+ # 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_TOP= /usr
+ INSTALL_BIN= $(INSTALL_TOP)/bin
+-INSTALL_INC= $(INSTALL_TOP)/include
++INSTALL_INC= $(INSTALL_TOP)/include/lua$V
+ INSTALL_LIB= $(INSTALL_TOP)/lib
+-INSTALL_MAN= $(INSTALL_TOP)/man/man1
++INSTALL_MAN= $(INSTALL_TOP)/share/man/man1
+ INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
+ INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V
+ 
+@@ -104,3 +104,18 @@ pc:
+ .PHONY: all $(PLATS) help test clean install uninstall local dummy echo pc
+ 
+ # (end of Makefile)
++
++# Use libtool for binary installs, etc.
++
++export V
++export LIBTOOL = $(EROOT)/usr/bin/libtool --quiet --tag=CC
++# See libtool manual about how to set this
++
++gentoo_clean:
++	cd src; $(MAKE) $@
++
++gentoo_install:
++	mkdir -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB)
++	cd src; $(LIBTOOL) --mode=install $(INSTALL_EXEC) lua$V luac$V $(INSTALL_BIN)
++	cd src; $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
++	cd src; $(LIBTOOL) --mode=install $(INSTALL_DATA) liblua$V.la $(INSTALL_LIB)
+diff --git a/src/Makefile b/src/Makefile
+index 514593d..8af8f99 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -37,10 +37,10 @@ CORE_O=	lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem
+ LIB_O=	lauxlib.o lbaselib.o lcorolib.o ldblib.o liolib.o lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o linit.o
+ BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
+ 
+-LUA_T=	lua
++LUA_T=	lua$V
+ LUA_O=	lua.o
+ 
+-LUAC_T=	luac
++LUAC_T=	luac$V
+ LUAC_O=	luac.o
+ 
+ ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
+@@ -60,10 +60,10 @@ $(LUA_A): $(BASE_O)
+ 	$(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:
+@@ -218,3 +218,30 @@ lzio.o: lzio.c lprefix.h lua.h luaconf.h llimits.h lmem.h lstate.h \
+  lobject.h ltm.h lzio.h
+ 
+ # (end of Makefile)
++
++export LIBTOOL = $(EROOT)/usr/bin/libtool --quiet --tag=CC
++export LIB_VERSION = 6:1:1
++
++# The following rules use libtool for compiling and linking in order to
++# provide shared library support.
++
++LIB_NAME = liblua$V.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) -static $(LDFLAGS) -o $@ $(LUAC_O:.o=.lo) $(LIB_NAME)
++
++gentoo_clean:
++	$(LIBTOOL) --mode=clean $(RM) $(ALL_O:.o=.lo) $(LIB_NAME) lua$V luac$V
++
++gentoo_all: $(LIB_NAME) $(LUA_T) $(LUAC_T)

diff --git a/dev-lang/lua/lua-5.4.1.ebuild b/dev-lang/lua/lua-5.4.1.ebuild
new file mode 100644
index 00000000000..97b958f75f9
--- /dev/null
+++ b/dev-lang/lua/lua-5.4.1.ebuild
@@ -0,0 +1,200 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit eutils autotools multilib multilib-minimal portability toolchain-funcs
+
+DESCRIPTION="A powerful light-weight programming language designed for extending applications"
+HOMEPAGE="http://www.lua.org/"
+TEST_PV="5.4.1"
+TEST_P="${PN}-${TEST_PV}-tests"
+SRC_URI="
+	http://www.lua.org/ftp/${P}.tar.gz
+	test? ( https://www.lua.org/tests/${TEST_P}.tar.gz )"
+
+LICENSE="MIT"
+SLOT="5.4"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="+deprecated readline static test test-complete"
+
+COMMON_DEPEND="
+	app-eselect/eselect-lua
+	readline? ( sys-libs/readline:0= )
+	!dev-lang/lua:0"
+DEPEND="${COMMON_DEPEND}
+	sys-devel/libtool"
+RDEPEND="${COMMON_DEPEND}"
+
+RESTRICT="!test? ( test )"
+
+MULTILIB_WRAPPED_HEADERS=(
+	/usr/include/lua${SLOT}/luaconf.h
+)
+
+PATCHES=(
+	"${FILESDIR}"/lua-5.4-makefiles.patch
+)
+
+src_prepare() {
+	default
+	# use glibtool on Darwin (versus Apple libtool)
+	if [[ ${CHOST} == *-darwin* ]] ; then
+		sed -i -e '/LIBTOOL = /s:/libtool:/glibtool:' \
+			Makefile src/Makefile || die
+	fi
+
+	# correct lua versioning
+	sed -i -e 's/\(LIB_VERSION = \)6:1:1/\10:0:0/' src/Makefile || die
+
+	sed -i -e 's:\(/README\)\("\):\1.gz\2:g' doc/readme.html || die
+
+	if ! use readline ; then
+		sed -i -e '/#define LUA_USE_READLINE/d' src/luaconf.h || die
+	fi
+
+	# Using dynamic linked lua is not recommended for performance
+	# reasons. http://article.gmane.org/gmane.comp.lang.lua.general/18519
+	# Mainly, this is of concern if your arch is poor with GPRs, like x86
+	# Note that this only affects the interpreter binary (named lua), not the lua
+	# compiler (built statically) nor the lua libraries (both shared and static
+	# are installed)
+	if use static ; then
+		sed -i -e 's:\(-export-dynamic\):-static \1:' src/Makefile || die
+	fi
+
+	# upstream does not use libtool, but we do (see bug #336167)
+	cp "${FILESDIR}/configure.in" "${S}/configure.ac" || die
+	eautoreconf
+
+	# custom Makefiles
+	multilib_copy_sources
+}
+
+multilib_src_configure() {
+	sed -i \
+		-e 's:\(define LUA_ROOT\s*\).*:\1"'${EPREFIX}'/usr/":' \
+		-e "s:\(define LUA_CDIR\s*LUA_ROOT \"\)lib:\1$(get_libdir):" \
+		src/luaconf.h \
+	|| die "failed patching luaconf.h"
+
+	econf
+}
+
+multilib_src_compile() {
+	tc-export CC
+
+	# what to link to liblua
+	liblibs="-lm"
+	liblibs="${liblibs} $(dlopen_lib)"
+
+	# what to link to the executables
+	mylibs=
+	use readline && mylibs="-lreadline"
+
+	cd src
+
+	local myCFLAGS=""
+	use deprecated && myCFLAGS="-DLUA_COMPAT_5_3"
+
+	case "${CHOST}" in
+		*-mingw*) : ;;
+		*) myCFLAGS+=" -DLUA_USE_LINUX" ;;
+	esac
+
+	emake CC="${CC}" CFLAGS="${myCFLAGS} ${CFLAGS}" \
+			SYSLDFLAGS="${LDFLAGS}" \
+			RPATH="${EPREFIX}/usr/$(get_libdir)/" \
+			LUA_LIBS="${mylibs}" \
+			LIB_LIBS="${liblibs}" \
+			V=$(ver_cut 1-2) \
+			gentoo_all
+}
+
+multilib_src_install() {
+	emake INSTALL_TOP="${ED}/usr" INSTALL_LIB="${ED}/usr/$(get_libdir)" \
+			V=${SLOT} gentoo_install
+
+	case $SLOT in
+		0)
+			LIBNAME="lua"
+			INCLUDEDIR_SUFFIX=''
+			;;
+		*)	LIBNAME="lua${SLOT}"
+			INCLUDEDIR_SUFFIX="/lua${SLOT}"
+			;;
+	esac
+
+	# We want packages to find our things...
+	# A slotted Lua uses different directories for headers & names for
+	# libraries, and pkgconfig should reflect that.
+	local PATCH_PV=$(ver_cut 1-2)
+	cp "${FILESDIR}/lua.pc" "${WORKDIR}" || die
+	sed -r -i \
+		-e "/^INSTALL_INC=/s,(/include)$,\1/lua${SLOT}," \
+		-e "s:^prefix= :prefix= ${EPREFIX}:" \
+		-e "s:^V=.*:V= ${PATCH_PV}:" \
+		-e "s:^R=.*:R= ${PV}:" \
+		-e "s:/,lib,:/$(get_libdir):g" \
+		-e "/^Libs:/s:( )(-llua)($| ):\1-l${LIBNAME}\3:" \
+		-e "/^includedir=/s:include$:include${INCLUDEDIR_SUFFIX}:" \
+		"${WORKDIR}/lua.pc" || die
+
+	insinto "/usr/$(get_libdir)/pkgconfig"
+	newins "${WORKDIR}/lua.pc" "lua${SLOT}.pc"
+	# Copy Debian's symlink support:
+	# https://salsa.debian.org/lua-team/lua5.3/blob/master/debian/rules#L19
+	# FreeBSD calls the pkgconfig 'lua-5.3.pc'
+	# Older systems called it 'lua53.pc'
+	dosym "lua${SLOT}.pc" "/usr/$(get_libdir)/pkgconfig/lua-${SLOT}.pc"
+	dosym "lua${SLOT}.pc" "/usr/$(get_libdir)/pkgconfig/lua${SLOT/.}.pc"
+}
+
+multilib_src_install_all() {
+	DOCS="README"
+	HTML_DOCS="doc/*.html doc/*.png doc/*.css doc/*.gif"
+	einstalldocs
+	newman doc/lua.1 lua${SLOT}.1
+	newman doc/luac.1 luac${SLOT}.1
+}
+
+# Makefile contains a dummy target that doesn't do tests
+# but causes issues with slotted lua (bug #510360)
+src_test() {
+	debug-print-function ${FUNCNAME} "$@"
+	cd "${WORKDIR}/lua-${TEST_PV}-tests" || die
+	# https://www.lua.org/tests/
+	# There are two sets:
+	# basic
+	# 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)
+	TEST_OPTS="$(usex test-complete '' '-e_U=true')"
+	TEST_MARKER="${T}/test.failed"
+	rm -f "${TEST_MARKER}"
+
+	# If we are failing, set the marker file, and only check it after done all ABIs
+	abi_src_test() {
+		debug-print-function ${FUNCNAME} "$@"
+		TEST_LOG="${T}/test.${MULTIBUILD_ID}.log"
+		eval "${BUILD_DIR}"/src/lua${SLOT} ${TEST_OPTS} all.lua 2>&1 | tee "${TEST_LOG}" || die
+		grep -sq -e "final OK" "${TEST_LOG}" || echo "FAIL ${MULTIBUILD_ID}" >>"${TEST_MARKER}"
+		return 0
+	}
+
+	multilib_foreach_abi abi_src_test
+
+	if [ -e "${TEST_MARKER}" ]; then
+		cat "${TEST_MARKER}"
+		die "Tests failed"
+	fi
+}
+
+pkg_postinst() {
+	if has_version "app-editor/emacs"; then
+		if ! has_version "app-emacs/emacs-mode"; then
+			einfo "Install app-emacs/lua-mode for lua support for emacs"
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/lua/files/, dev-lang/lua/
@ 2020-11-16 15:06 William Hubbs
  0 siblings, 0 replies; 8+ messages in thread
From: William Hubbs @ 2020-11-16 15:06 UTC (permalink / raw
  To: gentoo-commits

commit:     45d981ed13785da38b1eb1788137fd9ea1165593
Author:     William Hubbs <williamh <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 16 15:04:52 2020 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Mon Nov 16 15:06:22 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=45d981ed

dev-lang/lua: 5.4.1 eapi 7 fixes

Signed-off-by: William Hubbs <williamh <AT> gentoo.org>

 dev-lang/lua/files/lua-5.4-makefiles.patch | 4 ++--
 dev-lang/lua/lua-5.4.1.ebuild              | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/dev-lang/lua/files/lua-5.4-makefiles.patch b/dev-lang/lua/files/lua-5.4-makefiles.patch
index 461abb9b0d9..87e3a276897 100644
--- a/dev-lang/lua/files/lua-5.4-makefiles.patch
+++ b/dev-lang/lua/files/lua-5.4-makefiles.patch
@@ -25,7 +25,7 @@ index 1797df9..90284d8 100644
 +# Use libtool for binary installs, etc.
 +
 +export V
-+export LIBTOOL = $(EROOT)/usr/bin/libtool --quiet --tag=CC
++export LIBTOOL = $(ROOT)/usr/bin/libtool --quiet --tag=CC
 +# See libtool manual about how to set this
 +
 +gentoo_clean:
@@ -71,7 +71,7 @@ index 514593d..8af8f99 100644
  
  # (end of Makefile)
 +
-+export LIBTOOL = $(EROOT)/usr/bin/libtool --quiet --tag=CC
++export LIBTOOL = $(ROOT)/usr/bin/libtool --quiet --tag=CC
 +export LIB_VERSION = 6:1:1
 +
 +# The following rules use libtool for compiling and linking in order to

diff --git a/dev-lang/lua/lua-5.4.1.ebuild b/dev-lang/lua/lua-5.4.1.ebuild
index 97b958f75f9..d20880d9c82 100644
--- a/dev-lang/lua/lua-5.4.1.ebuild
+++ b/dev-lang/lua/lua-5.4.1.ebuild
@@ -2,7 +2,7 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
-inherit eutils autotools multilib multilib-minimal portability toolchain-funcs
+inherit autotools multilib multilib-minimal portability toolchain-funcs
 
 DESCRIPTION="A powerful light-weight programming language designed for extending applications"
 HOMEPAGE="http://www.lua.org/"
@@ -21,9 +21,9 @@ COMMON_DEPEND="
 	app-eselect/eselect-lua
 	readline? ( sys-libs/readline:0= )
 	!dev-lang/lua:0"
-DEPEND="${COMMON_DEPEND}
-	sys-devel/libtool"
+DEPEND="${COMMON_DEPEND}"
 RDEPEND="${COMMON_DEPEND}"
+BDEPEND="sys-devel/libtool"
 
 RESTRICT="!test? ( test )"
 


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/lua/files/, dev-lang/lua/
@ 2020-12-06  0:41 William Hubbs
  0 siblings, 0 replies; 8+ messages in thread
From: William Hubbs @ 2020-12-06  0:41 UTC (permalink / raw
  To: gentoo-commits

commit:     05bcdda098aace6c3507b14b5b956d373ad40c36
Author:     William Hubbs <williamh <AT> gentoo <DOT> org>
AuthorDate: Sun Dec  6 00:36:27 2020 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Sun Dec  6 00:41:01 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=05bcdda0

dev-lang/lua: migrate 5.3 to eapi 7

Signed-off-by: William Hubbs <williamh <AT> gentoo.org>

 dev-lang/lua/files/lua-5.3-make-r1.patch |  4 ++--
 dev-lang/lua/lua-5.3.6-r1.ebuild         | 38 ++++++++++++++++++--------------
 2 files changed, 24 insertions(+), 18 deletions(-)

diff --git a/dev-lang/lua/files/lua-5.3-make-r1.patch b/dev-lang/lua/files/lua-5.3-make-r1.patch
index b9e9051462c..d27eb9938ea 100644
--- a/dev-lang/lua/files/lua-5.3-make-r1.patch
+++ b/dev-lang/lua/files/lua-5.3-make-r1.patch
@@ -18,7 +18,7 @@ diff -uNr lua-5.3.3.orig/Makefile lua-5.3.3/Makefile
 +# Use libtool for binary installs, etc.
 +
 +export V
-+export LIBTOOL = $(EROOT)usr/bin/libtool --quiet --tag=CC
++export LIBTOOL = libtool --quiet --tag=CC
 +# See libtool manual about how to set this
 +
 +gentoo_clean:
@@ -63,7 +63,7 @@ diff -uNr lua-5.3.3.orig/src/Makefile lua-5.3.3/src/Makefile
  
  # (end of Makefile)
 +
-+export LIBTOOL = $(EROOT)usr/bin/libtool --quiet --tag=CC
++export LIBTOOL = libtool --quiet --tag=CC
 +export LIB_VERSION = 6:1:1
 +
 +# The following rules use libtool for compiling and linking in order to

diff --git a/dev-lang/lua/lua-5.3.6-r1.ebuild b/dev-lang/lua/lua-5.3.6-r1.ebuild
index 1e7b58d91b6..a65d701dcd5 100644
--- a/dev-lang/lua/lua-5.3.6-r1.ebuild
+++ b/dev-lang/lua/lua-5.3.6-r1.ebuild
@@ -1,13 +1,13 @@
 # Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=5
+EAPI=7
 
-inherit eutils autotools multilib multilib-minimal portability toolchain-funcs versionator
+inherit autotools multilib multilib-minimal portability toolchain-funcs
 
 DESCRIPTION="A powerful light-weight programming language designed for extending applications"
 HOMEPAGE="http://www.lua.org/"
-TEST_PV="5.3.4" # no 5.3.5-specific release yet
+TEST_PV="5.3.4"
 TEST_A="${PN}-${TEST_PV}-tests.tar.gz"
 PKG_A="${P}.tar.gz"
 SRC_URI="
@@ -17,7 +17,7 @@ SRC_URI="
 LICENSE="MIT"
 SLOT="5.3"
 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="+deprecated emacs readline static test test-complete"
+IUSE="+deprecated readline static test test-complete"
 RESTRICT="!test? ( test )"
 
 RDEPEND="readline? ( sys-libs/readline:0= )
@@ -25,16 +25,17 @@ RDEPEND="readline? ( sys-libs/readline:0= )
 	!dev-lang/lua:0"
 DEPEND="${RDEPEND}
 	sys-devel/libtool"
-PDEPEND="emacs? ( app-emacs/lua-mode )"
 
 MULTILIB_WRAPPED_HEADERS=(
 	/usr/include/lua${SLOT}/luaconf.h
 )
 
-src_prepare() {
-	local PATCH_PV=$(get_version_component_range 1-2)
+PATCHES=(
+	"${FILESDIR}/${PN}-$(ver_cut 1-2)-make-r1.patch"
+)
 
-	epatch "${FILESDIR}"/${PN}-${PATCH_PV}-make-r1.patch
+src_prepare() {
+	default
 
 	# use glibtool on Darwin (versus Apple libtool)
 	if [[ ${CHOST} == *-darwin* ]] ; then
@@ -42,9 +43,6 @@ src_prepare() {
 			Makefile src/Makefile || die
 	fi
 
-	[ -d "${FILESDIR}/${PV}" ] && \
-		EPATCH_SOURCE="${FILESDIR}/${PV}" EPATCH_SUFFIX="upstream.patch" epatch
-
 	# correct lua versioning
 	sed -i -e 's/\(LIB_VERSION = \)6:1:1/\10:0:0/' src/Makefile || die
 
@@ -108,7 +106,7 @@ multilib_src_compile() {
 			RPATH="${EPREFIX}/usr/$(get_libdir)/" \
 			LUA_LIBS="${mylibs}" \
 			LIB_LIBS="${liblibs}" \
-			V=$(get_version_component_range 1-2) \
+			V=$(ver_cut 1-2) \
 			gentoo_all
 }
 
@@ -129,7 +127,7 @@ multilib_src_install() {
 	# We want packages to find our things...
 	# A slotted Lua uses different directories for headers & names for
 	# libraries, and pkgconfig should reflect that.
-	local PATCH_PV=$(get_version_component_range 1-2)
+	local PATCH_PV=$(ver_cut 1-2)
 	cp "${FILESDIR}/lua.pc" "${WORKDIR}" || die
 	sed -r -i \
 		-e "/^INSTALL_INC=/s,(/include)$,\1/lua${SLOT}," \
@@ -152,9 +150,9 @@ multilib_src_install() {
 }
 
 multilib_src_install_all() {
-	dodoc README
-	dohtml doc/*.html doc/*.png doc/*.css doc/*.gif
-
+	DOCS="README"
+	HTML_DOCS="doc/*.html doc/*.png doc/*.css doc/*.gif"
+	einstalldocs
 	newman doc/lua.1 lua${SLOT}.1
 	newman doc/luac.1 luac${SLOT}.1
 }
@@ -192,3 +190,11 @@ src_test() {
 		die "Tests failed"
 	fi
 }
+
+pkg_postinst() {
+	if has_version "app-editor/emacs"; then
+		if ! has_version "app-emacs/lua-mode"; then
+			einfo "Install app-emacs/lua-mode for lua support for emacs"
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/lua/files/, dev-lang/lua/
@ 2020-12-06  1:34 William Hubbs
  0 siblings, 0 replies; 8+ messages in thread
From: William Hubbs @ 2020-12-06  1:34 UTC (permalink / raw
  To: gentoo-commits

commit:     1c73c534632603d64377940b996b8c34937969fe
Author:     William Hubbs <williamh <AT> gentoo <DOT> org>
AuthorDate: Sun Dec  6 01:30:56 2020 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Sun Dec  6 01:33:36 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1c73c534

dev-lang/lua: migrate 5.2.4 to eapi 7

Signed-off-by: William Hubbs <williamh <AT> gentoo.org>

 dev-lang/lua/files/lua-5.2-make-r1.patch |  4 ++--
 dev-lang/lua/lua-5.2.4-r2.ebuild         | 36 +++++++++++++++++++-------------
 2 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/dev-lang/lua/files/lua-5.2-make-r1.patch b/dev-lang/lua/files/lua-5.2-make-r1.patch
index a0624af9cc3..c65f799c0dc 100644
--- a/dev-lang/lua/files/lua-5.2-make-r1.patch
+++ b/dev-lang/lua/files/lua-5.2-make-r1.patch
@@ -17,7 +17,7 @@
 +# Use libtool for binary installs, etc.
 +
 +export V
-+export LIBTOOL = $(EROOT)usr/bin/libtool --quiet --tag=CC
++export LIBTOOL = libtool --quiet --tag=CC
 +# See libtool manual about how to set this
 +
 +gentoo_clean:
@@ -47,7 +47,7 @@
   lzio.h
 
 +
-+export LIBTOOL = $(EROOT)usr/bin/libtool --quiet --tag=CC
++export LIBTOOL = libtool --quiet --tag=CC
 +export LIB_VERSION = 6:1:1
 +
 +# The following rules use libtool for compiling and linking in order to

diff --git a/dev-lang/lua/lua-5.2.4-r2.ebuild b/dev-lang/lua/lua-5.2.4-r2.ebuild
index af89f22a59c..e9de80efdfb 100644
--- a/dev-lang/lua/lua-5.2.4-r2.ebuild
+++ b/dev-lang/lua/lua-5.2.4-r2.ebuild
@@ -1,9 +1,9 @@
 # Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=5
+EAPI=7
 
-inherit eutils autotools multilib multilib-minimal portability toolchain-funcs versionator
+inherit autotools multilib multilib-minimal portability toolchain-funcs
 
 DESCRIPTION="A powerful light-weight programming language designed for extending applications"
 HOMEPAGE="http://www.lua.org/"
@@ -17,7 +17,7 @@ SRC_URI="
 LICENSE="MIT"
 SLOT="5.2"
 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="+deprecated emacs readline static test test-complete"
+IUSE="+deprecated readline static test test-complete"
 RESTRICT="!test? ( test )"
 
 RDEPEND="readline? ( sys-libs/readline:0= )
@@ -25,16 +25,17 @@ RDEPEND="readline? ( sys-libs/readline:0= )
 	!dev-lang/lua:0"
 DEPEND="${RDEPEND}
 	sys-devel/libtool"
-PDEPEND="emacs? ( app-emacs/lua-mode )"
 
 MULTILIB_WRAPPED_HEADERS=(
 	/usr/include/lua${SLOT}/luaconf.h
 )
 
-src_prepare() {
-	local PATCH_PV=$(get_version_component_range 1-2)
+PATCHES=(
+	"${FILESDIR}/${PN}-$(ver_cut 1-2)-make-r1.patch"
+)
 
-	epatch "${FILESDIR}"/${PN}-${PATCH_PV}-make-r1.patch
+src_prepare() {
+	default
 
 	# use glibtool on Darwin (versus Apple libtool)
 	if [[ ${CHOST} == *-darwin* ]] ; then
@@ -42,9 +43,6 @@ src_prepare() {
 			Makefile src/Makefile || die
 	fi
 
-	[ -d "${FILESDIR}/${PV}" ] && \
-		EPATCH_SOURCE="${FILESDIR}/${PV}" EPATCH_SUFFIX="upstream.patch" epatch
-
 	# correct lua versioning
 	sed -i -e 's/\(LIB_VERSION = \)6:1:1/\10:0:0/' src/Makefile || die
 
@@ -108,7 +106,7 @@ multilib_src_compile() {
 			RPATH="${EPREFIX}/usr/$(get_libdir)/" \
 			LUA_LIBS="${mylibs}" \
 			LIB_LIBS="${liblibs}" \
-			V=$(get_version_component_range 1-2) \
+			V=$(ver_cut 1-2) \
 			gentoo_all
 }
 
@@ -129,7 +127,7 @@ multilib_src_install() {
 	# We want packages to find our things...
 	# A slotted Lua uses different directories for headers & names for
 	# libraries, and pkgconfig should reflect that.
-	local PATCH_PV=$(get_version_component_range 1-2)
+	local PATCH_PV=$(ver_cut 1-2)
 	cp "${FILESDIR}/lua.pc" "${WORKDIR}" || die
 	sed -r -i \
 		-e "/^INSTALL_INC=/s,(/include)$,\1/lua${SLOT}," \
@@ -152,9 +150,9 @@ multilib_src_install() {
 }
 
 multilib_src_install_all() {
-	dodoc README
-	dohtml doc/*.html doc/*.png doc/*.css doc/*.gif
-
+	DOCS="README"
+	HTML_DOCS="doc/*.html doc/*.png doc/*.css doc/*.gif"
+	einstalldocs
 	newman doc/lua.1 lua${SLOT}.1
 	newman doc/luac.1 luac${SLOT}.1
 }
@@ -192,3 +190,11 @@ src_test() {
 		die "Tests failed"
 	fi
 }
+
+pkg_postinst() {
+	if has_version "app-editor/emacs"; then
+		if ! has_version "app-emacs/lua-mode"; then
+			einfo "Install app-emacs/lua-mode for lua support for emacs"
+		fi
+	fi
+}


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/lua/files/, dev-lang/lua/
@ 2022-09-26 15:43 David Seifert
  0 siblings, 0 replies; 8+ messages in thread
From: David Seifert @ 2022-09-26 15:43 UTC (permalink / raw
  To: gentoo-commits

commit:     4fb0d3e7e9eafdd19a6931dce5948016ddc351e0
Author:     Federico Denkena <federico.denkena <AT> posteo <DOT> de>
AuthorDate: Mon Sep 26 15:43:34 2022 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Mon Sep 26 15:43:34 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4fb0d3e7

dev-lang/lua: Fix for CVE-2022-28805

This commit fixes CVE-2022-28805 (patch from upstream, slightly modified
due to changed file paths in gentoo).

Closes: https://github.com/gentoo/gentoo/pull/27423
Bug: https://bugs.gentoo.org/837521
Signed-off-by: Federico Denkena <federico.denkena <AT> posteo.de>
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 .../lua/files/lua-5.4.4-lparser-overread.patch     | 34 ++++++++++++++++++++++
 ...lua-5.4.4-r102.ebuild => lua-5.4.4-r103.ebuild} |  4 +++
 2 files changed, 38 insertions(+)

diff --git a/dev-lang/lua/files/lua-5.4.4-lparser-overread.patch b/dev-lang/lua/files/lua-5.4.4-lparser-overread.patch
new file mode 100644
index 000000000000..3e625aa4ffc0
--- /dev/null
+++ b/dev-lang/lua/files/lua-5.4.4-lparser-overread.patch
@@ -0,0 +1,34 @@
+From https://github.com/lua/lua/commit/1f3c6f4534c6411313361697d98d1145a1f030fa Mon Sep 17 00:00:00 2001
+From: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
+Date: Tue, 15 Feb 2022 12:28:46 -0300
+Subject: [PATCH] Bug: Lua can generate wrong code when _ENV is <const>
+
+--- a/src/lparser.c
++++ b/src/lparser.c
+@@ -468,6 +468,7 @@ static void singlevar (LexState *ls, expdesc *var) {
+     expdesc key;
+     singlevaraux(fs, ls->envn, var, 1);  /* get environment variable */
+     lua_assert(var->k != VVOID);  /* this one must exist */
++    luaK_exp2anyregup(fs, var);  /* but could be a constant */
+     codestring(&key, varname);  /* key is variable name */
+     luaK_indexed(fs, var, &key);  /* env[varname] */
+   }
+--- a/tests/attrib.lua
++++ b/tests/attrib.lua
+@@ -434,6 +434,16 @@ a.aVeryLongName012345678901234567890123456789012345678901234567890123456789 ==
+ 10)
+
+
++do
++  -- _ENV constant
++  local function foo ()
++    local _ENV <const> = 11
++    X = "hi"
++  end
++  local st, msg = pcall(foo)
++  assert(not st and string.find(msg, "number"))
++end
++
+
+ -- test of large float/integer indices
+

diff --git a/dev-lang/lua/lua-5.4.4-r102.ebuild b/dev-lang/lua/lua-5.4.4-r103.ebuild
similarity index 96%
rename from dev-lang/lua/lua-5.4.4-r102.ebuild
rename to dev-lang/lua/lua-5.4.4-r103.ebuild
index 1667e6078222..6d39113fa1a3 100644
--- a/dev-lang/lua/lua-5.4.4-r102.ebuild
+++ b/dev-lang/lua/lua-5.4.4-r103.ebuild
@@ -22,6 +22,10 @@ DEPEND="
 RDEPEND="${DEPEND}"
 BDEPEND="virtual/pkgconfig"
 
+PATCHES=(
+	"${FILESDIR}/${P}-lparser-overread.patch"
+)
+
 src_prepare() {
 	default
 


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/lua/files/, dev-lang/lua/
@ 2023-10-17  9:13 Sam James
  0 siblings, 0 replies; 8+ messages in thread
From: Sam James @ 2023-10-17  9:13 UTC (permalink / raw
  To: gentoo-commits

commit:     1f721528f36fd090e3338b5293918323caf30900
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 17 09:13:09 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Oct 17 09:13:09 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1f721528

dev-lang/lua: fix tests on sparc

Backport upstream patch to fix sparc tests. This just drops the bad test and
makes a semantically-identical change to another function, so no revbump needed.

Closes: https://bugs.gentoo.org/914562
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-lang/lua/files/lua-5.4.6-sparc-tests.patch | 44 ++++++++++++++++++++++++++
 dev-lang/lua/lua-5.4.6.ebuild                  |  5 +++
 2 files changed, 49 insertions(+)

diff --git a/dev-lang/lua/files/lua-5.4.6-sparc-tests.patch b/dev-lang/lua/files/lua-5.4.6-sparc-tests.patch
new file mode 100644
index 000000000000..29515aad1639
--- /dev/null
+++ b/dev-lang/lua/files/lua-5.4.6-sparc-tests.patch
@@ -0,0 +1,44 @@
+https://github.com/lua/lua/commit/6baee9ef9d5657ab582c8a4b9f885ec58ed502d0
+https://bugs.gentoo.org/914562
+
+From 6baee9ef9d5657ab582c8a4b9f885ec58ed502d0 Mon Sep 17 00:00:00 2001
+From: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
+Date: Fri, 8 Sep 2023 16:19:21 -0300
+Subject: [PATCH] Removed test for "corrupted binary dump"
+
+Test is too non portable. (For instance, it does not work for
+different number types.)
+--- a/src/lundump.c
++++ b/src/lundump.c
+@@ -81,7 +81,7 @@ static size_t loadUnsigned (LoadState *S, size_t limit) {
+ 
+ 
+ static size_t loadSize (LoadState *S) {
+-  return loadUnsigned(S, ~(size_t)0);
++  return loadUnsigned(S, MAX_SIZET);
+ }
+ 
+ 
+--- a/tests/calls.lua
++++ b/tests/calls.lua
+@@ -342,20 +342,6 @@ do   -- another bug (in 5.4.0)
+ end
+ 
+ 
+-do   -- another bug (since 5.2)
+-  -- corrupted binary dump: list of upvalue names is larger than number
+-  -- of upvalues, overflowing the array of upvalues.
+-  local code =
+-   "\x1b\x4c\x75\x61\x54\x00\x19\x93\x0d\x0a\x1a\x0a\x04\x08\x08\x78\x56\z
+-    \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x77\x40\x00\x86\x40\z
+-    \x74\x65\x6d\x70\x81\x81\x01\x00\x02\x82\x48\x00\x02\x00\xc7\x00\x01\z
+-    \x00\x80\x80\x80\x82\x00\x00\x80\x81\x82\x78\x80\x82\x81\x86\x40\x74\z
+-    \x65\x6d\x70"
+-
+-  assert(load(code))   -- segfaults in previous versions
+-end
+-
+-
+ x = string.dump(load("x = 1; return x"))
+ a = assert(load(read1(x), nil, "b"))
+ assert(a() == 1 and _G.x == 1)

diff --git a/dev-lang/lua/lua-5.4.6.ebuild b/dev-lang/lua/lua-5.4.6.ebuild
index c7fd11588774..c5d1c9109b73 100644
--- a/dev-lang/lua/lua-5.4.6.ebuild
+++ b/dev-lang/lua/lua-5.4.6.ebuild
@@ -22,6 +22,11 @@ DEPEND="
 RDEPEND="${DEPEND}"
 BDEPEND="virtual/pkgconfig"
 
+PATCHES=(
+	# Backported variant of upstream patch to fix sparc tests, bug #914562
+	"${FILESDIR}"/${PN}-5.4.6-sparc-tests.patch
+)
+
 src_prepare() {
 	default
 


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/lua/files/, dev-lang/lua/
@ 2024-01-22 12:56 David Seifert
  0 siblings, 0 replies; 8+ messages in thread
From: David Seifert @ 2024-01-22 12:56 UTC (permalink / raw
  To: gentoo-commits

commit:     776c7c3b0ec869dd9e7c191489c3c46e5536f7ae
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 22 12:56:51 2024 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Mon Jan 22 12:56:51 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=776c7c3b

dev-lang/lua: drop 5.4.4-r103

Signed-off-by: David Seifert <soap <AT> gentoo.org>

 dev-lang/lua/Manifest                              |  1 -
 .../lua/files/lua-5.4.4-lparser-overread.patch     | 34 --------------
 dev-lang/lua/lua-5.4.4-r103.ebuild                 | 54 ----------------------
 3 files changed, 89 deletions(-)

diff --git a/dev-lang/lua/Manifest b/dev-lang/lua/Manifest
index ec26d04f4fb5..8e8837da084c 100644
--- a/dev-lang/lua/Manifest
+++ b/dev-lang/lua/Manifest
@@ -1,4 +1,3 @@
 DIST lua-5.1.5.tar.xz 397416 BLAKE2B ef3880d78be1def383a9db6753b7aec4160f6fa8719529c2ea6266015771a23a1be81424520de10bb087a86081f1ec48c58c36eb8b24bff53adb6bd8d791e31b SHA512 bd827cb2e63cd71d15d846eb29c8745bf869e7b70e12c565ce173623d1fcd29dabf4d33a99c48f294151bb580d830c112cf178e2d80a5a5c36acc7b3bfcd7d24
 DIST lua-5.3.6.tar.xz 541220 BLAKE2B c356cec06b14cdcbb29e382c951491432a3189618f9fd8c8832bdc8c831640fbcb9e212db05b61a577633c5fe9831e75a158cb97720c1e51cab27544526c9e24 SHA512 9a632a90806fa71398d70be7d38769065c1258fd94709cef72236753b42131b8d30da2a5dd28c74211ef8d04b0c30f52d0c593d49c2e8686568c8896b69577d7
-DIST lua-5.4.4.tar.xz 606456 BLAKE2B ba6cad647c0171e5e737151b189b5b404948c08182e9f17d7974a6c6c3b7d99b03cf930add863188db22674b8613fc600d771f62f9dfc99232aab9caea9b073c SHA512 8f3950ed5972a29d7c79e72af617526f6b9f6be7ab268e66206d7e453acc2564541c9d01e2de08a7e9046ab24c66b02167e48a0d5764753befd95dc922b61219
 DIST lua-5.4.6.tar.xz 608376 BLAKE2B bec47685a24be429fa930ac02e6930300ad77105c56d970d3f1a9a6241c23da5ea77b863e9eca36b6c20e1ef1dc90f3635afe9b09dc4221f1e5dd72ce951df38 SHA512 8e7f6bd9d7fdf9327134f7eb01a78df87141989ea0d95f331eb0e71acdbf7c7b7d908da95e16cd91b3f9bad1b496e3b4db2380a851557f29cdc53f4f5255cda5

diff --git a/dev-lang/lua/files/lua-5.4.4-lparser-overread.patch b/dev-lang/lua/files/lua-5.4.4-lparser-overread.patch
deleted file mode 100644
index 3e625aa4ffc0..000000000000
--- a/dev-lang/lua/files/lua-5.4.4-lparser-overread.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From https://github.com/lua/lua/commit/1f3c6f4534c6411313361697d98d1145a1f030fa Mon Sep 17 00:00:00 2001
-From: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
-Date: Tue, 15 Feb 2022 12:28:46 -0300
-Subject: [PATCH] Bug: Lua can generate wrong code when _ENV is <const>
-
---- a/src/lparser.c
-+++ b/src/lparser.c
-@@ -468,6 +468,7 @@ static void singlevar (LexState *ls, expdesc *var) {
-     expdesc key;
-     singlevaraux(fs, ls->envn, var, 1);  /* get environment variable */
-     lua_assert(var->k != VVOID);  /* this one must exist */
-+    luaK_exp2anyregup(fs, var);  /* but could be a constant */
-     codestring(&key, varname);  /* key is variable name */
-     luaK_indexed(fs, var, &key);  /* env[varname] */
-   }
---- a/tests/attrib.lua
-+++ b/tests/attrib.lua
-@@ -434,6 +434,16 @@ a.aVeryLongName012345678901234567890123456789012345678901234567890123456789 ==
- 10)
-
-
-+do
-+  -- _ENV constant
-+  local function foo ()
-+    local _ENV <const> = 11
-+    X = "hi"
-+  end
-+  local st, msg = pcall(foo)
-+  assert(not st and string.find(msg, "number"))
-+end
-+
-
- -- test of large float/integer indices
-

diff --git a/dev-lang/lua/lua-5.4.4-r103.ebuild b/dev-lang/lua/lua-5.4.4-r103.ebuild
deleted file mode 100644
index ebfa8021edc3..000000000000
--- a/dev-lang/lua/lua-5.4.4-r103.ebuild
+++ /dev/null
@@ -1,54 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit flag-o-matic optfeature
-
-DESCRIPTION="A powerful light-weight programming language designed for extending applications"
-HOMEPAGE="https://www.lua.org/"
-# tarballs produced from ${PV} branches in https://gitweb.gentoo.org/proj/lua-patches.git
-SRC_URI="https://dev.gentoo.org/~soap/distfiles/${P}.tar.xz"
-
-LICENSE="MIT"
-SLOT="5.4"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
-IUSE="+deprecated readline"
-
-DEPEND="
-	>=app-eselect/eselect-lua-3
-	readline? ( sys-libs/readline:= )
-	!dev-lang/lua:0"
-RDEPEND="${DEPEND}"
-BDEPEND="virtual/pkgconfig"
-
-PATCHES=(
-	"${FILESDIR}/${P}-lparser-overread.patch"
-)
-
-src_prepare() {
-	default
-
-	if use elibc_musl; then
-		# locales on musl are non-functional (#834153)
-		# https://wiki.musl-libc.org/open-issues.html#Locale-limitations
-		sed -e 's|os.setlocale("pt_BR") or os.setlocale("ptb")|false|g' \
-			-i tests/literals.lua || die
-	fi
-}
-
-src_configure() {
-	use deprecated && append-cppflags -DLUA_COMPAT_5_3
-	econf $(use_with readline)
-}
-
-src_install() {
-	default
-	find "${ED}" -name '*.la' -delete || die
-}
-
-pkg_postinst() {
-	eselect lua set --if-unset "${PN}${SLOT}"
-
-	optfeature "Lua support for Emacs" app-emacs/lua-mode
-}


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-01-22 12:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-16 14:34 [gentoo-commits] repo/gentoo:master commit in: dev-lang/lua/files/, dev-lang/lua/ William Hubbs
  -- strict thread matches above, loose matches on Subject: below --
2024-01-22 12:56 David Seifert
2023-10-17  9:13 Sam James
2022-09-26 15:43 David Seifert
2020-12-06  1:34 William Hubbs
2020-12-06  0:41 William Hubbs
2020-11-16 15:06 William Hubbs
2020-01-23 23:36 Robin H. Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox