Update `HACKING'.
[jackhill/guix/guix.git] / distro.scm
index 2d441f4..c2d3d1f 100644 (file)
@@ -1,20 +1,20 @@
-;;; Guix --- Nix package management from Guile.         -*- coding: utf-8 -*-
-;;; Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2012 Ludovic Courtès <ludo@gnu.org>
 ;;;
-;;; This file is part of Guix.
+;;; This file is part of GNU Guix.
 ;;;
-;;; Guix is free software; you can redistribute it and/or modify it
+;;; GNU Guix is free software; you can redistribute it and/or modify it
 ;;; under the terms of the GNU General Public License as published by
 ;;; the Free Software Foundation; either version 3 of the License, or (at
 ;;; your option) any later version.
 ;;;
-;;; Guix is distributed in the hope that it will be useful, but
+;;; GNU Guix is distributed in the hope that it will be useful, but
 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ;;; GNU General Public License for more details.
 ;;;
 ;;; You should have received a copy of the GNU General Public License
-;;; along with Guix.  If not, see <http://www.gnu.org/licenses/>.
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (distro)
   #:use-module (guix packages)
@@ -26,6 +26,7 @@
   #:export (search-patch
             search-bootstrap-binary
             %patch-directory
+            %bootstrap-binaries-path
             fold-packages
             find-packages-by-name))
 
 
 (define _ (cut gettext <> "guix"))
 
-(define not-colon
-  ;; The char set that contains all the characters but `:'.
-  (char-set-complement (char-set #\:)))
+;; By default, we store patches and bootstrap binaries alongside Guile
+;; modules.  This is so that these extra files can be found without
+;; requiring a special setup, such as a specific installation directory
+;; and an extra environment variable.  One advantage of this setup is
+;; that everything just works in an auto-compilation setting.
 
 (define %patch-path
   (make-parameter
-   (or (and=> (getenv "DISTRO_PATCH_PATH")
-              (cut string-tokenize <> not-colon))
-       (compile-time-value
-        (list (getenv "DISTRO_INSTALLED_PATCH_DIRECTORY"))))))
+   (map (cut string-append <>  "/distro/packages/patches")
+        %load-path)))
 
 (define %bootstrap-binaries-path
   (make-parameter
-   (or (and=> (getenv "DISTRO_BOOTSTRAP_PATH")
-              (cut string-tokenize <> not-colon))
-       (compile-time-value
-        (list (getenv "DISTRO_INSTALLED_BOOTSTRAP_DIRECTORY"))))))
+   (map (cut string-append <> "/distro/packages/bootstrap")
+        %load-path)))
 
 (define (search-patch file-name)
   "Search the patch FILE-NAME."