(newline)
(show-build-options-help)
(newline)
+ (show-transformation-options-help)
+ (newline)
(display (G_ "
-h, --help display this help and exit"))
(display (G_ "
(option '("bootstrap") #f #f
(lambda (opt name arg result)
(alist-cons 'bootstrap? #t result)))
- %standard-build-options))
+
+ (append %transformation-options
+ %standard-build-options)))
(define (pick-all alist key)
"Return a list of values in ALIST associated with KEY."
(_ memo)))
'() alist))
-(define (options/resolve-packages opts)
+(define (options/resolve-packages store opts)
"Return OPTS with package specification strings replaced by manifest entries
for the corresponding packages."
(define (manifest-entry=? e1 e2)
(string=? (manifest-entry-output e1)
(manifest-entry-output e2))))
+ (define transform
+ (cut (options->transformation opts) store <>))
+
+ (define* (package->manifest-entry* package #:optional (output "out"))
+ (package->manifest-entry (transform package) output))
+
(define (packages->outputs packages mode)
(match packages
((? package? package)
(if (eq? mode 'ad-hoc-package)
- (list (package->manifest-entry package))
+ (list (package->manifest-entry* package))
(package-environment-inputs package)))
(((? package? package) (? string? output))
(if (eq? mode 'ad-hoc-package)
- (list (package->manifest-entry package output))
+ (list (package->manifest-entry* package output))
(package-environment-inputs package)))
((lst ...)
(append-map (cut packages->outputs <> mode) lst))))
(('package 'ad-hoc-package (? string? spec))
(let-values (((package output)
(specification->package+output spec)))
- (list (package->manifest-entry package output))))
+ (list (package->manifest-entry* package output))))
(('package 'package (? string? spec))
(package-environment-inputs
(specification->package+output spec)))
;; within the container.
'("/bin/sh")
(list %default-shell))))
- (manifest (options/resolve-packages opts))
(mappings (pick-all opts 'file-system-mapping)))
(when container? (assert-container-features))
(with-store store
(with-status-report print-build-event
+ (define manifest
+ (options/resolve-packages store opts))
+
(set-build-options-from-command-line store opts)
;; Use the bootstrap Guile when requested.
# GNU Guix --- Functional package management for GNU
-# Copyright © 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
+# Copyright © 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
#
# This file is part of GNU Guix.
#
# in its profile (e.g., for 'gzip'), but we have to accept them.
guix environment guix --bootstrap -n
+# Try program transformation options.
+mkdir "$tmpdir/emacs-36.8"
+drv="`guix environment --ad-hoc emacs -n 2>&1 | grep 'emacs.*\.drv'`"
+transformed_drv="`guix environment --ad-hoc emacs --with-source="$tmpdir/emacs-36.8" -n 2>&1 | grep 'emacs.*\.drv'`"
+test -n "$drv"
+test "$drv" != "$transformed_drv"
+case "$transformed_drv" in
+ *-emacs-36.8.drv) true;;
+ *) false;;
+esac
+rmdir "$tmpdir/emacs-36.8"
+
if guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/null
then
# Compute the build environment for the initial GNU Make.