monads: Remove 'derivation-expression'.
* guix/monads.scm (lower-inputs, derivation-expression): Remove. * tests/monads.scm (derivation-expression, "mlet* + derivation-expression"): Remove.
This commit is contained in:
parent
462a3fa36c
commit
abebac4601
|
@ -389,26 +389,6 @@ cross-compilation target triplet."
|
||||||
(string-append out "/" file)
|
(string-append out "/" file)
|
||||||
out))))
|
out))))
|
||||||
|
|
||||||
(define (lower-inputs inputs)
|
|
||||||
"Turn any package from INPUTS into a derivation; return the corresponding
|
|
||||||
input list as a monadic value."
|
|
||||||
;; XXX: This procedure is bound to disappear with 'derivation-expression'.
|
|
||||||
(with-monad %store-monad
|
|
||||||
(sequence %store-monad
|
|
||||||
(map (match-lambda
|
|
||||||
((name (? package? package) sub-drv ...)
|
|
||||||
(mlet %store-monad ((drv (package->derivation package)))
|
|
||||||
(return `(,name ,drv ,@sub-drv))))
|
|
||||||
((name (? string? file))
|
|
||||||
(return `(,name ,file)))
|
|
||||||
(tuple
|
|
||||||
(return tuple)))
|
|
||||||
inputs))))
|
|
||||||
|
|
||||||
(define derivation-expression
|
|
||||||
;; XXX: This procedure is superseded by 'gexp->derivation'.
|
|
||||||
(store-lift build-expression->derivation))
|
|
||||||
|
|
||||||
(define package->derivation
|
(define package->derivation
|
||||||
(store-lift package-derivation))
|
(store-lift package-derivation))
|
||||||
|
|
||||||
|
|
|
@ -156,27 +156,6 @@
|
||||||
(call-with-input-file b get-string-all))))
|
(call-with-input-file b get-string-all))))
|
||||||
#:guile-for-build (package-derivation %store %bootstrap-guile)))
|
#:guile-for-build (package-derivation %store %bootstrap-guile)))
|
||||||
|
|
||||||
(define derivation-expression
|
|
||||||
(@@ (guix monads) derivation-expression))
|
|
||||||
|
|
||||||
(test-assert "mlet* + derivation-expression"
|
|
||||||
(run-with-store %store
|
|
||||||
(mlet* %store-monad ((guile (package-file %bootstrap-guile "bin/guile"))
|
|
||||||
(gdrv (package->derivation %bootstrap-guile))
|
|
||||||
(exp -> `(let ((out (assoc-ref %outputs "out")))
|
|
||||||
(mkdir out)
|
|
||||||
(symlink ,guile
|
|
||||||
(string-append out "/guile-rocks"))))
|
|
||||||
(drv (derivation-expression "rocks" exp
|
|
||||||
#:inputs
|
|
||||||
`(("g" ,gdrv))))
|
|
||||||
(out -> (derivation->output-path drv))
|
|
||||||
(built? (built-derivations (list drv))))
|
|
||||||
(return (and built?
|
|
||||||
(equal? guile
|
|
||||||
(readlink (string-append out "/guile-rocks"))))))
|
|
||||||
#:guile-for-build (package-derivation %store %bootstrap-guile)))
|
|
||||||
|
|
||||||
(test-assert "mapm"
|
(test-assert "mapm"
|
||||||
(every (lambda (monad run)
|
(every (lambda (monad run)
|
||||||
(with-monad monad
|
(with-monad monad
|
||||||
|
|
Loading…
Reference in New Issue