From 37cd5536797450e18ffd5a54595a3453a8a8154f Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Sun, 26 Jun 2022 14:37:56 +0200 Subject: [PATCH] ui: Describe package outputs. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/ui.scm (package->recutils): Output outputs with their descriptions, one per line. * po/packages/Makevars (XGETTEXT_OPTIONS): Add ‘output-synopsis’ as keyword. --- guix/ui.scm | 27 ++++++++++++++++++++++++++- po/packages/Makevars | 3 ++- 2 files changed, 28 insertions(+), 2 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 ;;; Copyright © 2018 Steve Sprang ;;; Copyright © 2022 Taiju HIGASHI +;;; Copyright © 2022 Liliana Marie Prikler ;;; ;;; This file is part of GNU Guix. ;;; @@ -1511,6 +1512,29 @@ that may return a colorized version of its argument." (sort packages packagerecutils 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 (packagerecutils p <>) (package-outputs/out-last p))) (format port "systems: ~a~%" (split-lines (string-join (package-transitive-supported-systems p)) (string-length "systems: "))) diff --git a/po/packages/Makevars b/po/packages/Makevars index 4cdb98d8fe..65912786d8 100644 --- a/po/packages/Makevars +++ b/po/packages/Makevars @@ -10,7 +10,8 @@ top_builddir = ../.. # synopses and descriptions. XGETTEXT_OPTIONS = \ --language=Scheme --from-code=UTF-8 \ - --keyword=synopsis --keyword=description + --keyword=synopsis --keyword=description \ + --keyword=output-synopsis:2 COPYRIGHT_HOLDER = the authors of Guix (msgids)