Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/lua/, dev-lang/lua/files/
Date: Fri, 25 Dec 2020 23:30:13
Message-Id: 1608938927.a6ac1c1184a696a43c501b8fb08418a0f3dbcc3c.williamh@gentoo
1 commit: a6ac1c1184a696a43c501b8fb08418a0f3dbcc3c
2 Author: William Hubbs <williamh <AT> gentoo <DOT> org>
3 AuthorDate: Fri Dec 25 23:28:32 2020 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Fri Dec 25 23:28:47 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a6ac1c11
7
8 dev-lang/lua: 5.4.2 bump
9
10 Signed-off-by: William Hubbs <williamh <AT> gentoo.org>
11
12 dev-lang/lua/Manifest | 2 +
13 dev-lang/lua/files/lua-5.4.2-make.patch | 99 ++++++++++++++++
14 dev-lang/lua/lua-5.4.2.ebuild | 197 ++++++++++++++++++++++++++++++++
15 3 files changed, 298 insertions(+)
16
17 diff --git a/dev-lang/lua/Manifest b/dev-lang/lua/Manifest
18 index 1009e00ade5..c395e9f376a 100644
19 --- a/dev-lang/lua/Manifest
20 +++ b/dev-lang/lua/Manifest
21 @@ -5,3 +5,5 @@ DIST lua-5.3.4-tests.tar.gz 103438 BLAKE2B ac82708022e7729039111c3df4fe24302c8d0
22 DIST lua-5.3.6.tar.gz 303770 BLAKE2B 07c37c56f43095a4f6ca8eb8b3adf19afd53107c02b62b2bcb3619565cb2100d5f823493eef93092d5e312b30fc28885a6d9e8f0ba5a23b5bed86dc4515a5d61 SHA512 ccc380d5e114d54504de0bfb0321ca25ec325d6ff1bfee44b11870b660762d1a9bf120490c027a0088128b58bb6b5271bbc648400cab84d2dc22b512c4841681
23 DIST lua-5.4.1-tests.tar.gz 128646 BLAKE2B 2dae666e89bacf986228a33fc665bbc510e738d9f8791933f5048e4bbecaf6cd59c5e70e488d332b16960225aac3b9fae46e500f3b54856bb6aabe8cd3a5c932 SHA512 ac7cf113d96f8fe2af4f104297a70debd3bede5997627fc18db6b5d9c78ff49e05a165f5855894def5656c6dcc2d7d9ccce741c90da17698a5c714a33828f49a
24 DIST lua-5.4.1.tar.gz 353965 BLAKE2B e5b46fcf2eb2ea9bd235793cefec2bf19f185ed51b11bc6133bda4e3639f09194378b2fd55544972ee32576751e80bba87b3b61ec3d4a0910592d6e5cb4a4c77 SHA512 49ffbe814ec41e515fc8502b6958151c6c56aa171412f0b211ad9de934be2c958c3709d49435885ddea0fa6765ed511dafb3537558950ff3b4261338214f1571
25 +DIST lua-5.4.2-tests.tar.gz 128901 BLAKE2B 10e4f0e8760f9cbd4761fa26665008ae7412539f79a6a7687029808f08f0ae4a24721e787e2e87e5080c16e9dcce8577a7a39ddc6d3e483a3cfe11756139594e SHA512 1516c59deca211c38444bbf97b18e988e939209b03915d3691d756eeed31b52e8d3a1f05b71ac0b561965274c7b6f3afc4244cd2e9069995696e737e2d9dd40b
26 +DIST lua-5.4.2.tar.gz 353472 BLAKE2B 7e0e642684df635ed1c48db45989e86a2638024e30a170addf700b0c7d32276f1eaef80898539c671039c20cb0bed4861b12c58f4b8211653a17e89bad278d87 SHA512 9454a6ffd973598f2f4a2399834c31c4d5090bd12e716776e3189aa57760319d114ee64a8338bbc2ef5e08150bf0adc2ad94a1b2677f38538a43359969d4d920
27
28 diff --git a/dev-lang/lua/files/lua-5.4.2-make.patch b/dev-lang/lua/files/lua-5.4.2-make.patch
29 new file mode 100644
30 index 00000000000..0f66aa6e4db
31 --- /dev/null
32 +++ b/dev-lang/lua/files/lua-5.4.2-make.patch
33 @@ -0,0 +1,99 @@
34 +diff --git a/Makefile b/Makefile
35 +index 1797df9..90284d8 100644
36 +--- a/Makefile
37 ++++ b/Makefile
38 +@@ -10,11 +10,11 @@ PLAT= guess
39 + # so take care if INSTALL_TOP is not an absolute path. See the local target.
40 + # You may want to make INSTALL_LMOD and INSTALL_CMOD consistent with
41 + # LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h.
42 +-INSTALL_TOP= /usr/local
43 ++INSTALL_TOP= /usr
44 + INSTALL_BIN= $(INSTALL_TOP)/bin
45 +-INSTALL_INC= $(INSTALL_TOP)/include
46 ++INSTALL_INC= $(INSTALL_TOP)/include/lua$V
47 + INSTALL_LIB= $(INSTALL_TOP)/lib
48 +-INSTALL_MAN= $(INSTALL_TOP)/man/man1
49 ++INSTALL_MAN= $(INSTALL_TOP)/share/man/man1
50 + INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
51 + INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V
52 +
53 +@@ -104,3 +104,18 @@ pc:
54 + .PHONY: all $(PLATS) help test clean install uninstall local dummy echo pc
55 +
56 + # (end of Makefile)
57 ++
58 ++# Use libtool for binary installs, etc.
59 ++
60 ++export V
61 ++export LIBTOOL = $(BROOT)/usr/bin/libtool --quiet --tag=CC
62 ++# See libtool manual about how to set this
63 ++
64 ++gentoo_clean:
65 ++ cd src; $(MAKE) $@
66 ++
67 ++gentoo_install:
68 ++ mkdir -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB)
69 ++ cd src; $(LIBTOOL) --mode=install $(INSTALL_EXEC) lua$V luac$V $(INSTALL_BIN)
70 ++ cd src; $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
71 ++ cd src; $(LIBTOOL) --mode=install $(INSTALL_DATA) liblua$V.la $(INSTALL_LIB)
72 +diff --git a/src/Makefile b/src/Makefile
73 +index 514593d..8af8f99 100644
74 +--- a/src/Makefile
75 ++++ b/src/Makefile
76 +@@ -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
77 + 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
78 + BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
79 +
80 +-LUA_T= lua
81 ++LUA_T= lua$V
82 + LUA_O= lua.o
83 +
84 +-LUAC_T= luac
85 ++LUAC_T= luac$V
86 + LUAC_O= luac.o
87 +
88 + ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
89 +@@ -60,10 +60,10 @@ $(LUA_A): $(BASE_O)
90 + $(AR) $@ $(BASE_O)
91 + $(RANLIB) $@
92 +
93 +-$(LUA_T): $(LUA_O) $(LUA_A)
94 ++origin$(LUA_T): $(LUA_O) $(LUA_A)
95 + $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
96 +
97 +-$(LUAC_T): $(LUAC_O) $(LUA_A)
98 ++origin$(LUAC_T): $(LUAC_O) $(LUA_A)
99 + $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
100 +
101 + test:
102 +@@ -218,3 +218,30 @@ lzio.o: lzio.c lprefix.h lua.h luaconf.h llimits.h lmem.h lstate.h \
103 + lobject.h ltm.h lzio.h
104 +
105 + # (end of Makefile)
106 ++
107 ++export LIBTOOL = $(BROOT)/usr/bin/libtool --quiet --tag=CC
108 ++export LIB_VERSION = 6:1:1
109 ++
110 ++# The following rules use libtool for compiling and linking in order to
111 ++# provide shared library support.
112 ++
113 ++LIB_NAME = liblua$V.la
114 ++LIB_OBJS = $(CORE_O:.o=.lo) $(LIB_O:.o=.lo)
115 ++
116 ++%.lo %.o: %.c
117 ++ $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
118 ++
119 ++$(LIB_NAME): $(LIB_OBJS)
120 ++ $(LIBTOOL) --mode=link $(CC) -version-info $(LIB_VERSION) \
121 ++ -rpath $(RPATH) $(LDFLAGS) -o $(LIB_NAME) $(LIB_OBJS) $(LIB_LIBS)
122 ++
123 ++$(LUA_T): $(LUA_O:.o=.lo) $(LIB_NAME)
124 ++ $(LIBTOOL) --mode=link $(CC) -static -export-dynamic $(LDFLAGS) -o $@ $(LUA_O:.o=.lo) $(LIB_NAME) $(LUA_LIBS)
125 ++
126 ++$(LUAC_T): $(LUAC_O:.o=.lo) $(LIB_NAME)
127 ++ $(LIBTOOL) --mode=link $(CC) -static $(LDFLAGS) -o $@ $(LUAC_O:.o=.lo) $(LIB_NAME)
128 ++
129 ++gentoo_clean:
130 ++ $(LIBTOOL) --mode=clean $(RM) $(ALL_O:.o=.lo) $(LIB_NAME) lua$V luac$V
131 ++
132 ++gentoo_all: $(LIB_NAME) $(LUA_T) $(LUAC_T)
133
134 diff --git a/dev-lang/lua/lua-5.4.2.ebuild b/dev-lang/lua/lua-5.4.2.ebuild
135 new file mode 100644
136 index 00000000000..085ce3d47ec
137 --- /dev/null
138 +++ b/dev-lang/lua/lua-5.4.2.ebuild
139 @@ -0,0 +1,197 @@
140 +# Copyright 1999-2020 Gentoo Authors
141 +# Distributed under the terms of the GNU General Public License v2
142 +
143 +EAPI=7
144 +inherit autotools multilib multilib-minimal portability toolchain-funcs
145 +
146 +DESCRIPTION="A powerful light-weight programming language designed for extending applications"
147 +HOMEPAGE="http://www.lua.org/"
148 +TEST_PV="5.4.2"
149 +TEST_P="${PN}-${TEST_PV}-tests"
150 +SRC_URI="
151 + http://www.lua.org/ftp/${P}.tar.gz
152 + test? ( https://www.lua.org/tests/${TEST_P}.tar.gz )"
153 +
154 +LICENSE="MIT"
155 +SLOT="5.4"
156 +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"
157 +IUSE="+deprecated readline test test-complete"
158 +
159 +COMMON_DEPEND="
160 + >=app-eselect/eselect-lua-3
161 + readline? ( sys-libs/readline:0= )
162 + !dev-lang/lua:0"
163 +DEPEND="${COMMON_DEPEND}"
164 +RDEPEND="${COMMON_DEPEND}"
165 +BDEPEND="sys-devel/libtool"
166 +
167 +RESTRICT="!test? ( test )"
168 +
169 +MULTILIB_WRAPPED_HEADERS=(
170 + /usr/include/lua${SLOT}/luaconf.h
171 +)
172 +
173 +PATCHES=(
174 + "${FILESDIR}"/lua-5.4.2-make.patch
175 +)
176 +
177 +src_prepare() {
178 + default
179 + # use glibtool on Darwin (versus Apple libtool)
180 + if [[ ${CHOST} == *-darwin* ]] ; then
181 + sed -i -e '/LIBTOOL = /s:/libtool:/glibtool:' \
182 + Makefile src/Makefile || die
183 + fi
184 +
185 + # correct lua versioning
186 + sed -i -e 's/\(LIB_VERSION = \)6:1:1/\10:0:0/' src/Makefile || die
187 +
188 + sed -i -e 's:\(/README\)\("\):\1.gz\2:g' doc/readme.html || die
189 +
190 + # Using dynamic linked lua is not recommended for performance
191 + # reasons. http://article.gmane.org/gmane.comp.lang.lua.general/18519
192 + # Mainly, this is of concern if your arch is poor with GPRs, like x86
193 + # Note that this only affects the interpreter binary (named lua), not the lua
194 + # compiler (built statically) nor the lua libraries.
195 +
196 + # upstream does not use libtool, but we do (see bug #336167)
197 + cp "${FILESDIR}/configure.in" "${S}/configure.ac" || die
198 + eautoreconf
199 +
200 + # custom Makefiles
201 + multilib_copy_sources
202 +}
203 +
204 +multilib_src_configure() {
205 + sed -i \
206 + -e 's:\(define LUA_ROOT\s*\).*:\1"'${EPREFIX}'/usr/":' \
207 + -e "s:\(define LUA_CDIR\s*LUA_ROOT \"\)lib:\1$(get_libdir):" \
208 + src/luaconf.h \
209 + || die "failed patching luaconf.h"
210 +
211 + econf
212 +}
213 +
214 +multilib_src_compile() {
215 + tc-export CC
216 +
217 + # what to link to liblua
218 + liblibs="-lm"
219 + liblibs="${liblibs} $(dlopen_lib)"
220 +
221 + # what to link to the executables
222 + mylibs=
223 + use readline && mylibs="-lreadline"
224 +
225 + cd src
226 +
227 + local myCFLAGS=""
228 + use deprecated && myCFLAGS="-DLUA_COMPAT_5_3"
229 + use readline && myCFLAGS="-DLUA_USE_READLINE"
230 +
231 + case "${CHOST}" in
232 + *-mingw*) : ;;
233 + *) myCFLAGS+=" -DLUA_USE_LINUX" ;;
234 + esac
235 +
236 + emake CC="${CC}" CFLAGS="${myCFLAGS} ${CFLAGS}" \
237 + SYSLDFLAGS="${LDFLAGS}" \
238 + RPATH="${EPREFIX}/usr/$(get_libdir)/" \
239 + LUA_LIBS="${mylibs}" \
240 + LIB_LIBS="${liblibs}" \
241 + V=$(ver_cut 1-2) \
242 + gentoo_all
243 +}
244 +
245 +multilib_src_install() {
246 + emake INSTALL_TOP="${ED}/usr" INSTALL_LIB="${ED}/usr/$(get_libdir)" \
247 + V=${SLOT} gentoo_install
248 +
249 + case $SLOT in
250 + 0)
251 + LIBNAME="lua"
252 + INCLUDEDIR_SUFFIX=''
253 + ;;
254 + *) LIBNAME="lua${SLOT}"
255 + INCLUDEDIR_SUFFIX="/lua${SLOT}"
256 + ;;
257 + esac
258 +
259 + # We want packages to find our things...
260 + # A slotted Lua uses different directories for headers & names for
261 + # libraries, and pkgconfig should reflect that.
262 + local PATCH_PV=$(ver_cut 1-2)
263 + cp "${FILESDIR}/lua.pc" "${WORKDIR}" || die
264 + sed -r -i \
265 + -e "/^INSTALL_INC=/s,(/include)$,\1/lua${SLOT}," \
266 + -e "s:^prefix= :prefix= ${EPREFIX}:" \
267 + -e "s:^V=.*:V= ${PATCH_PV}:" \
268 + -e "s:^R=.*:R= ${PV}:" \
269 + -e "s:/,lib,:/$(get_libdir):g" \
270 + -e "/^Libs:/s:( )(-llua)($| ):\1-l${LIBNAME}\3:" \
271 + -e "/^includedir=/s:include$:include${INCLUDEDIR_SUFFIX}:" \
272 + "${WORKDIR}/lua.pc" || die
273 +
274 + insinto "/usr/$(get_libdir)/pkgconfig"
275 + newins "${WORKDIR}/lua.pc" "lua${SLOT}.pc"
276 + # Copy Debian's symlink support:
277 + # https://salsa.debian.org/lua-team/lua5.3/blob/master/debian/rules#L19
278 + # FreeBSD calls the pkgconfig 'lua-5.3.pc'
279 + # Older systems called it 'lua53.pc'
280 + dosym "lua${SLOT}.pc" "/usr/$(get_libdir)/pkgconfig/lua-${SLOT}.pc"
281 + dosym "lua${SLOT}.pc" "/usr/$(get_libdir)/pkgconfig/lua${SLOT/.}.pc"
282 +}
283 +
284 +multilib_src_install_all() {
285 + DOCS="README"
286 + HTML_DOCS="doc/*.html doc/*.png doc/*.css doc/*.gif"
287 + einstalldocs
288 + newman doc/lua.1 lua${SLOT}.1
289 + newman doc/luac.1 luac${SLOT}.1
290 + find "${ED}" -name '*.la' -delete || die
291 + find "${ED}" -name 'liblua*.a' -delete || die
292 +}
293 +
294 +# Makefile contains a dummy target that doesn't do tests
295 +# but causes issues with slotted lua (bug #510360)
296 +src_test() {
297 + debug-print-function ${FUNCNAME} "$@"
298 + cd "${WORKDIR}/lua-${TEST_PV}-tests" || die
299 + # https://www.lua.org/tests/
300 + # There are two sets:
301 + # basic
302 + # complete.
303 + #
304 + # The basic subset is selected by passing -e'_U=true'
305 + # The complete set is noted to contain tests that may consume too much memory or have non-portable tests.
306 + # attrib.lua for example needs some multilib customization (have to compile the stuff in libs/ for each ABI)
307 + TEST_OPTS="$(usex test-complete '' '-e_U=true')"
308 + TEST_MARKER="${T}/test.failed"
309 + rm -f "${TEST_MARKER}"
310 +
311 + # If we are failing, set the marker file, and only check it after done all ABIs
312 + abi_src_test() {
313 + debug-print-function ${FUNCNAME} "$@"
314 + TEST_LOG="${T}/test.${MULTIBUILD_ID}.log"
315 + eval "${BUILD_DIR}"/src/lua${SLOT} ${TEST_OPTS} all.lua 2>&1 | tee "${TEST_LOG}" || die
316 + grep -sq -e "final OK" "${TEST_LOG}" || echo "FAIL ${MULTIBUILD_ID}" >>"${TEST_MARKER}"
317 + return 0
318 + }
319 +
320 + multilib_foreach_abi abi_src_test
321 +
322 + if [ -e "${TEST_MARKER}" ]; then
323 + cat "${TEST_MARKER}"
324 + die "Tests failed"
325 + fi
326 +}
327 +
328 +pkg_postinst() {
329 + eselect lua set --if-unset "${PN}${SLOT}"
330 +
331 + if has_version "app-editor/emacs"; then
332 + if ! has_version "app-emacs/lua-mode"; then
333 + einfo "Install app-emacs/lua-mode for lua support for emacs"
334 + fi
335 + fi
336 +}