summary refs log tree commit diff
path: root/gnu/packages/password-utils.scm
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <me@tobias.gr>2022-10-16 02:00:00 +0200
committerTobias Geerinckx-Rice <me@tobias.gr>2022-10-16 02:00:29 +0200
commit07232e6b17247495135fa3285e9eb2bd659bec94 (patch)
tree04eb71786c997b844218271ccd63a31461110cd1 /gnu/packages/password-utils.scm
parent88746cd80bc56212ae7922c0fa1cd9a18e44c3bb (diff)
downloadguix-07232e6b17247495135fa3285e9eb2bd659bec94.tar.gz
gnu: pass-age: Unpropagate inputs.
* gnu/packages/password-utils.scm (pass-age)[arguments]:
Add a new 'wrap-script phase.
[propagated-inputs]: Move them all from here…
[inputs]: …to here.  Add missing procps for /bin/pkill.
Diffstat (limited to 'gnu/packages/password-utils.scm')
-rw-r--r--gnu/packages/password-utils.scm38
1 files changed, 31 insertions, 7 deletions
diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm
index 9c5fd65d37..9d5fd79c58 100644
--- a/gnu/packages/password-utils.scm
+++ b/gnu/packages/password-utils.scm
@@ -636,19 +636,43 @@ through the pass command.")
         (base32 "17899whffnpqqx9x1nx2b8bfxbxlh1pwlglqa0kznl0cn6sb37ql"))))
     (build-system copy-build-system)
     (arguments
-     '(#:phases (modify-phases %standard-phases
-                  (add-after 'unpack 'rename-script
-                    (lambda _
-                      (rename-file "src/password-store.sh"
-                                   "src/passage"))))
+     '(#:modules
+       ((guix build copy-build-system)
+        (guix build utils)
+        (srfi srfi-26))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'rename-script
+           (lambda _
+             (rename-file "src/password-store.sh"
+                          "src/passage")))
+         (add-after 'install 'wrap-script
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (script (string-append out "/bin/passage")))
+               (substitute* script
+                 ;; Avoid ugly ‘.passage-real’ in --help output and elsewhere.
+                 (("^(PROGRAM=).*" _ program=)
+                  (string-append program= (basename script) "\n")))
+               (wrap-program script
+                 `("PATH" ":" prefix
+                   ,(map dirname
+                         (map (cut search-input-file inputs <>)
+                              (list "bin/age"
+                                    "bin/getopt"
+                                    "bin/git"
+                                    "bin/pkill"
+                                    "bin/qrencode"
+                                    "bin/sed"
+                                    "bin/tree")))))))))
        #:install-plan
        '(("src/passage" "/bin/")
          ("src/completion/pass.bash-completion"
           "/share/bash-completion/completions/")
          ("src/completion/pass.zsh-completion"
           "/share/zsh/site-functions/"))))
-    (propagated-inputs
-     (list util-linux git qrencode sed tree age))
+    (inputs
+     (list age git procps qrencode sed tree util-linux))
     (home-page "https://github.com/FiloSottile/passage")
     (synopsis "Encrypted password manager")
     (description "This package provides an encrypted password manager, forked