aboutsummaryrefslogtreecommitdiff
path: root/guix/scripts.scm
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2015-10-09 16:45:24 +0300
committerAlex Kost <alezost@gmail.com>2015-10-12 10:59:31 +0300
commitad8b83bda052a12077d5da4c3c9b3d3d0911025a (patch)
tree12fc3d3b11e76f4337a423f3d044223e97fbd77e /guix/scripts.scm
parent9d373377c96d9e83653f9edc04bbc8566a5174b6 (diff)
downloadgnu-guix-ad8b83bda052a12077d5da4c3c9b3d3d0911025a.tar
gnu-guix-ad8b83bda052a12077d5da4c3c9b3d3d0911025a.tar.gz
emacs: Add 'guix-devel-build-package-source'.
Suggested by Ludovic Courtès <ludo@gnu.org>. * guix/scripts.scm (build-package-source): New procedure. * emacs/guix-devel.el (guix-devel-build-package-source): New command. (guix-devel-keys-map): Add key binding for it. * doc/emacs.texi (Emacs Development): Document it.
Diffstat (limited to 'guix/scripts.scm')
-rw-r--r--guix/scripts.scm20
1 files changed, 19 insertions, 1 deletions
diff --git a/guix/scripts.scm b/guix/scripts.scm
index e34d38904c..d84375f570 100644
--- a/guix/scripts.scm
+++ b/guix/scripts.scm
@@ -31,7 +31,8 @@
#:export (args-fold*
parse-command-line
maybe-build
- build-package))
+ build-package
+ build-package-source))
;;; Commentary:
;;;
@@ -115,4 +116,21 @@ Show what and how will/would be built."
#:dry-run? dry-run?)
(return (show-derivation-outputs derivation))))))
+(define* (build-package-source package
+ #:key dry-run? (use-substitutes? #t)
+ #:allow-other-keys
+ #:rest build-options)
+ "Build PACKAGE source using BUILD-OPTIONS."
+ (mbegin %store-monad
+ (apply set-build-options*
+ #:use-substitutes? use-substitutes?
+ (strip-keyword-arguments '(#:dry-run?) build-options))
+ (mlet %store-monad ((derivation (origin->derivation
+ (package-source package))))
+ (mbegin %store-monad
+ (maybe-build (list derivation)
+ #:use-substitutes? use-substitutes?
+ #:dry-run? dry-run?)
+ (return (show-derivation-outputs derivation))))))
+
;;; scripts.scm ends here