[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
17/38: build-system/asdf: Handle all asdf dependency specifications.
From: |
Pierre Neidhardt |
Subject: |
17/38: build-system/asdf: Handle all asdf dependency specifications. |
Date: |
Tue, 2 Oct 2018 14:00:11 -0400 (EDT) |
ambrevar pushed a commit to branch wip-next-browser
in repository guix.
commit beab07cf618abfed2675e66b253586dc36298cb9
Author: Andy Patterson <address@hidden>
Date: Thu Aug 30 01:36:28 2018 -0400
build-system/asdf: Handle all asdf dependency specifications.
Add support for dependencies of the form (:version <name> <version>),
(:feature <feature> <dependency-specification>) and (:require
<module-name>),
as defined by
<https://common-lisp.net/project/asdf/asdf.html#The-defsystem-grammar>.
* guix/build/lisp-utils.scm (normalize-dependency): New variable.
(make-asd-file)[dependencies]: Use it to generate dependencies with
normalized
names.
[dependency-name]: New variable.
[registry]: Use it to flatten the normalized dependencies.
Signed-off-by: Ludovic Courtès <address@hidden>
---
guix/build/lisp-utils.scm | 26 ++++++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/guix/build/lisp-utils.scm b/guix/build/lisp-utils.scm
index 21cb620..3a7afab 100644
--- a/guix/build/lisp-utils.scm
+++ b/guix/build/lisp-utils.scm
@@ -81,6 +81,20 @@
"Replace invalid characters in STR with a hyphen."
(string-join (string-tokenize str valid-char-set) "-"))
+(define (normalize-dependency dependency)
+ "Normalize the name of DEPENDENCY. Handles dependency definitions of the
+dependency-def form described by
+<https://common-lisp.net/project/asdf/asdf.html#The-defsystem-grammar>."
+ (match dependency
+ ((':version name rest ...)
+ `(:version ,(normalize-string name) ,@rest))
+ ((':feature feature-specification dependency-specification)
+ `(:feature
+ ,feature-specification
+ ,(normalize-dependency dependency-specification)))
+ ((? string? name) (normalize-string name))
+ (require-specification require-specification)))
+
(define (inputs->asd-file-map inputs)
"Produce a hash table of the form (system . asd-file), where system is the
name of an ASD system, and asd-file is the full path to its definition."
@@ -273,16 +287,24 @@ system to find its dependencies, as described by
GENERATE-DEPENDENCY-LINKS."
(system-dependencies system system-asd-file)))
(if (eq? 'NIL deps)
'()
- (map normalize-string deps))))
+ (map normalize-dependency deps))))
(define lisp-input-map
(inputs->asd-file-map inputs))
+ (define dependency-name
+ (match-lambda
+ ((':version name _ ...) name)
+ ((':feature _ dependency-specification)
+ (dependency-name dependency-specification))
+ ((? string? name) name)
+ (_ #f)))
+
(define registry
(filter-map hash-get-handle
(make-list (length dependencies)
lisp-input-map)
- dependencies))
+ (map dependency-name dependencies)))
(call-with-output-file asd-file
(lambda (port)
- 10/38: gnu: Add prove-asdf., (continued)
- 10/38: gnu: Add prove-asdf., Pierre Neidhardt, 2018/10/02
- 07/38: gnu: Add let-plus., Pierre Neidhardt, 2018/10/02
- 09/38: gnu: Add cl-ansi-text., Pierre Neidhardt, 2018/10/02
- 12/38: gnu: Add proc-parse., Pierre Neidhardt, 2018/10/02
- 18/38: build-system/asdf (FIX), Pierre Neidhardt, 2018/10/02
- 20/38: lift (FIX), Pierre Neidhardt, 2018/10/02
- 28/38: gnu: Add queues., Pierre Neidhardt, 2018/10/02
- 21/38: let-plus (FIX), Pierre Neidhardt, 2018/10/02
- 24/38: prove-asdf (FIX), Pierre Neidhardt, 2018/10/02
- 29/38: gnu: Add queues.simple-queue., Pierre Neidhardt, 2018/10/02
- 17/38: build-system/asdf: Handle all asdf dependency specifications.,
Pierre Neidhardt <=
- 06/38: gnu: Add lift., Pierre Neidhardt, 2018/10/02
- 31/38: gnu: Add queues.priority-queue., Pierre Neidhardt, 2018/10/02
- 08/38: gnu: Add cl-colors., Pierre Neidhardt, 2018/10/02
- 15/38: cl-string-match (FIX), Pierre Neidhardt, 2018/10/02
- 19/38: anaphora (FIX), Pierre Neidhardt, 2018/10/02
- 14/38: gnu: Add simple-scanf., Pierre Neidhardt, 2018/10/02
- 30/38: gnu: Add queues.simple-cqueue., Pierre Neidhardt, 2018/10/02
- 16/38: Revert "build-system/asdf: Fix normalize-string to support versioned dependencies", Pierre Neidhardt, 2018/10/02
- 27/38: gnu: Add puri., Pierre Neidhardt, 2018/10/02
- 26/38: gnu: Add ptester., Pierre Neidhardt, 2018/10/02