summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLiliana Marie Prikler <liliana.prikler@gmail.com>2022-06-26 14:37:56 +0200
committerLiliana Marie Prikler <liliana.prikler@gmail.com>2022-08-16 21:25:25 +0200
commit37cd5536797450e18ffd5a54595a3453a8a8154f (patch)
tree4cf8dea726ce8d1d975c4dcf3e80753047aae84c /guix
parent0193f9dd0304b90b4dfaebc0eb775187258e6fab (diff)
downloadguix-patches-37cd5536797450e18ffd5a54595a3453a8a8154f.tar
guix-patches-37cd5536797450e18ffd5a54595a3453a8a8154f.tar.gz
ui: Describe package outputs.
* guix/ui.scm (package->recutils): Output outputs with their descriptions, one per line. * po/packages/Makevars (XGETTEXT_OPTIONS): Add ‘output-synopsis’ as keyword.
Diffstat (limited to 'guix')
-rw-r--r--guix/ui.scm27
1 files changed, 26 insertions, 1 deletions
diff --git a/guix/ui.scm b/guix/ui.scm
index a7acd41440..dad2b853ac 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -18,6 +18,7 @@
;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2018 Steve Sprang <scs@stevesprang.com>
;;; Copyright © 2022 Taiju HIGASHI <higashi@taiju.info>
+;;; Copyright © 2022 Liliana Marie Prikler <liliana.prikler@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1511,6 +1512,29 @@ that may return a colorized version of its argument."
(sort packages package<?))) " ")))
(split-lines list (string-length "dependencies: "))))
+ (define (output->recutils package output)
+ (string-append
+ "+ " output ": "
+ (or
+ (any
+ (match-lambda
+ (('output-synopsis key synopsis)
+ (and (string=? key output) (P_ synopsis)))
+ (_ #f))
+ (package-properties package))
+ (assoc-ref `(("bin" . ,(G_ "executable programs and scripts"))
+ ("debug" . ,(G_ "debug information"))
+ ("lib" . ,(G_ "shared libraries"))
+ ("static" . ,(G_ "static libraries"))
+ ("out" . ,(G_ "everything else")))
+ output)
+ (G_ "see Appendix H"))))
+
+ (define (package-outputs/out-last package)
+ ((compose append partition)
+ (negate (cut string=? "out" <>))
+ (package-outputs package)))
+
(define (package<? p1 p2)
(string<? (package-full-name p1) (package-full-name p2)))
@@ -1522,7 +1546,8 @@ that may return a colorized version of its argument."
;; Note: Don't i18n field names so that people can post-process it.
(format port "name: ~a~%" (highlight (package-name p) port*))
(format port "version: ~a~%" (highlight (package-version p) port*))
- (format port "outputs: ~a~%" (string-join (package-outputs p)))
+ (format port "outputs:~%~{~a~%~}"
+ (map (cut output->recutils p <>) (package-outputs/out-last p)))
(format port "systems: ~a~%"
(split-lines (string-join (package-transitive-supported-systems p))
(string-length "systems: ")))