summaryrefslogtreecommitdiff
path: root/guix/build/profiles.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-05-06 14:14:58 +0200
committerLudovic Courtès <ludo@gnu.org>2015-05-06 18:26:54 +0200
commit611adb1ee5814907694abc9afa1bad984f0cbea0 (patch)
tree420b455b36d28e7df4a6c2b2bb2bcfd6fdd4a02f /guix/build/profiles.scm
parentd838e7029854d8517c0c5b631f6042a925c86a81 (diff)
downloadgnu-guix-611adb1ee5814907694abc9afa1bad984f0cbea0.tar
gnu-guix-611adb1ee5814907694abc9afa1bad984f0cbea0.tar.gz
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.
Diffstat (limited to 'guix/build/profiles.scm')
-rw-r--r--guix/build/profiles.scm41
1 files changed, 41 insertions, 0 deletions
diff --git a/guix/build/profiles.scm b/guix/build/profiles.scm
new file mode 100644
index 0000000000..1c5b54e40b
--- /dev/null
+++ b/guix/build/profiles.scm
@@ -0,0 +1,41 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
+;;;
+;;; 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