From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39512) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIylD-0000XG-0v for guix-patches@gnu.org; Thu, 08 Jun 2017 10:50:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dIyl8-000878-8r for guix-patches@gnu.org; Thu, 08 Jun 2017 10:50:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:60781) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dIyl8-00086x-4L for guix-patches@gnu.org; Thu, 08 Jun 2017 10:50:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dIyl7-0008QA-JE for guix-patches@gnu.org; Thu, 08 Jun 2017 10:50:01 -0400 Subject: bug#27275: [PATCH 1/2] pull: Add a dependency to guile-git. Resent-Message-ID: References: <20170607120405.7156-1-m.othacehe@gmail.com> <20170607120553.7382-1-m.othacehe@gmail.com> <87r2yw56q4.fsf@gnu.org> <8660g7kifz.fsf@gmail.com> <87bmpyznta.fsf@gnu.org> From: Mathieu Othacehe In-reply-to: <87bmpyznta.fsf@gnu.org> Date: Thu, 08 Jun 2017 16:49:15 +0200 Message-ID: <86r2yuilg4.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 27275@debbugs.gnu.org --=-=-= Content-Type: text/plain Hi Ludo ! > Maybe with a macro along these lines: Nice, thanks ! I attached the patch I come up with. It's working ok :) I have a shorter version using match : --8<---------------cut here---------------start------------->8--- (letrec-syntax ((maybe-load-paths (syntax-rules () ((_ item rest ...) (let ((tail (maybe-load-paths rest ...))) (if (string? item) (match tail ((load-path load-compiled-path) (list (cons (string-append item "/share/guile/site/" #$(effective-version)) load-path) (cons (string-append item "/lib/guile/" #$(effective-version) "/site-ccache") load-compiled-path)))) tail))) ((_) '(() ()))))) (match (maybe-load-paths #$guile-json #$guile-ssh #$guile-git #$guile-bytestructures) ((module-load-path module-load-compiled-path) (set! %load-path (append module-load-path %load-path) (set! %load-compiled-path (append module-load-compiled-path %load-compiled-path)))))) --8<---------------cut here---------------end--------------->8--- It might seems preferable but I can't get guix-latest derivation to include (ice-9 match), maybe because of #:module-path in "(gexp->derivation "guix-latest" ...". Mathieu --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0002-pull-Add-a-dependency-to-guile-git.patch >From 1130f8eafdb27216fc542bff253a940528bedc6a Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Wed, 7 Jun 2017 13:44:47 +0200 Subject: [PATCH 2/2] pull: Add a dependency to guile-git. * build-aux/build-self.scm (guile-git, guile-bytestructures): New variables. (build): Add guile-git and guile-bytestructures to %load-path and %load-compiled-path. --- build-aux/build-self.scm | 52 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 41 insertions(+), 11 deletions(-) diff --git a/build-aux/build-self.scm b/build-aux/build-self.scm index a1335fea1..8fb9af23c 100644 --- a/build-aux/build-self.scm +++ b/build-aux/build-self.scm @@ -97,6 +97,13 @@ Guile major version (2.0 or 2.2), or #f if none of the packages matches." "guile2.2-ssh" "guile2.0-ssh")) +(define guile-git + (package-for-current-guile "guile-git" + "guile2.0-git")) + +(define guile-bytestructures + (package-for-current-guile "guile-bytestructures" + "guile2.0-bytestructures")) ;; The actual build procedure. @@ -148,19 +155,42 @@ files." #~(begin (use-modules (guix build pull)) - (let ((json (string-append #$guile-json "/share/guile/site/" - #$(effective-version)))) + (letrec-syntax ((maybe-load-path + (syntax-rules () + ((_ item rest ...) + (let ((tail (maybe-load-path rest ...))) + (if (string? item) + (cons (string-append item + "/share/guile/site/" + #$(effective-version)) + tail) + tail))) + ((_) + '())))) (set! %load-path - (cons* json - (string-append #$guile-ssh "/share/guile/site/" - #$(effective-version)) - %load-path)) + (append + (maybe-load-path #$guile-json #$guile-ssh + #$guile-git #$guile-bytestructures) + %load-path))) + + (letrec-syntax ((maybe-load-compiled-path + (syntax-rules () + ((_ item rest ...) + (let ((tail (maybe-load-compiled-path rest ...))) + (if (string? item) + (cons (string-append item + "/lib/guile/" + #$(effective-version) + "/site-ccache") + tail) + tail))) + ((_) + '())))) (set! %load-compiled-path - (cons* json - (string-append #$guile-ssh "/lib/guile/" - #$(effective-version) - "/site-ccache") - %load-compiled-path))) + (append + (maybe-load-compiled-path #$guile-json #$guile-ssh + #$guile-git #$guile-bytestructures) + %load-compiled-path))) ;; XXX: The 'guile-ssh' package prior to Guix commit 92b7258 was ;; broken: libguile-ssh could not be found. Work around that. -- 2.13.1 --=-=-=--