From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Subject: bug#27284: [PATCH 2/4] gexp: 'computed-file' has a new #:guile parameter. Date: Mon, 11 Dec 2017 11:52:51 +0100 Message-ID: <20171211105253.9670-3-ludo@gnu.org> References: <87h8tnz1dx.fsf@gnu.org> <20171211105253.9670-1-ludo@gnu.org> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46081) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eOLin-000524-FH for bug-guix@gnu.org; Mon, 11 Dec 2017 05:54:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eOLik-0000he-Dx for bug-guix@gnu.org; Mon, 11 Dec 2017 05:54:05 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:47401) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eOLik-0000hT-A0 for bug-guix@gnu.org; Mon, 11 Dec 2017 05:54:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <20171211105253.9670-1-ludo@gnu.org> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: 27284@debbugs.gnu.org * guix/gexp.scm ()[guile]: New field. (computed-file): Add #:guile. (computed-file-compiler): Honor 'guile'. --- guix/gexp.scm | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/guix/gexp.scm b/guix/gexp.scm index 1929947d9..f005c4d29 100644 --- a/guix/gexp.scm +++ b/guix/gexp.scm @@ -343,28 +343,34 @@ This is the declarative counterpart of 'text-file'." (text-file name content references)))) (define-record-type - (%computed-file name gexp options) + (%computed-file name gexp guile options) computed-file? (name computed-file-name) ;string (gexp computed-file-gexp) ;gexp + (guile computed-file-guile) ; (options computed-file-options)) ;list of arguments (define* (computed-file name gexp - #:key (options '(#:local-build? #t))) + #:key guile (options '(#:local-build? #t))) "Return an object representing the store item NAME, a file or directory computed by GEXP. OPTIONS is a list of additional arguments to pass to 'gexp->derivation'. This is the declarative counterpart of 'gexp->derivation'." - (%computed-file name gexp options)) + (%computed-file name gexp guile options)) (define-gexp-compiler (computed-file-compiler (file ) system target) ;; Compile FILE by returning a derivation whose build expression is its ;; gexp. (match file - (($ name gexp options) - (apply gexp->derivation name gexp options)))) + (($ name gexp guile options) + (if guile + (mlet %store-monad ((guile (lower-object guile system + #:target target))) + (apply gexp->derivation name gexp #:guile-for-build guile + options)) + (apply gexp->derivation name gexp options))))) (define-record-type (%program-file name gexp guile) -- 2.15.1