diff options
author | Mark H Weaver <mhw@netris.org> | 2015-01-13 12:14:08 -0500 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2015-01-13 12:14:08 -0500 |
commit | a813710a5fb0822e9d95088462d70f6522fe8457 (patch) | |
tree | 35299db4712eda92c809635716d530d085223e81 /guix/gexp.scm | |
parent | d8cd15949092b7cd90ee1dcc4aefe87b3ba4a6fb (diff) | |
parent | 765f0ac8f9f67f775a667a4276faf85ddde6d7ea (diff) |
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/gexp.scm')
-rw-r--r-- | guix/gexp.scm | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/guix/gexp.scm b/guix/gexp.scm index 78e11f5850..d13e1c46da 100644 --- a/guix/gexp.scm +++ b/guix/gexp.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -33,7 +33,8 @@ gexp? gexp->derivation gexp->file - gexp->script)) + gexp->script + text-file*)) ;;; Commentary: ;;; @@ -522,6 +523,18 @@ its search path." (write '(ungexp exp) port)))) #:local-build? #t)) +(define* (text-file* name #:rest text) + "Return as a monadic value a derivation that builds a text file containing +all of TEXT. TEXT may list, in addition to strings, packages, derivations, +and store file names; the resulting store file holds references to all these." + (define builder + (gexp (call-with-output-file (ungexp output "out") + (lambda (port) + (display (string-append (ungexp-splicing text)) port))))) + + (gexp->derivation name builder)) + + ;;; ;;; Syntactic sugar. |