From 8be3b8a39bae9ffaccf3c9a71104d67e73948b20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 10 Mar 2014 23:51:31 +0100 Subject: [PATCH] Change default store values from /nix/store to /gnu/store. * gnu/packages/ld-wrapper.scm (%store-directory): Change the default to /gnu/store. * guix/build/utils.scm (%store-directory): New procedure. (remove-store-references): Use it for the default value of 'store'. * guix/packages.scm (patch-and-repack)[builder]: Change default store to /gnu/store. --- gnu/packages/ld-wrapper.scm | 4 ++-- guix/build/utils.scm | 15 ++++++++++----- guix/packages.scm | 3 +-- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/gnu/packages/ld-wrapper.scm b/gnu/packages/ld-wrapper.scm index 41ff3df986..d3eb083f2f 100644 --- a/gnu/packages/ld-wrapper.scm +++ b/gnu/packages/ld-wrapper.scm @@ -11,7 +11,7 @@ main="(@ (gnu build-support ld-wrapper) ld-wrapper)" exec @GUILE@ -c "(load-compiled \"$0.go\") (apply $main (cdr (command-line)))" "$@" !# ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -63,7 +63,7 @@ exec @GUILE@ -c "(load-compiled \"$0.go\") (apply $main (cdr (command-line)))" " (define %store-directory ;; File name of the store. - (or (getenv "NIX_STORE") "/nix/store")) + (or (getenv "NIX_STORE") "/gnu/store")) (define %temporary-directory ;; Temporary directory. diff --git a/guix/build/utils.scm b/guix/build/utils.scm index a37ace31af..40af785b88 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014 Ludovic Courtès ;;; Copyright © 2013 Andreas Enge ;;; Copyright © 2013 Nikita Karetnikov ;;; @@ -29,7 +29,8 @@ #:use-module (rnrs io ports) #:re-export (alist-cons alist-delete) - #:export (directory-exists? + #:export (%store-directory + directory-exists? executable-file? call-with-ascii-input-file with-directory-excursion @@ -62,6 +63,11 @@ ;;; Directories. ;;; +(define (%store-directory) + "Return the directory name of the store." + (or (getenv "NIX_STORE") + "/gnu/store")) + (define (directory-exists? dir) "Return #t if DIR exists and is a directory." (let ((s (stat dir #f))) @@ -443,7 +449,7 @@ all subject to the substitutions." ;;; -;;; Patching shebangs---e.g., /bin/sh -> /nix/store/xyz...-bash/bin/sh. +;;; Patching shebangs---e.g., /bin/sh -> /gnu/store/xyz...-bash/bin/sh. ;;; (define* (dump-port in out @@ -630,8 +636,7 @@ for each unmatched character." (unmatched (car matched) result))))))) (define* (remove-store-references file - #:optional (store (or (getenv "NIX_STORE") - "/nix/store"))) + #:optional (store (%store-directory))) "Remove from FILE occurrences of file names in STORE; return #t when store paths were encountered in FILE, #f otherwise. This procedure is known as `nuke-refs' in Nixpkgs." diff --git a/guix/packages.scm b/guix/packages.scm index f2119bebce..812d6bb991 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -368,8 +368,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") - "/nix/store")) + (let* ((store (or (getenv "NIX_STORE") "/gnu/store")) (len (+ 1 (string-length store))) (base (string-drop source len)) (dash (string-index base #\-))