mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-05-22 17:16:01 +02:00
monads: Add 'package->cross-derivation' and #:target for 'package-file'.
* guix/monads.scm (package-file): Add #:target keyword parameter and
honor it.
(package->cross-derivation): New procedure.
* tests/monads.scm ("package-file + package->cross-derivation"): New test.
* doc/guix.texi (The Store Monad): Update 'package-file' documentation.
Add 'package->cross-derivation'.
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#:select (package-derivation %current-system))
|
||||
#:use-module (gnu packages)
|
||||
#:use-module (gnu packages bootstrap)
|
||||
#:use-module ((gnu packages base) #:select (coreutils))
|
||||
#:use-module (ice-9 match)
|
||||
#:use-module (rnrs io ports)
|
||||
#:use-module (srfi srfi-1)
|
||||
@@ -108,6 +109,16 @@
|
||||
guile)))
|
||||
#:guile-for-build (package-derivation %store %bootstrap-guile)))
|
||||
|
||||
(test-assert "package-file + package->cross-derivation"
|
||||
(run-with-store %store
|
||||
(mlet* %store-monad ((file (package-file coreutils "bin/ls"
|
||||
#:target "foo64-gnu"))
|
||||
(xcu (package->cross-derivation coreutils
|
||||
"foo64-gnu")))
|
||||
(let ((output (derivation->output-path xcu)))
|
||||
(return (string=? file (string-append output "/bin/ls")))))
|
||||
#:guile-for-build (package-derivation %store %bootstrap-guile)))
|
||||
|
||||
(test-assert "interned-file"
|
||||
(run-with-store %store
|
||||
(mlet* %store-monad ((file -> (search-path %load-path "guix.scm"))
|
||||
|
||||
Reference in New Issue
Block a user