GNU bug report logs

#29437 [PATCH 1/2] gnu: lua-lpeg: Avoid code repetition.

PackageSource(s)Maintainer(s)
guix-patches PTS Buildd Popcon
Reply or subscribe to this bug. View this bug as an mbox, status mbox, or maintainer mbox

Report forwarded to guix-patches@gnu.org:
bug#29437; Package guix-patches. (Sat, 25 Nov 2017 15:03:02 GMT) (full text, mbox, link).


Acknowledgement sent to Clément Lassieur <clement@lassieur.org>:
New bug report received and forwarded. Copy sent to guix-patches@gnu.org. (Sat, 25 Nov 2017 15:03:02 GMT) (full text, mbox, link).


Message #5 received at submit@debbugs.gnu.org (full text, mbox, reply):

From: Clément Lassieur <clement@lassieur.org>
To: guix-patches@gnu.org
Cc: rekado@elephly.net
Subject: [PATCH 1/2] gnu: lua-lpeg: Avoid code repetition.
Date: Sat, 25 Nov 2017 16:02:05 +0100
* gnu/packages/lua.scm (make-lua-lpeg): New procedure.
(lua-lpeg, lua5.2-lpeg): Call make-lua-lpeg.
---
 gnu/packages/lua.scm | 30 ++++++------------------------
 1 file changed, 6 insertions(+), 24 deletions(-)

diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
index 1667bad8d..d5f55b963 100644
--- a/gnu/packages/lua.scm
+++ b/gnu/packages/lua.scm
@@ -356,9 +356,9 @@ based libraries.  It allows using GObject-based libraries directly from Lua.
 Notable examples are GTK+, GStreamer and Webkit.")
     (license license:expat)))
 
-(define-public lua-lpeg
+(define (make-lua-lpeg name lua)
   (package
-    (name "lua-lpeg")
+    (name name)
     (version "1.0.1")
     (source (origin
               (method url-fetch)
@@ -390,29 +390,11 @@ Grammars (PEGs).")
     (home-page "http://www.inf.puc-rio.br/~roberto/lpeg")
     (license license:expat)))
 
+(define-public lua-lpeg
+  (make-lua-lpeg "lua-lpeg" lua))
+
 (define-public lua5.2-lpeg
-  (package (inherit lua-lpeg)
-    (name "lua5.2-lpeg")
-    ;; XXX: The arguments field is almost an exact copy of the field in
-    ;; "lua-lpeg", except for the version string, which was derived from "lua"
-    ;; and now is taken from "lua-5.2".  See this discussion for context:
-    ;; http://lists.gnu.org/archive/html/guix-devel/2017-01/msg02048.html
-    (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))
-               #t))))
-       #:test-target "test"))
-    (inputs `(("lua", lua-5.2)))))
+  (make-lua-lpeg "lua5.2-lpeg" lua-5.2))
 
 ;; Lua 5.3 is not supported.
 (define (make-lua-bitop name lua)
-- 
2.15.0





Information forwarded to guix-patches@gnu.org:
bug#29437; Package guix-patches. (Sun, 26 Nov 2017 16:29:02 GMT) (full text, mbox, link).


Message #8 received at 29437@debbugs.gnu.org (full text, mbox, reply):

From: ludo@gnu.org (Ludovic Courtès)
To: Clément Lassieur <clement@lassieur.org>
Cc: 29437@debbugs.gnu.org, rekado@elephly.net
Subject: Re: [bug#29437] [PATCH 1/2] gnu: lua-lpeg: Avoid code repetition.
Date: Sun, 26 Nov 2017 17:28:37 +0100
Clément Lassieur <clement@lassieur.org> skribis:

> * gnu/packages/lua.scm (make-lua-lpeg): New procedure.
> (lua-lpeg, lua5.2-lpeg): Call make-lua-lpeg.

LGTM, thanks!

Ludo'.




Added tag(s) fixed. Request was from clement@lassieur.org (Clément Lassieur) to control@debbugs.gnu.org. (Tue, 28 Nov 2017 02:56:02 GMT) (full text, mbox, link).


bug closed, send any further explanations to 29437@debbugs.gnu.org and Clément Lassieur <clement@lassieur.org> Request was from clement@lassieur.org (Clément Lassieur) to control@debbugs.gnu.org. (Tue, 28 Nov 2017 02:56:02 GMT) (full text, mbox, link).


bug archived. Request was from Debbugs Internal Request <help-debbugs@gnu.org> to internal_control@debbugs.gnu.org. (Tue, 26 Dec 2017 12:24:03 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


debbugs.gnu.org maintainers <help-debbugs@gnu.org>. Last modified: Mon Nov 4 22:23:09 2024; Machine Name: wallace-server

GNU bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.