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

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

On 2025-03-11, Vagrant Cascadian wrote:
> 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.
...
> 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")))))

I guess this could stand to use a comment in the code explaining what it
is doing and why. I *think* I understand what it is doing... but that is
largely guessing on my part. :)

This does make it a little fragile if the ordering of the #:make-flags
on the inherited package change or have new values appended.

live well,
  vagrant