Subject: [PATCH 1/2] gnu: password-store: Allow external packages to provide extensions.

From: "Alex Griffin" <[email-masked]>
Date: Sat, 20 Apr 2019 13:54:52 -0400

* gnu/packages/password-utils.scm (password-store): Add environment variable
PASSWORD_STORE_SYSTEM_EXTENSION_DIR to support pass extensions in external
packages.
[arguments]: Add patch-system-extension-dir phase.

-- 
Alex Griffin

From c927c48cc4bf4dc564bc441d4574dea79c05b472 Mon Sep 17 00:00:00 2001
From: Alex Griffin <[email-masked]>
Date: Sat, 20 Apr 2019 11:56:23 -0500
Subject: [PATCH 1/2] gnu: password-store: Allow external packages to provide
 extensions.

* gnu/packages/password-utils.scm (password-store): Add environment variable
PASSWORD_STORE_SYSTEM_EXTENSION_DIR to support pass extensions in external
packages.
[arguments]: Add patch-system-extension-dir phase.
---
 gnu/packages/password-utils.scm | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm
index 5c11d8c437..b23dbf1fbb 100644
--- a/gnu/packages/password-utils.scm
+++ b/gnu/packages/password-utils.scm
@@ -6,7 +6,7 @@
 ;;; Copyright © 2016 Jessica Tallon <[email-masked]>
 ;;; Copyright © 2016 Andreas Enge <[email-masked]>
 ;;; Copyright © 2016 Lukas Gradl <[email-masked]>
-;;; Copyright © 2016 Alex Griffin <[email-masked]>
+;;; Copyright © 2016, 2019 Alex Griffin <[email-masked]>
 ;;; Copyright © 2017 Leo Famulari <[email-masked]>
 ;;; Copyright © 2017, 2018 Clément Lassieur <[email-masked]>
 ;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <[email-masked]>
@@ -423,6 +423,18 @@ any X11 window.")
        (modify-phases %standard-phases
          (delete 'configure)
          (delete 'build)
+         (add-before 'install 'patch-system-extension-dir
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (extension-dir (string-append out "/lib/password-store/extensions")))
+               (substitute* "src/password-store.sh"
+                 (("^SYSTEM_EXTENSION_DIR=.*$")
+                  ;; lead with whitespace to prevent 'make install' from
+                  ;; overwriting it again
+                  (string-append " SYSTEM_EXTENSION_DIR=\""
+                                 "${PASSWORD_STORE_SYSTEM_EXTENSION_DIR:-"
+                                 extension-dir
+                                 "}\"\n"))))))
          (add-before 'install 'patch-passmenu-path
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "contrib/dmenu/passmenu"
-- 
2.20.1