From mboxrd@z Thu Jan 1 00:00:00 1970 From: Taylan Ulrich Kammer Subject: Re: --with-store-dir and/or --localstatedir seem to be ignored Date: Fri, 15 May 2015 16:03:16 +0200 Message-ID: <87d222ey57.fsf@gmail.com> References: <87h9refc0y.fsf@gmail.com> <87vbfu15n6.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtGCx-0005Xh-NT for guix-devel@gnu.org; Fri, 15 May 2015 10:03:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YtGCt-00039n-Js for guix-devel@gnu.org; Fri, 15 May 2015 10:03:23 -0400 In-Reply-To: <87vbfu15n6.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Fri, 15 May 2015 12:45:01 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org, Alex Vorobiev --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable ludo@gnu.org (Ludovic Court=C3=A8s) writes: >> * guix/build/utils.scm (%store-directory): Fall back to the value of >> %store-directory from (guix config) instead of "/gnu/store". > > This won=E2=80=99t work: (guix config) is meant as a =E2=80=9Chost-side= =E2=80=9D module, and > anyway the daemon always defines =E2=80=98NIX_STORE=E2=80=99 in the build= environment, > so it=E2=80=99s unnecessary. > >> * guix/packages.scm (patch-and-repack): Likewise. > > [...] > >> (define-module (guix packages) >> + #:use-module ((guix config) #:prefix config) >> #:use-module (guix utils) >> #:use-module (guix records) >> #:use-module (guix store) >> @@ -445,7 +446,8 @@ IMPORTED-MODULES specify modules to use/import for u= se by SNIPPET." >>=20=20 >> ;; SOURCE may be either a directory or a tarball. >> (and (if (file-is-directory? #+source) >> - (let* ((store (or (getenv "NIX_STORE") "/gnu/sto= re")) >> + (let* ((store (or (getenv "NIX_STORE") >> + config:%store-directory)) > > This won=E2=80=99t work: the code here is within a gexp, which will run i= n a > different context where (guix config) is not available. I see, thanks for the explanation! Here's the updated patch, against core-updates: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Parameterize-references-to-gnu-store.patch >From 2dcd57e71c86c780e0e06ae5579c2f8e65b3de91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?= Date: Fri, 15 May 2015 10:59:44 +0200 Subject: [PATCH] Parameterize references to /gnu/store. * gnu/packages/busybox.scm (busybox): Call %store-directory from (guix build utils) instead of referencing "/gnu/store" directly. * guix/packages.scm (patch-and-repack): Likewise. --- gnu/packages/busybox.scm | 5 +++-- guix/packages.scm | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gnu/packages/busybox.scm b/gnu/packages/busybox.scm index d200cd7..13630b3 100644 --- a/gnu/packages/busybox.scm +++ b/gnu/packages/busybox.scm @@ -53,8 +53,9 @@ ;; There is no /usr/bin or /bin - replace it with /gnu/store (substitute* "testsuite/cpio.tests" - (("/usr/bin") "/gnu/store") - (("usr") "gnu")) + (("/usr/bin") (%store-directory)) + (("usr") (car (filter (negate string-null?) + (string-split (%store-directory) #\/))))) (substitute* "testsuite/date/date-works-1" (("/bin/date") (which "date"))) diff --git a/guix/packages.scm b/guix/packages.scm index a979f31..f6dda45 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -466,7 +466,7 @@ IMPORTED-MODULES specify modules to use/import for use by SNIPPET." ;; SOURCE may be either a directory or a tarball. (and (if (file-is-directory? #+source) - (let* ((store (or (getenv "NIX_STORE") "/gnu/store")) + (let* ((store (%store-directory)) (len (+ 1 (string-length store))) (base (string-drop #+source len)) (dash (string-index base #\-)) -- 2.2.1 --=-=-=--