unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#53186] [PATCH] gnu: lua: add lua version 5.4.3
@ 2022-01-11 12:21 Alex Devaure
  2022-01-13 22:09 ` bug#53186: " Ludovic Courtès
  2022-01-14 12:37 ` [bug#53186] " zimoun
  0 siblings, 2 replies; 3+ messages in thread
From: Alex Devaure @ 2022-01-11 12:21 UTC (permalink / raw)
  To: 53186


After submitting a patch to update the package darktable to the last
version, it appeared that the version 5.4 of lua is necessary. It is why
I am submitting that patch.
Kind regards,
Alex

---
 gnu/packages/lua.scm                         |  12 +++
 gnu/packages/patches/lua-5.4-liblua-so.patch |  31 ++++++
 gnu/packages/patches/lua-5.4-pkgconfig.patch | 106 +++++++++++++++++++
 3 files changed, 149 insertions(+)
 create mode 100644 gnu/packages/patches/lua-5.4-liblua-so.patch
 create mode 100644 gnu/packages/patches/lua-5.4-pkgconfig.patch

diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
index ff4d4824eb..99f09a26f1 100644
--- a/gnu/packages/lua.scm
+++ b/gnu/packages/lua.scm
@@ -105,6 +105,18 @@ (define-public lua
 for configuration, scripting, and rapid prototyping.")
     (license license:x11)))
 
+(define-public lua-5.4
+  (package (inherit lua)
+           (version "5.4.3")
+           (source (origin
+                     (method url-fetch)
+                     (uri (string-append "https://www.lua.org/ftp/lua-"
+                                         version ".tar.gz"))
+                     (sha256
+                      (base32 "1yxvjvnbg4nyrdv10bq42gz6dr66pyan28lgzfygqfwy2rv24qgq"))
+                     (patches (search-patches "lua-5.4-pkgconfig.patch"
+                                              "lua-5.4-liblua-so.patch"))))))
+
 (define-public lua-5.2
   (package (inherit lua)
            (version "5.2.4")
diff --git a/gnu/packages/patches/lua-5.4-liblua-so.patch b/gnu/packages/patches/lua-5.4-liblua-so.patch
new file mode 100644
index 0000000000..0f35887012
--- /dev/null
+++ b/gnu/packages/patches/lua-5.4-liblua-so.patch
@@ -0,0 +1,31 @@
+--- a/src/Makefile	2021-02-09 18:47:17.000000000 +0000
++++ b/src/Makefile	2022-01-03 11:30:36.964501941 +0000
+@@ -33,6 +33,7 @@
+ PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris
+ 
+ LUA_A=	liblua.a
++LUA_SO= liblua.so
+ CORE_O=	lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o
+ 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)
+@@ -44,7 +45,7 @@
+ LUAC_O=	luac.o
+ 
+ ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
+-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
++ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO)
+ ALL_A= $(LUA_A)
+ 
+ # Targets start here.
+@@ -56,6 +57,11 @@
+ 
+ a:	$(ALL_A)
+ 
++$(LUA_SO): $(CORE_O) $(LIB_O)
++	$(CC) -shared -ldl -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? -lm $(MYLDFLAGS)
++	ln -sf $(LUA_SO).$(R) $(LUA_SO).$(V)
++	ln -sf $(LUA_SO).$(R) $(LUA_SO)
++
+ $(LUA_A): $(BASE_O)
+ 	$(AR) $@ $(BASE_O)
+ 	$(RANLIB) $@
diff --git a/gnu/packages/patches/lua-5.4-pkgconfig.patch b/gnu/packages/patches/lua-5.4-pkgconfig.patch
new file mode 100644
index 0000000000..0a80cef9db
--- /dev/null
+++ b/gnu/packages/patches/lua-5.4-pkgconfig.patch
@@ -0,0 +1,106 @@
+--- a/Makefile	2022-01-03 12:06:37.760402709 +0000
++++ b/Makefile	2022-01-03 12:06:49.568402167 +0000
+@@ -14,6 +14,7 @@
+ INSTALL_BIN= $(INSTALL_TOP)/bin
+ INSTALL_INC= $(INSTALL_TOP)/include
+ INSTALL_LIB= $(INSTALL_TOP)/lib
++INSTALL_PC= $(INSTALL_LIB)/pkgconfig
+ INSTALL_MAN= $(INSTALL_TOP)/man/man1
+ INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
+ INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V
+@@ -39,9 +40,12 @@
+ PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris
+ 
+ # What to install.
+-TO_BIN= lua luac
++INTERPRETER= lua
++COMPILER= luac
++TO_BIN= $(INTERPRETER) $(COMPILER)
+ TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
+-TO_LIB= liblua.a
++TO_LIB= liblua.a liblua.so liblua.so.${V}
++TO_PC=  lua-$(V).pc
+ TO_MAN= lua.1 luac.1
+ 
+ # Lua version and release.
+@@ -51,20 +55,26 @@
+ # Targets start here.
+ all:	$(PLAT)
+ 
+-$(PLATS) help test clean:
+-	@cd src && $(MAKE) $@
++$(PLATS):
++	@cd src && $(MAKE) $@ V=$(V) R=$(R)
+ 
+-install: dummy
+-	cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
++clean:
++	cd src && $(MAKE) $@
++	$(RM) $(TO_PC)
++	
++install: dummy $(TO_PC)
++	cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_PC) $(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 src && $(INSTALL_EXEC) $(TO_LIB) $(INSTALL_LIB)
++	cd src && $(INSTALL_DATA) ../$(TO_PC) $(INSTALL_PC)
+ 	cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
+ 
+ uninstall:
+ 	cd src && cd $(INSTALL_BIN) && $(RM) $(TO_BIN)
+ 	cd src && cd $(INSTALL_INC) && $(RM) $(TO_INC)
+ 	cd src && cd $(INSTALL_LIB) && $(RM) $(TO_LIB)
++	cd src && cd $(INSTALL_PC)  && $(RM) $(TO_PC)
+ 	cd doc && cd $(INSTALL_MAN) && $(RM) $(TO_MAN)
+ 
+ local:
+@@ -82,11 +92,13 @@
+ 	@echo "TO_BIN= $(TO_BIN)"
+ 	@echo "TO_INC= $(TO_INC)"
+ 	@echo "TO_LIB= $(TO_LIB)"
++	@echo "TO_PC= $(TO_PC)"
+ 	@echo "TO_MAN= $(TO_MAN)"
+ 	@echo "INSTALL_TOP= $(INSTALL_TOP)"
+ 	@echo "INSTALL_BIN= $(INSTALL_BIN)"
+ 	@echo "INSTALL_INC= $(INSTALL_INC)"
+ 	@echo "INSTALL_LIB= $(INSTALL_LIB)"
++	@echo "INSTALL_PC= $(INSTALL_PC)"
+ 	@echo "INSTALL_MAN= $(INSTALL_MAN)"
+ 	@echo "INSTALL_LMOD= $(INSTALL_LMOD)"
+ 	@echo "INSTALL_CMOD= $(INSTALL_CMOD)"
+@@ -95,12 +107,29 @@
+ 
+ # Echo pkg-config data.
+ pc:
+-	@echo "version=$R"
+-	@echo "prefix=$(INSTALL_TOP)"
+-	@echo "libdir=$(INSTALL_LIB)"
+-	@echo "includedir=$(INSTALL_INC)"
++	@echo 'prefix=$(INSTALL_TOP)'
++	@echo 'libdir=$(INSTALL_LIB)'
++	@echo 'includedir=$(INSTALL_INC)'
++	@echo 'bindir=$(INSTALL_BIN)'
++	@echo
++	@echo 'INSTALL_LMOD=$(INSTALL_LMOD)'
++	@echo 'INSTALL_CMOD=$(INSTALL_CMOD)'
++	@echo 'INTERPRETER=$${bindir}/$(INTERPRETER)'
++	@echo 'COMPILER=$${bindir}/$(COMPILER)'
++	@echo
++	@echo 'Name: Lua'
++	@echo 'Description: A powerful, fast, lightweight, embeddable scripting language'
++	@echo 'Version: $(R)'
++	@echo
++	@echo 'Libs: -L$${libdir} -llua -lm'
++	@echo 'Cflags: -I$${includedir}'
++
++pkg-config: $(TO_PC)
++$(TO_PC):
++	@$(MAKE) -s pc > $@
++	
+ 
+ # Targets that do not create files (not all makes understand .PHONY).
+-.PHONY: all $(PLATS) help test clean install uninstall local dummy echo pc
++.PHONY: all $(PLATS) help test clean install uninstall local dummy echo pc pkg-config
+ 
+ # (end of Makefile)
-- 
2.34.0




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

* bug#53186: [PATCH] gnu: lua: add lua version 5.4.3
  2022-01-11 12:21 [bug#53186] [PATCH] gnu: lua: add lua version 5.4.3 Alex Devaure
@ 2022-01-13 22:09 ` Ludovic Courtès
  2022-01-14 12:37 ` [bug#53186] " zimoun
  1 sibling, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2022-01-13 22:09 UTC (permalink / raw)
  To: Alex Devaure; +Cc: 53186-done

[-- Attachment #1: Type: text/plain, Size: 575 bytes --]

Hi Alex,

Alex Devaure <ajadevaure@gmail.com> skribis:

> After submitting a patch to update the package darktable to the last
> version, it appeared that the version 5.4 of lua is necessary. It is why
> I am submitting that patch.
> Kind regards,
> Alex
>
> ---
>  gnu/packages/lua.scm                         |  12 +++
>  gnu/packages/patches/lua-5.4-liblua-so.patch |  31 ++++++
>  gnu/packages/patches/lua-5.4-pkgconfig.patch | 106 +++++++++++++++++++

Applied with the changes below and a commit log that follows our
conventions.

Thanks,
Ludo’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1535 bytes --]

diff --git a/gnu/local.mk b/gnu/local.mk
index 756caeea44..b9fb0f7349 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1450,6 +1450,8 @@ dist_patch_DATA =						\
   %D%/packages/patches/lua51-liblua-so.patch                    \
   %D%/packages/patches/lua51-pkgconfig.patch                    \
   %D%/packages/patches/lua-liblua-so.patch                      \
+  %D%/packages/patches/lua-5.4-pkgconfig.patch			\
+  %D%/packages/patches/lua-5.4-liblua-so.patch			\
   %D%/packages/patches/luajit-no_ldconfig.patch			\
   %D%/packages/patches/luit-posix.patch				\
   %D%/packages/patches/lvm2-static-link.patch			\
diff --git a/gnu/packages/patches/lua-5.4-liblua-so.patch b/gnu/packages/patches/lua-5.4-liblua-so.patch
index 0f35887012..93dd011143 100644
--- a/gnu/packages/patches/lua-5.4-liblua-so.patch
+++ b/gnu/packages/patches/lua-5.4-liblua-so.patch
@@ -1,3 +1,5 @@
+Patch the makefile to create liblua.so.
+
 --- a/src/Makefile	2021-02-09 18:47:17.000000000 +0000
 +++ b/src/Makefile	2022-01-03 11:30:36.964501941 +0000
 @@ -33,6 +33,7 @@
diff --git a/gnu/packages/patches/lua-5.4-pkgconfig.patch b/gnu/packages/patches/lua-5.4-pkgconfig.patch
index 0a80cef9db..eb42633585 100644
--- a/gnu/packages/patches/lua-5.4-pkgconfig.patch
+++ b/gnu/packages/patches/lua-5.4-pkgconfig.patch
@@ -1,3 +1,7 @@
+Enables generating Lua's pkg-config file.
+
+http://lua-users.org/lists/lua-l/2015-03/msg00338.html
+
 --- a/Makefile	2022-01-03 12:06:37.760402709 +0000
 +++ b/Makefile	2022-01-03 12:06:49.568402167 +0000
 @@ -14,6 +14,7 @@

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

* [bug#53186] [PATCH] gnu: lua: add lua version 5.4.3
  2022-01-11 12:21 [bug#53186] [PATCH] gnu: lua: add lua version 5.4.3 Alex Devaure
  2022-01-13 22:09 ` bug#53186: " Ludovic Courtès
@ 2022-01-14 12:37 ` zimoun
  1 sibling, 0 replies; 3+ messages in thread
From: zimoun @ 2022-01-14 12:37 UTC (permalink / raw)
  To: Alex Devaure; +Cc: rekado, ludo, 53186

Hi,

On Tue, 11 Jan 2022 at 12:21, Alex Devaure <ajadevaure@gmail.com> wrote:

> After submitting a patch to update the package darktable to the last
> version, it appeared that the version 5.4 of lua is necessary. It is why
> I am submitting that patch.

Thanks for the patch!


I am opportunist here. :-) There is this old bug #25425 [1] about lua.
Since you, Alex, sent this non-trivial patch, maybe, who knows, a fix
might be possible.

Basically, the bug is about search-patch.

--8<---------------cut here---------------start------------->8---
$ guix shell lua lua-lpeg -- lua
Lua 5.4.3  Copyright (C) 1994-2021 Lua.org, PUC-Rio
> require('lpeg')
stdin:1: module 'lpeg' not found:
	no field package.preload['lpeg']
	no file '/usr/local/share/lua/5.4/lpeg.lua'
	no file '/usr/local/share/lua/5.4/lpeg/init.lua'
	no file '/usr/local/lib/lua/5.4/lpeg.lua'
	no file '/usr/local/lib/lua/5.4/lpeg/init.lua'
	no file './lpeg.lua'
	no file './lpeg/init.lua'
	no file '/usr/local/lib/lua/5.4/lpeg.so'
	no file '/usr/local/lib/lua/5.4/loadall.so'
	no file './lpeg.so'
stack traceback:
	[C]: in function 'require'
	stdin:1: in main chunk
	[C]: in ?
--8<---------------cut here---------------end--------------->8---

Before, this tweak about environment variables was possible as an ugly
workaround (detail in the bug#25425),

--8<---------------cut here---------------start------------->8---
$ guix shell -C lua lua-lpeg
[env]$ export LUA_PATH="$GUIX_ENVIRONMENT/share/lua/5.3/?.lua;$GUIX_ENVIRONMENT/share/lua/5.3/?/?.lua"
[env]$ export LUA_CPATH="$GUIX_ENVIRONMENT/lib/lua/5.3/?.so;$GUIX_ENVIRONMENT/lib/lua/5.3/?/?.so"
--8<---------------cut here---------------end--------------->8---

but now the same trick raises an error:

--8<---------------cut here---------------start------------->8---
[env]$ lua
Lua 5.4.3  Copyright (C) 1994-2021 Lua.org, PUC-Rio
> require('lpeg')
error loading module 'lpeg' from file '/gnu/store/h4mz30lwxmsfrj4040mw56lqhxmqa9nj-profile/lib/lua/5.3/lpeg.so':
	/gnu/store/h4mz30lwxmsfrj4040mw56lqhxmqa9nj-profile/lib/lua/5.3/lpeg.so: undefined symbol: lua_newuserdata
stack traceback:
	[C]: in ?
	[C]: in function 'require'
	stdin:1: in main chunk
	[C]: in ?
--8<---------------cut here---------------end--------------->8---


Well, I do not know if it is related to the applied patch.  Even if, it
does not appear to me a big deal. :-) My aim here is to pop this old
issue [1] and maybe shave the yak. ;-)

1: <http://issues.guix.gnu.org/issue/25425>


Cheers,
simom




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

end of thread, other threads:[~2022-01-14 12:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-11 12:21 [bug#53186] [PATCH] gnu: lua: add lua version 5.4.3 Alex Devaure
2022-01-13 22:09 ` bug#53186: " Ludovic Courtès
2022-01-14 12:37 ` [bug#53186] " zimoun

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).