unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Liliana Marie Prikler <liliana.prikler@gmail.com>
To: 54454@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludo@gnu.org>,
	"Maxime Devos" <maximedevos@telenet.be>,
	"Leo Famulari" <leo@famulari.name>
Subject: [bug#54454] [PATCH v2] ui: Describe package outputs.
Date: Sun, 26 Jun 2022 14:37:56 +0200	[thread overview]
Message-ID: <a4c86a2ce063a2b8e9d09625ce4c622c630d1ab8.camel@gmail.com> (raw)
In-Reply-To: <cf9713d087089126b1f8b9102cb8f37a879fa6fd.camel@gmail.com>

* 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 <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 @@ (define (dependencies->recutils packages)
                                    (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 @@ (define highlighting*
   ;; 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: ")))
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)
 
-- 
2.36.1





  parent reply	other threads:[~2022-06-26 12:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-18 19:16 [bug#54454] [PATCH] ui: Describe package outputs Liliana Marie Prikler
2022-03-18 20:12 ` Maxime Devos
2022-03-18 20:23   ` Liliana Marie Prikler
2022-03-18 20:16 ` Maxime Devos
2022-03-18 20:25   ` Liliana Marie Prikler
2022-03-18 20:50     ` Maxime Devos
2022-03-18 20:54 ` Maxime Devos
2022-03-18 22:24   ` Liliana Marie Prikler
2022-03-18 22:57     ` Maxime Devos
2022-03-18 23:27       ` Liliana Marie Prikler
2022-03-19  8:56         ` Maxime Devos
2022-03-19 10:48           ` Ludovic Courtès
2022-03-19 16:24 ` Leo Famulari
2022-06-26 12:37 ` Liliana Marie Prikler [this message]
2022-08-16 19:37   ` bug#54454: [PATCH v2] " Liliana Marie Prikler
2022-09-02 17:07     ` [bug#54454] " Ludovic Courtès
2022-09-02 17:14       ` Liliana Marie Prikler
2022-09-03  9:53         ` zimoun
2022-09-05  7:25           ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a4c86a2ce063a2b8e9d09625ce4c622c630d1ab8.camel@gmail.com \
    --to=liliana.prikler@gmail.com \
    --cc=54454@debbugs.gnu.org \
    --cc=leo@famulari.name \
    --cc=ludo@gnu.org \
    --cc=maximedevos@telenet.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).