Patchwork gnu: password-store: Wrap PATH.

login
register
mail settings
Submitter Alex Griffin
Date July 29, 2016, 12:20 a.m.
Message ID <1469751624.114434.679895025.599AB6DD@webmail.messagingengine.com>
Download mbox | patch
Permalink /patch/14130/
State New
Headers show

Comments

Alex Griffin - July 29, 2016, 12:20 a.m.
This patch fixes password-store so that you no longer need to install
its dependencies into your profile.

Patch

From 60527038221d2c1c0d35ca97a65ba2a01734da75 Mon Sep 17 00:00:00 2001
From: Alex Griffin <a@ajgrf.com>
Date: Thu, 28 Jul 2016 19:06:10 -0500
Subject: [PATCH] gnu: password-store: Wrap PATH.

* gnu/packages/password-utils.scm (password-store):
[arguments]: Wrap PATH more thoroughly.
[native-inputs]: Move getopt to inputs.
[inputs]: Add sed & alphabetize packages.
---
 gnu/packages/password-utils.scm | 32 +++++++++++++++-----------------
 1 file changed, 15 insertions(+), 17 deletions(-)

diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm
index a03214a..eda800b 100644
--- a/gnu/packages/password-utils.scm
+++ b/gnu/packages/password-utils.scm
@@ -266,27 +266,25 @@  any X11 window.")
      '(#:phases
        (modify-phases %standard-phases
          (delete 'configure)
-         (add-after
-          ;; The script requires 'getopt' at run-time, and this allows
-          ;; the user to not install the providing package 'util-linux'
-          ;; in their profile.
-          'unpack 'patch-path
-          (lambda* (#:key inputs outputs #:allow-other-keys)
-            (let ((getopt (string-append (assoc-ref inputs "getopt")
-                                         "/bin/getopt")))
-              (substitute* "src/password-store.sh"
-                (("GETOPT=\"getopt\"")
-                 (string-append "GETOPT=\"" getopt "\"")))
-              #t))))
+         (add-after 'install 'wrap-path
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (path (map (lambda (pkg)
+                                 (string-append (assoc-ref inputs pkg) "/bin"))
+                               '("coreutils" "getopt" "git" "gnupg" "pwgen"
+                                 "sed" "tree" "which" "xclip"))))
+               (wrap-program (string-append out "/bin/pass")
+                 `("PATH" ":" prefix (,(string-join path ":"))))))))
        #:make-flags (list "CC=gcc" (string-append "PREFIX=" %output))
        #:test-target "test"))
-    (native-inputs `(("getopt" ,util-linux))) ; getopt for the tests
-    (inputs `(("gnupg" ,gnupg)
-              ("pwgen" ,pwgen)
-              ("xclip" ,xclip)
+    (inputs `(("getopt" ,util-linux)
               ("git" ,git)
+              ("gnupg" ,gnupg)
+              ("pwgen" ,pwgen)
+              ("sed" ,sed)
               ("tree" ,tree)
-              ("which" ,which)))
+              ("which" ,which)
+              ("xclip" ,xclip)))
     (home-page "http://www.passwordstore.org/")
     (synopsis "Encrypted password manager")
     (description "Password-store is a password manager which uses GnuPG to
-- 
2.9.2