Subject: Re: [bug#76770] [PATCH] gnu: lua: compile with readline support

From: Vagrant Cascadian <[email-masked]>
Date: Tue, 11 Mar 2025 16:11:38 -0700

On 2025-03-11, kimapr wrote:
> On 2025/03/11 04:34, Vagrant Cascadian wrote:
>> So the patch needs to be re-worked ot only apply to lua-5.4. But then
>> should be able to be pushed directly as it does not have many
>> dependents.
>
> I have done this, however my email client is very evil and keeps
> messing up my formatting no matter what I try so sending the patch
> without malforming it proves difficult. (word-wrapping, randomly
> deleting spaces, i thought i disabled the former but it's still doing
> it and the latter simply makes no sense in any context)

In the future you could also submit the patch as an attachment generated
with "git format-patch"? I should hope your client doesn't mangle
attachements!

> This is a problem to solve later (by using a different client), for
> now I will just send the patch in base64 instead to protect it against
> my evil email client:

Nice workaround! :)

For completeness, I have attached the version decoded from base64...

And Also tested that it builds it's dependents:

  $ ./pre-inst-env guix build --keep-going --max-jobs=2 --dependents lua
  guix build: computing dependents of package [email-masked]...
  /gnu/store/sv4q1qms1mahs7vsxpk83n62sgilvsnd-lua-5.4.6
  /gnu/store/95iazlx13k0mvr63qyxn0y87fiyg7s0x-wesnoth-server-1.18.3
  /gnu/store/jifrzb3pd084sd4zjlpypiyznykxpx89-wesnoth-1.18.3
  /gnu/store/a91sbgmhr4gfw843rckzcpzxi7ahz3kn-darktable-5.0.1
  /gnu/store/qpf4nryf3pjwq31x5kp2n70s0j4kzi47-lite-xl-2.1.3

I tested that it does not trigger rebuilds of other lua versions, and
does enable readline support on [email-masked] ... so it works!

I am not sure I fully wrap my head around the guile code used to
accomplish this, but that is likely just me... so someone a little more
savvy should still review that bit...

live well,
  vagrant

From 02d15b2a9d59354c2f53605278bf5eea074b9a4e Mon Sep 17 00:00:00 2001
From: Kimapr <[email-masked]>
Date: Tue, 11 Mar 2025 11:43:34 +0500
Subject: [PATCH] gnu: lua-5.4: compile with readline support

* gnu/packages/lua.scm (lua-5.4)[arguments]: change target to
  "linux-readline".
---
 gnu/packages/lua.scm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
index 4c65bcbf12..0e45af12a2 100644
--- a/gnu/packages/lua.scm
+++ b/gnu/packages/lua.scm
@@ -134,6 +134,12 @@ (define-public lua
 (define-public lua-5.4
   (package (inherit lua)
            (version "5.4.6")
+           (arguments
+            (substitute-keyword-arguments (package-arguments lua)
+              ((#:make-flags flags)
+               (append (list-head flags
+                                  (- (length flags) 1))
+                       '("linux-readline")))))
            (source (origin
                      (method url-fetch)
                      (uri (string-append "https://www.lua.org/ftp/lua-"

base-commit: 1b7fb5e3f97271ed4264dc9eed7bbc286e9635a3
-- 
2.39.5