summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
Diffstat (limited to 'guix')
-rw-r--r--guix/build/pull.scm5
-rw-r--r--guix/scripts/build.scm8
-rw-r--r--guix/scripts/package.scm6
-rw-r--r--guix/ui.scm23
4 files changed, 34 insertions, 8 deletions
diff --git a/guix/build/pull.scm b/guix/build/pull.scm
index 4bad88fe42..e5b8797503 100644
--- a/guix/build/pull.scm
+++ b/guix/build/pull.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -94,10 +94,11 @@ exit with non-zero."
(format #t "copying and compiling Guix to `~a'...~%" out)
- ;; Copy everything under guix/ and gnu/ plus guix.scm.
+ ;; Copy everything under guix/ and gnu/ plus {guix,gnu}.scm.
(copy-recursively "guix" (string-append out "/guix"))
(copy-recursively "gnu" (string-append out "/gnu"))
(copy-file "guix.scm" (string-append out "/guix.scm"))
+ (copy-file "gnu.scm" (string-append out "/gnu.scm"))
;; Add a fake (guix config) module to allow the other modules to be
;; compiled. The user's (guix config) is the one that will be used.
diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index 35b10a0ec2..5e4647de79 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -24,6 +24,7 @@
#:use-module (guix packages)
#:use-module (guix utils)
#:use-module (guix monads)
+ #:use-module (guix gexp)
#:use-module (ice-9 format)
#:use-module (ice-9 match)
#:use-module (ice-9 vlist)
@@ -151,6 +152,7 @@ options handled by 'set-build-options-from-command-line', and listed in
#:use-build-hook? (assoc-ref opts 'build-hook?)
#:max-silent-time (assoc-ref opts 'max-silent-time)
#:timeout (assoc-ref opts 'timeout)
+ #:print-build-trace (assoc-ref opts 'print-build-trace?)
#:verbosity (assoc-ref opts 'verbosity)))
(define %standard-build-options
@@ -213,6 +215,7 @@ options handled by 'set-build-options-from-command-line', and listed in
`((system . ,(%current-system))
(substitutes? . #t)
(build-hook? . #t)
+ (print-build-trace? . #t)
(max-silent-time . 3600)
(verbosity . 0)))
@@ -336,6 +339,11 @@ packages."
`(argument . ,p))
((? procedure? proc)
(let ((drv (run-with-store store (proc) #:system system)))
+ `(argument . ,drv)))
+ ((? gexp? gexp)
+ (let ((drv (run-with-store store
+ (gexp->derivation "gexp" gexp
+ #:system system))))
`(argument . ,drv)))))
(opt opt))
opts))
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 3947159c2e..f930b00804 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -228,11 +228,11 @@ RX."
(define matches?
(cut regexp-exec rx <>))
- (if (or (matches? (gettext (package-name package)))
+ (if (or (matches? (package-name package))
(and=> (package-synopsis package)
- (compose matches? gettext))
+ (compose matches? P_))
(and=> (package-description package)
- (compose matches? gettext)))
+ (compose matches? P_)))
(cons package result)
result))
'())
diff --git a/guix/ui.scm b/guix/ui.scm
index 48b5c745c6..7338b82401 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -39,6 +39,7 @@
#:use-module (ice-9 regex)
#:export (_
N_
+ P_
leave
show-version-and-exit
show-bug-report-information
@@ -72,10 +73,16 @@
;;; Code:
(define %gettext-domain
+ ;; Text domain for strings used in the tools.
"guix")
+(define %package-text-domain
+ ;; Text domain for package synopses and descriptions.
+ "guix-packages")
+
(define _ (cut gettext <> %gettext-domain))
(define N_ (cut ngettext <> <> <> %gettext-domain))
+(define P_ (cut gettext <> %package-text-domain))
(define-syntax-rule (define-diagnostic name prefix)
"Create a diagnostic macro (i.e., NAME), which will prepend PREFIX to all
@@ -231,6 +238,16 @@ interpreted."
(leave (_ "~a: ~a~%") proc
(apply format #f format-string format-args))))))
+(define %guix-user-module
+ ;; Module in which user expressions are evaluated.
+ ;; Compute lazily to avoid circularity with (guix gexp).
+ (delay
+ (let ((module (make-module)))
+ (beautify-user-module! module)
+ ;; Use (guix gexp) so that one can use #~ & co.
+ (module-use! module (resolve-interface '(guix gexp)))
+ module)))
+
(define (read/eval str)
"Read and evaluate STR, raising an error if something goes wrong."
(let ((exp (catch #t
@@ -241,7 +258,7 @@ interpreted."
str args)))))
(catch #t
(lambda ()
- (eval exp the-root-module))
+ (eval exp (force %guix-user-module)))
(lambda args
(leave (_ "failed to evaluate expression `~a': ~s~%")
exp args)))))
@@ -431,7 +448,7 @@ followed by \"+ \", which makes for a valid multi-line field value in the
"Write to PORT a `recutils' record of package P, arranging to fit within
WIDTH columns."
(define (description->recutils str)
- (let ((str (_ str)))
+ (let ((str (P_ str)))
(string->recutils
(fill-paragraph str width
(string-length "description: ")))))
@@ -460,7 +477,7 @@ WIDTH columns."
(string-map (match-lambda
(#\newline #\space)
(chr chr))
- (or (and=> (package-synopsis p) _)
+ (or (and=> (package-synopsis p) P_)
"")))
(format port "description: ~a~%"
(and=> (package-description p) description->recutils))