From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45478) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eIbyz-00034O-R3 for guix-patches@gnu.org; Sat, 25 Nov 2017 10:03:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eIbyw-0007ro-Oj for guix-patches@gnu.org; Sat, 25 Nov 2017 10:03:05 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:49328) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eIbyw-0007rf-LO for guix-patches@gnu.org; Sat, 25 Nov 2017 10:03:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eIbyw-0002P1-DN for guix-patches@gnu.org; Sat, 25 Nov 2017 10:03:02 -0500 Subject: [bug#29437] [PATCH 1/2] gnu: lua-lpeg: Avoid code repetition. Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45391) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eIbyH-0002p6-Gp for guix-patches@gnu.org; Sat, 25 Nov 2017 10:02:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eIbyE-0007fc-7i for guix-patches@gnu.org; Sat, 25 Nov 2017 10:02:21 -0500 Received: from mail.lassieur.org ([83.152.10.219]:56850) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eIbyE-0007ed-0F for guix-patches@gnu.org; Sat, 25 Nov 2017 10:02:18 -0500 From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Date: Sat, 25 Nov 2017 16:02:05 +0100 Message-Id: <20171125150205.26266-1-clement@lassieur.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 29437@debbugs.gnu.org Cc: rekado@elephly.net * 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