emacs: Add support for "triplet" package inputs.

Fixes <http://bugs.gnu.org/21399>.

* emacs/guix-main.scm (full-name->name+version): Adjust to handle
  "name-version:output" string.
  (package-inputs-names): Support ("name" package "output") inputs.
This commit is contained in:
Alex Kost 2015-09-02 17:57:58 +03:00
parent 02615bfa2f
commit 00f34aaafe
1 changed files with 12 additions and 1 deletions

View File

@ -71,7 +71,14 @@
(define (list-maybe obj) (define (list-maybe obj)
(if (list? obj) obj (list obj))) (if (list? obj) obj (list obj)))
(define full-name->name+version package-name->name+version) (define (full-name->name+version spec)
"Given package specification SPEC with or without output,
return two values: name and version. For example, for SPEC
\"foo-0.9.1b:lib\", return \"foo\" and \"0.9.1b\"."
(let-values (((name version output)
(package-specification->name+version+output spec)))
(values name version)))
(define (name+version->full-name name version) (define (name+version->full-name name version)
(string-append name "-" version)) (string-append name "-" version))
@ -247,6 +254,10 @@ Example:
(filter-map (match-lambda (filter-map (match-lambda
((_ (? package? package)) ((_ (? package? package))
(package-full-name package)) (package-full-name package))
((_ (? package? package) output)
(make-package-specification (package-name package)
(package-version package)
output))
(_ #f)) (_ #f))
inputs)) inputs))