guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 5/6] gnu: Add lua5.2-lpeg.


From: Ludovic Courtès
Subject: Re: [PATCH 5/6] gnu: Add lua5.2-lpeg.
Date: Thu, 26 Jan 2017 19:01:06 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Ricardo Wurmus <address@hidden> skribis:

> * gnu/packages/lua.scm (lua5.2-lpeg): New variable.

I think you didn’t get feedback on this one.

> +(define-public lua5.2-lpeg
> +  (package (inherit lua-lpeg)
> +    (name "lua5.2-lpeg")
> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         (delete 'configure)
> +         ;; `make install` isn't available, so we have to do it manually
> +         (replace 'install
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let ((out (assoc-ref outputs "out"))
> +                   (lua-version ,(version-major+minor (package-version 
> lua-5.2))))
> +               (install-file "lpeg.so"
> +                             (string-append out "/lib/lua/" lua-version))
> +               (install-file "re.lua"
> +                             (string-append out "/share/lua/" lua-version))

It would be best to avoid duplicating this phase since the only
difference is the version number.  However, this is currently
inconvenient, so it’s probably fine to keep it, with an “XXX” comment.

To fix it, we’d have to arrange for the phase to stand alone as opposed
to getting the Lua version number from the “host side”.  So it would be
written along the lines of:

  (lambda …
    (let* ((lua (assoc-ref inputs "lua"))
           (lua-version (extract-version lua)))
      …))

The Python stuff uses a similar pattern.  The ‘extract-version’ thing is
necessarily hacky and brittle though.

Alternately, we could pass the info as an environment variable,
something that’s not done anywhere yet.

Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]