guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/04: profiles: Move build code to (guix build profiles).


From: Ludovic Courtès
Subject: 02/04: profiles: Move build code to (guix build profiles).
Date: Wed, 06 May 2015 16:31:44 +0000

civodul pushed a commit to branch master
in repository guix.

commit 611adb1ee5814907694abc9afa1bad984f0cbea0
Author: Ludovic Courtès <address@hidden>
Date:   Wed May 6 14:14:58 2015 +0200

    profiles: Move build code to (guix build profiles).
    
    * guix/build/profiles.scm: New file.
    * Makefile.am (MODULES): Add it.
    * guix/profiles.scm (profile-derivation)[builder]: Call out to
      'build-profile'.
      Add (guix build profiles) to the #:modules argument.
---
 Makefile.am             |    1 +
 guix/build/profiles.scm |   41 +++++++++++++++++++++++++++++++++++++++++
 guix/profiles.scm       |   13 +++++--------
 3 files changed, 47 insertions(+), 8 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index ae694eb..4fc1fc2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -79,6 +79,7 @@ MODULES =                                     \
   guix/build/store-copy.scm                    \
   guix/build/utils.scm                         \
   guix/build/union.scm                         \
+  guix/build/profiles.scm                      \
   guix/build/pull.scm                          \
   guix/build/rpath.scm                         \
   guix/build/cvs.scm                           \
diff --git a/guix/build/profiles.scm b/guix/build/profiles.scm
new file mode 100644
index 0000000..1c5b54e
--- /dev/null
+++ b/guix/build/profiles.scm
@@ -0,0 +1,41 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2015 Ludovic Courtès <address@hidden>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; 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.
+;;;
+;;; 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 GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix build profiles)
+  #:use-module (guix build union)
+  #:use-module (ice-9 pretty-print)
+  #:export (build-profile))
+
+;;; Commentary:
+;;;
+;;; Build a user profile (essentially the union of all the installed packages)
+;;; with its associated meta-data.
+;;;
+;;; Code:
+
+(define* (build-profile output inputs
+                        #:key manifest)
+  "Build a user profile from INPUTS in directory OUTPUT.  Write MANIFEST, an
+sexp, to OUTPUT/manifest."
+  (union-build output inputs
+               #:log-port (%make-void-port "w"))
+  (call-with-output-file (string-append output "/manifest")
+    (lambda (p)
+      (pretty-print manifest p))))
+
+;;; profile.scm ends here
diff --git a/guix/profiles.scm b/guix/profiles.scm
index 8445e00..afc22e1 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -598,20 +598,17 @@ the monadic procedures listed in HOOKS--such as an Info 
'dir' file, etc."
 
     (define builder
       #~(begin
-          (use-modules (ice-9 pretty-print)
-                       (guix build union))
+          (use-modules (guix build profiles))
 
           (setvbuf (current-output-port) _IOLBF)
           (setvbuf (current-error-port) _IOLBF)
 
-          (union-build #$output '#$inputs
-                       #:log-port (%make-void-port "w"))
-          (call-with-output-file (string-append #$output "/manifest")
-            (lambda (p)
-              (pretty-print '#$(manifest->gexp manifest) p)))))
+          (build-profile #$output '#$inputs
+                         #:manifest '#$(manifest->gexp manifest))))
 
     (gexp->derivation "profile" builder
-                      #:modules '((guix build union))
+                      #:modules '((guix build union)
+                                  (guix build profiles))
                       #:local-build? #t)))
 
 (define (profile-regexp profile)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]