1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-05-27 11:32:21 +02:00

gexp: Add 'mixed-text-file'.

* guix/gexp.scm (mixed-text-file): New procedure.
* tests/gexp.scm ("mixed-text-file"): New test.
* doc/guix.texi (G-Expressions): Document it.
This commit is contained in:
Ludovic Courtès
2015-09-09 09:44:43 +02:00
parent 15a01c7220
commit b751cde36b
3 changed files with 44 additions and 0 deletions
+15
View File
@@ -660,6 +660,21 @@
file)))))
#:guile-for-build (package-derivation %store %bootstrap-guile))))
(test-assertm "mixed-text-file"
(mlet* %store-monad ((file -> (mixed-text-file "mixed"
"export PATH="
%bootstrap-guile "/bin"))
(drv (lower-object file))
(out -> (derivation->output-path drv))
(guile-drv (package->derivation %bootstrap-guile))
(guile -> (derivation->output-path guile-drv)))
(mbegin %store-monad
(built-derivations (list drv))
(mlet %store-monad ((refs ((store-lift references) out)))
(return (and (string=? (string-append "export PATH=" guile "/bin")
(call-with-input-file out get-string-all))
(equal? refs (list guile))))))))
(test-assert "gexp->derivation vs. %current-target-system"
(let ((mval (gexp->derivation "foo"
#~(begin