;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
(variables rest ...))))))
(variables %localstatedir %storedir %sysconfdir %system)))
-(define* (make-config.scm #:key zlib gzip xz bzip2
+(define* (make-config.scm #:key gzip xz bzip2
(package-name "GNU Guix")
(package-version "0")
(bug-report-address "bug-guix@gnu.org")
- (home-page-url "https://gnu.org/s/guix"))
+ (home-page-url "https://guix.gnu.org"))
;; Hack so that Geiser is not confused.
(define defmod 'define-module)
(define %bzip2
#+(and bzip2 (file-append bzip2 "/bin/bzip2")))
(define %xz
- #+(and xz (file-append xz "/bin/xz")))
-
- (define %libz
- #+(and zlib
- (file-append zlib "/lib/libz")))))))
+ #+(and xz (file-append xz "/bin/xz")))))))
\f
;;;
(define* (build-program source version
#:optional (guile-version (effective-version))
- #:key (pull-version 0))
+ #:key (pull-version 0) (channel-metadata #f))
"Return a program that computes the derivation to build Guix from SOURCE."
(define select?
;; Select every module but (guix config) and non-Guix modules.
+ ;; Also exclude (guix channels): it is autoloaded by (guix describe), but
+ ;; only for peripheral functionality.
(match-lambda
(('guix 'config) #f)
+ (('guix 'channels) #f)
(('guix _ ...) #t)
(('gnu _ ...) #t)
(_ #f)))
#:select? select?))
(gexp->script "compute-guix-derivation"
#~(begin
- (use-modules (ice-9 match))
+ (use-modules (ice-9 match)
+ (ice-9 threads))
(eval-when (expand load eval)
;; (gnu packages …) modules are going to be looked up
(run-with-store store
(guix-derivation source version
#$guile-version
+ #:channel-metadata
+ '#$channel-metadata
#:pull-version
#$pull-version)
#:system system)
;; The procedure below is our return value.
(define* (build source
- #:key verbose? (version (date-version-string)) system
+ #:key verbose?
+ (version (date-version-string)) channel-metadata
+ system
(pull-version 0)
- ;; For the standalone Guix, default to Guile 2.2. For old
+ ;; For the standalone Guix, default to Guile 3.0. For old
;; versions of 'guix pull' (pre-0.15.0), we have to use the
;; same Guile as the current one.
(guile-version (if (> pull-version 0)
- "2.2"
+ "3.0"
(effective-version)))
#:allow-other-keys
;; Build the build program and then use it as a trampoline to build from
;; SOURCE.
(mlet %store-monad ((build (build-program source version guile-version
+ #:channel-metadata channel-metadata
#:pull-version pull-version))
(system (if system (return system) (current-system)))
(home -> (getenv "HOME"))
(major ((store-lift nix-server-major-version)))
(minor ((store-lift nix-server-minor-version))))
(mbegin %store-monad
- (show-what-to-build* (list build))
+ ;; Before 'with-build-handler' was implemented and used, we had to
+ ;; explicitly call 'show-what-to-build*'.
+ (munless (module-defined? (resolve-module '(guix store))
+ 'with-build-handler)
+ (show-what-to-build* (list build)))
(built-derivations (list build))
;; Use the port beneath the current store as the stdin of BUILD. This
;; $GUILE_LOAD_PATH & co.
(with-clean-environment
(setenv "GUILE_WARN_DEPRECATED" "no") ;be quiet and drive
+ (setenv "COLUMNS" "120") ;show wider backtraces
(when home
;; Inherit HOME so that 'xdg-directory' works.
(setenv "HOME" home))