* gnu/ci.scm (channel-build-system): Move to guix/channels.scm.
(channel-source->package): Move to
gnu/packages/package-management.scm.
* guix/channels.scm (channel-build-system): Moved from gnu/ci.scm.
* gnu/packages/package-management.scm (channel-source->package): Moved
* etc/system-tests.scm: Use module (gnu packages package-management)
etc/system-tests.scm | 1 -
gnu/ci.scm | 38 -----------------------------
gnu/packages/package-management.scm | 16 ++++++++++++
guix/channels.scm | 27 ++++++++++++++++++++
4 files changed, 43 insertions(+), 39 deletions(-)
Toggle diff (163 lines)
diff --git a/etc/system-tests.scm b/etc/system-tests.scm
index 1085deed24..ba0c106553 100644
--- a/etc/system-tests.scm
+++ b/etc/system-tests.scm
(gnu packages package-management)
- ((gnu ci) #:select (channel-source->package))
((guix git-download) #:select (git-predicate))
((guix utils) #:select (current-source-directory))
diff --git a/gnu/ci.scm b/gnu/ci.scm
index 35fd583f75..be19bda413 100644
@@ -32,7 +32,6 @@ (define-module (gnu ci)
#:use-module (guix channels)
#:use-module (guix config)
#:use-module (guix derivations)
- #:use-module (guix build-system)
#:use-module (guix monads)
@@ -72,7 +71,6 @@ (define-module (gnu ci)
- channel-source->package
@@ -300,42 +298,6 @@ (define MiB
-(define channel-build-system
- ;; Build system used to "convert" a channel instance to a package.
- (let* ((build (lambda* (name inputs
- #:key source commit system
- (mlet* %store-monad ((source (if (string? source)
- (lower-object source)))
- -> (checkout->channel-instance
- source #:commit commit)))
- (channel-instances->derivation (list instance)))))
- (lower (lambda* (name #:key system source commit
- (arguments `(#:source ,source
- (build-system (name 'channel)
- (description "Turn a channel instance into a package.")
-(define* (channel-source->package source #:key commit)
- "Return a package for the given channel SOURCE, a lowerable object."
- (version (string-append (package-version guix) "+"))
- (build-system channel-build-system)
- (arguments `(#:source ,source
- (propagated-inputs '())))
(define* (system-test-jobs store system
"Return a list of jobs for the system tests."
diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index 03cc9a6612..edef91ff7e 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -114,6 +114,9 @@ (define-module (gnu packages package-management)
#:use-module (guix build-system meson)
#:use-module (guix build-system python)
#:use-module (guix build-system trivial)
+ ;; This will be loaded by build-self.scm, but guile-git is unavailable, so
+ ;; lazily load instead.
+ #:autoload (guix channels) (channel-build-system guix-channel?)
#:use-module (guix download)
#:use-module (guix git-download)
@@ -572,6 +575,19 @@ (define (wrong-extension? file)
+(define-public channel-source->package
+ (lambda* (source #:key commit)
+ "Return a package for the given channel SOURCE, a lowerable object."
+ (version (string-append (package-version guix) "+"))
+ (build-system channel-build-system)
+ (arguments `(#:source ,source
+ (propagated-inputs '()))))
(define-public current-guix-package
;; This parameter allows callers to override the package that 'current-guix'
;; returns. This is useful when 'current-guix' cannot compute it by itself,
diff --git a/guix/channels.scm b/guix/channels.scm
index 5f47834c10..d637d5863a 100644
@@ -27,6 +27,7 @@ (define-module (guix channels)
#:select (openpgp-public-key-fingerprint
openpgp-format-fingerprint))
#:use-module (guix base16)
+ #:use-module (guix build-system)
#:use-module (guix records)
#:use-module (guix modules)
@@ -93,6 +94,8 @@ (define-module (guix channels)
channel-instances->derivation
ensure-forward-channel-update
@@ -952,6 +955,30 @@ (define* (latest-channel-derivation #:optional (channels %default-channels)
(channel-instances->derivation instances)))
+(define channel-build-system
+ ;; Build system used to "convert" a channel instance to a package.
+ (let* ((build (lambda* (name inputs
+ #:key source commit system
+ (mlet* %store-monad ((source (if (string? source)
+ (lower-object source)))
+ -> (checkout->channel-instance
+ source #:commit commit)))
+ (channel-instances->derivation (list instance)))))
+ (lower (lambda* (name #:key system source commit
+ (arguments `(#:source ,source
+ (build-system (name 'channel)
+ (description "Turn a channel instance into a package.")
(define* (sexp->channel sexp #:optional (name 'channel))
"Read SEXP, a provenance sexp as created by 'channel-instance->sexp'; use
NAME as the channel name if SEXP does not specify it. Return #f if the sexp