From 97b43ab87a35fce3b197edf75f8545cfac5860f7 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/build/utils.scm (%store-directory): Fall back to the value of %store-directory from (guix config) instead of "/gnu/store". * guix/packages.scm (patch-and-repack): Likewise. --- gnu/packages/busybox.scm | 5 +++-- guix/build/utils.scm | 3 ++- guix/packages.scm | 4 +++- 3 files changed, 8 insertions(+), 4 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/build/utils.scm b/guix/build/utils.scm index 676a012..903cea9 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -19,6 +19,7 @@ ;;; along with GNU Guix. If not, see . (define-module (guix build utils) + #:use-module ((guix config) #:prefix config) #:use-module (srfi srfi-1) #:use-module (srfi srfi-11) #:use-module (srfi srfi-60) @@ -80,7 +81,7 @@ (define (%store-directory) "Return the directory name of the store." (or (getenv "NIX_STORE") - "/gnu/store")) + config:%store-directory)) (define (store-file-name? file) "Return true if FILE is in the store." diff --git a/guix/packages.scm b/guix/packages.scm index c955b35..d312d05 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -18,6 +18,7 @@ ;;; along with GNU Guix. If not, see . (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 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 (or (getenv "NIX_STORE") + config:%store-directory)) (len (+ 1 (string-length store))) (base (string-drop #+source len)) (dash (string-index base #\-)) -- 2.2.1