Subject: [PATCH v3 1/1] gnu: libsecret: Add bin output.

From: Gabriel Santos <[email-masked]>
Date: Sun, 27 Apr 2025 15:41:44 -0300

* gnu/packages/gnome.scm (libsecret): Add "bin" output.

Change-Id: I4f07c0f040b980b557c72d299fb02e8ccb2cb521
---
 gnu/packages/gnome.scm | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 26416df155..a79a8d841f 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -82,6 +82,7 @@
 ;;; Copyright © 2024 Justin Veilleux <[email-masked]>
 ;;; Copyright © 2025 Noé Lopez <[email-masked]>
 ;;; Copyright © 2025 Ashvith Shetty <[email-masked]>
+;;; Copyright © 2025 Gabriel Santos <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -5350,10 +5351,13 @@ (define-public libsecret
                (base32
                 "081bj59ws08kb261cd1w1mkdkhfbzsjbbkkrm6wllvdyhgbhhg8n"))))
     (build-system meson-build-system)
+    (outputs '("out" "bin"))
     (arguments
      (list
       #:configure-flags
-      #~(list "-Dgtk_doc=false")        ;requires gi-docgen
+      #~(list "-Dgtk_doc=false" ;requires gi-docgen
+              (string-append "--bindir="
+                             #$output:bin "/bin"))
       #:phases
       #~(modify-phases %standard-phases
           (delete 'check)
@@ -5362,11 +5366,19 @@ (define-public libsecret
               (when tests?
                 (setenv "HOME" "/tmp")
                 (setenv "XDG_DATA_DIRS" ;for /org/freedesktop/secrets/collection
-                        (string-append #$output "/share:"
+                        (string-append #$output:out "/share:"
                                        (getenv "XDG_DATA_DIRS")))
                 (apply invoke "dbus-run-session" "--"
                        "meson" "test" "--print-errorlogs" "-t" "0"
-                       test-options)))))))
+                       test-options))))
+          (add-after 'compress-documentation 'install-man-to-bin
+            (lambda* (#:key outputs #:allow-other-keys)
+              (let ((out (assoc-ref outputs "out"))
+                    (bin (assoc-ref outputs "bin"))
+                    (man "/share/man/man1"))
+                (mkdir-p (string-append bin man))
+                (copy-file (string-append out man "/secret-tool.1.zst")
+                           (string-append bin man "/secret-tool.1.zst"))))))))
     (native-inputs
      (list dbus
            docbook-xml-4.2
-- 
2.49.0