* [bug#35346] [0/2] Add pass-otp @ 2019-04-20 17:50 Alex Griffin 2019-04-20 17:54 ` [bug#35346] [PATCH 1/2] gnu: password-store: Allow external packages to provide extensions Alex Griffin ` (2 more replies) 0 siblings, 3 replies; 7+ messages in thread From: Alex Griffin @ 2019-04-20 17:50 UTC (permalink / raw) To: 35346 This patch series adds a mechanism for providing pass extensions in separate packages, then adds the pass-otp package. -- Alex Griffin ^ permalink raw reply [flat|nested] 7+ messages in thread
* [bug#35346] [PATCH 1/2] gnu: password-store: Allow external packages to provide extensions. 2019-04-20 17:50 [bug#35346] [0/2] Add pass-otp Alex Griffin @ 2019-04-20 17:54 ` Alex Griffin 2019-04-20 17:55 ` [bug#35346] [PATCH 2/2] gnu: Add pass-otp Alex Griffin 2019-04-20 19:59 ` [bug#35346] Add patch tag to #35346 Alex Griffin 2 siblings, 0 replies; 7+ messages in thread From: Alex Griffin @ 2019-04-20 17:54 UTC (permalink / raw) To: 35346 [-- Attachment #1: Type: text/plain, Size: 230 bytes --] * 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 [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0001-gnu-password-store-Allow-external-packages-to-provid.patch --] [-- Type: text/x-patch; name="0001-gnu-password-store-Allow-external-packages-to-provid.patch", Size: 2256 bytes --] From c927c48cc4bf4dc564bc441d4574dea79c05b472 Mon Sep 17 00:00:00 2001 From: Alex Griffin <a@ajgrf.com> 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 <tsyesika@tsyesika.se> ;;; Copyright © 2016 Andreas Enge <andreas@enge.fr> ;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org> -;;; Copyright © 2016 Alex Griffin <a@ajgrf.com> +;;; Copyright © 2016, 2019 Alex Griffin <a@ajgrf.com> ;;; Copyright © 2017 Leo Famulari <leo@famulari.name> ;;; Copyright © 2017, 2018 Clément Lassieur <clement@lassieur.org> ;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr> @@ -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 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [bug#35346] [PATCH 2/2] gnu: Add pass-otp. 2019-04-20 17:50 [bug#35346] [0/2] Add pass-otp Alex Griffin 2019-04-20 17:54 ` [bug#35346] [PATCH 1/2] gnu: password-store: Allow external packages to provide extensions Alex Griffin @ 2019-04-20 17:55 ` Alex Griffin 2019-04-21 21:30 ` Christopher Baines 2019-04-20 19:59 ` [bug#35346] Add patch tag to #35346 Alex Griffin 2 siblings, 1 reply; 7+ messages in thread From: Alex Griffin @ 2019-04-20 17:55 UTC (permalink / raw) To: 35346 [-- Attachment #1: Type: text/plain, Size: 77 bytes --] * gnu/packages/password-utils.scm (pass-otp): New variable. -- Alex Griffin [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0002-gnu-Add-pass-otp.patch --] [-- Type: text/x-patch; name="0002-gnu-Add-pass-otp.patch", Size: 3261 bytes --] From a04e90f450213be4cfc106096f18195e2e2ab931 Mon Sep 17 00:00:00 2001 From: Alex Griffin <a@ajgrf.com> Date: Sat, 20 Apr 2019 11:59:35 -0500 Subject: [PATCH 2/2] gnu: Add pass-otp. * gnu/packages/password-utils.scm (pass-otp): New variable. --- gnu/packages/password-utils.scm | 53 +++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm index b23dbf1fbb..a3caec22d9 100644 --- a/gnu/packages/password-utils.scm +++ b/gnu/packages/password-utils.scm @@ -48,6 +48,7 @@ #:use-module (gnu packages) #:use-module (gnu packages admin) #:use-module (gnu packages aidc) + #:use-module (gnu packages authentication) #:use-module (gnu packages base) #:use-module (gnu packages check) #:use-module (gnu packages compression) @@ -74,6 +75,7 @@ #:use-module (gnu packages python-web) #:use-module (gnu packages python-xyz) #:use-module (gnu packages suckless) + #:use-module (gnu packages tcl) #:use-module (gnu packages tls) #:use-module (gnu packages qt) #:use-module (gnu packages version-control) @@ -494,6 +496,57 @@ changes to your password database to a git repository that can be managed through the pass command.") (license license:gpl2+))) +(define-public pass-otp + (package + (name "pass-otp") + (version "1.2.0") + (source + (origin + (method url-fetch) + (uri + (string-append "https://github.com/tadfisher/pass-otp/releases/" + "download/v" version "/pass-otp-" version ".tar.gz")) + (sha256 + (base32 + "0rrs3iazq80dn0wbl20xkh270428jd8l99m5gd7hl93s4r4sc82p")))) + (build-system gnu-build-system) + (arguments + '(#:make-flags + (let* ((out (assoc-ref %outputs "out")) + (bashcomp (string-append out "/etc/bash_completion.d"))) + (list (string-append "PREFIX=" %output) + (string-append "BASHCOMPDIR=" bashcomp))) + #:phases + (modify-phases %standard-phases + (delete 'configure) + (add-after 'build 'patch-oath-path + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "otp.bash" + (("^OATH=.*$") + (string-append + "OATH=" + (assoc-ref inputs "oath-toolkit") + "/bin/oathtool\n"))) + #t))) + #:test-target "test")) + (native-search-paths + (list (search-path-specification + (variable "PASSWORD_STORE_SYSTEM_EXTENSION_DIR") + (files '("lib/password-store/extensions"))))) + (inputs + `(("password-store" ,password-store) + ("expect" ,expect) + ("oath-toolkit" ,oath-toolkit) + ("git" ,git) + ("gnupg" ,gnupg) + ("which" ,which))) + (home-page "https://github.com/tadfisher/pass-otp") + (synopsis "Pass extension for managing one-time-password (OTP) tokens") + (description " An extension for password-store that allows adding +one-time-password (OTP) secrets, generating OTP codes, and displaying secret +key URIs using the standard otpauth:// scheme.") + (license license:gpl3+))) + (define-public argon2 (package (name "argon2") -- 2.20.1 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [bug#35346] [PATCH 2/2] gnu: Add pass-otp. 2019-04-20 17:55 ` [bug#35346] [PATCH 2/2] gnu: Add pass-otp Alex Griffin @ 2019-04-21 21:30 ` Christopher Baines 2019-04-22 0:26 ` Alex Griffin 0 siblings, 1 reply; 7+ messages in thread From: Christopher Baines @ 2019-04-21 21:30 UTC (permalink / raw) To: Alex Griffin; +Cc: 35346 [-- Attachment #1: Type: text/plain, Size: 831 bytes --] Alex Griffin <a@ajgrf.com> writes: > * gnu/packages/password-utils.scm (pass-otp): New variable. > ... > +(define-public pass-otp > + (package > + (name "pass-otp") > + (version "1.2.0") ... > + (native-search-paths > + (list (search-path-specification > + (variable "PASSWORD_STORE_SYSTEM_EXTENSION_DIR") > + (files '("lib/password-store/extensions"))))) Hi Alex, These changes are looking good, one thing though, is that I think this native-search-paths field should be defined for the password-store package, as it's the one that uses the search path. While it works having it defined for pass-otp, having it in the password-store package will become relevant if there are more extensions packaged for Guix, as then they'll be able to take advantage of this as well. Thanks, Chris [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 962 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* [bug#35346] [PATCH 2/2] gnu: Add pass-otp. 2019-04-21 21:30 ` Christopher Baines @ 2019-04-22 0:26 ` Alex Griffin 2019-04-22 9:36 ` bug#35346: " Christopher Baines 0 siblings, 1 reply; 7+ messages in thread From: Alex Griffin @ 2019-04-22 0:26 UTC (permalink / raw) To: Christopher Baines; +Cc: 35346 [-- Attachment #1: Type: text/plain, Size: 593 bytes --] On Sun, Apr 21, 2019, at 9:30 PM, Christopher Baines wrote: > These changes are looking good, one thing though, is that I think this > native-search-paths field should be defined for the password-store > package, as it's the one that uses the search path. > > While it works having it defined for pass-otp, having it in the > password-store package will become relevant if there are more extensions > packaged for Guix, as then they'll be able to take advantage of this as > well. Thanks Chris, that makes sense. I've attached 2 updated patches with the requested changes. -- Alex Griffin [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0001-gnu-password-store-Allow-external-packages-to-provid.patch --] [-- Type: text/x-patch; name="0001-gnu-password-store-Allow-external-packages-to-provid.patch", Size: 2676 bytes --] From 8f64805def5352919e4dac57ce0adc79f0243a43 Mon Sep 17 00:00:00 2001 From: Alex Griffin <a@ajgrf.com> 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 mechanism for providing pass extensions in separate packages. [arguments]: Add patch-system-extension-dir phase. [native-search-paths]: Add PASSWORD_STORE_SYSTEM_EXTENSION_DIR. --- gnu/packages/password-utils.scm | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm index 5c11d8c437..5cd8e2f160 100644 --- a/gnu/packages/password-utils.scm +++ b/gnu/packages/password-utils.scm @@ -6,7 +6,7 @@ ;;; Copyright © 2016 Jessica Tallon <tsyesika@tsyesika.se> ;;; Copyright © 2016 Andreas Enge <andreas@enge.fr> ;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org> -;;; Copyright © 2016 Alex Griffin <a@ajgrf.com> +;;; Copyright © 2016, 2019 Alex Griffin <a@ajgrf.com> ;;; Copyright © 2017 Leo Famulari <leo@famulari.name> ;;; Copyright © 2017, 2018 Clément Lassieur <clement@lassieur.org> ;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr> @@ -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" @@ -461,6 +473,10 @@ any X11 window.") ;; timeout in some circumstances. #:parallel-tests? #f #:test-target "test")) + (native-search-paths + (list (search-path-specification + (variable "PASSWORD_STORE_SYSTEM_EXTENSION_DIR") + (files '("lib/password-store/extensions"))))) (inputs `(("dmenu" ,dmenu) ("getopt" ,util-linux) -- 2.20.1 [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #3: 0002-gnu-Add-pass-otp.patch --] [-- Type: text/x-patch; name="0002-gnu-Add-pass-otp.patch", Size: 3075 bytes --] From 0c695f7ee5151a4c1747591ca165b44c5b9e553b Mon Sep 17 00:00:00 2001 From: Alex Griffin <a@ajgrf.com> Date: Sat, 20 Apr 2019 11:59:35 -0500 Subject: [PATCH 2/2] gnu: Add pass-otp. * gnu/packages/password-utils.scm (pass-otp): New variable. --- gnu/packages/password-utils.scm | 49 +++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm index 5cd8e2f160..fd0a7c6501 100644 --- a/gnu/packages/password-utils.scm +++ b/gnu/packages/password-utils.scm @@ -48,6 +48,7 @@ #:use-module (gnu packages) #:use-module (gnu packages admin) #:use-module (gnu packages aidc) + #:use-module (gnu packages authentication) #:use-module (gnu packages base) #:use-module (gnu packages check) #:use-module (gnu packages compression) @@ -74,6 +75,7 @@ #:use-module (gnu packages python-web) #:use-module (gnu packages python-xyz) #:use-module (gnu packages suckless) + #:use-module (gnu packages tcl) #:use-module (gnu packages tls) #:use-module (gnu packages qt) #:use-module (gnu packages version-control) @@ -498,6 +500,53 @@ changes to your password database to a git repository that can be managed through the pass command.") (license license:gpl2+))) +(define-public pass-otp + (package + (name "pass-otp") + (version "1.2.0") + (source + (origin + (method url-fetch) + (uri + (string-append "https://github.com/tadfisher/pass-otp/releases/" + "download/v" version "/pass-otp-" version ".tar.gz")) + (sha256 + (base32 + "0rrs3iazq80dn0wbl20xkh270428jd8l99m5gd7hl93s4r4sc82p")))) + (build-system gnu-build-system) + (arguments + '(#:make-flags + (let* ((out (assoc-ref %outputs "out")) + (bashcomp (string-append out "/etc/bash_completion.d"))) + (list (string-append "PREFIX=" %output) + (string-append "BASHCOMPDIR=" bashcomp))) + #:phases + (modify-phases %standard-phases + (delete 'configure) + (add-after 'build 'patch-oath-path + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "otp.bash" + (("^OATH=.*$") + (string-append + "OATH=" + (assoc-ref inputs "oath-toolkit") + "/bin/oathtool\n"))) + #t))) + #:test-target "test")) + (inputs + `(("password-store" ,password-store) + ("expect" ,expect) + ("oath-toolkit" ,oath-toolkit) + ("git" ,git) + ("gnupg" ,gnupg) + ("which" ,which))) + (home-page "https://github.com/tadfisher/pass-otp") + (synopsis "Pass extension for managing one-time-password (OTP) tokens") + (description " An extension for password-store that allows adding +one-time-password (OTP) secrets, generating OTP codes, and displaying secret +key URIs using the standard otpauth:// scheme.") + (license license:gpl3+))) + (define-public argon2 (package (name "argon2") -- 2.20.1 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* bug#35346: [PATCH 2/2] gnu: Add pass-otp. 2019-04-22 0:26 ` Alex Griffin @ 2019-04-22 9:36 ` Christopher Baines 0 siblings, 0 replies; 7+ messages in thread From: Christopher Baines @ 2019-04-22 9:36 UTC (permalink / raw) To: Alex Griffin; +Cc: 35346-done [-- Attachment #1: Type: text/plain, Size: 4665 bytes --] Alex Griffin <a@ajgrf.com> writes: > On Sun, Apr 21, 2019, at 9:30 PM, Christopher Baines wrote: >> These changes are looking good, one thing though, is that I think this >> native-search-paths field should be defined for the password-store >> package, as it's the one that uses the search path. >> >> While it works having it defined for pass-otp, having it in the >> password-store package will become relevant if there are more extensions >> packaged for Guix, as then they'll be able to take advantage of this as >> well. > > Thanks Chris, that makes sense. I've attached 2 updated patches with the requested changes. Great, I've pushed these two patches now, with a few minor changes that'll describe below. > From 8f64805def5352919e4dac57ce0adc79f0243a43 Mon Sep 17 00:00:00 2001 > From: Alex Griffin <a@ajgrf.com> > 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 mechanism for > providing pass extensions in separate packages. > [arguments]: Add patch-system-extension-dir phase. > [native-search-paths]: Add PASSWORD_STORE_SYSTEM_EXTENSION_DIR. > --- > gnu/packages/password-utils.scm | 18 +++++++++++++++++- > 1 file changed, 17 insertions(+), 1 deletion(-) > > diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm > index 5c11d8c437..5cd8e2f160 100644 > --- a/gnu/packages/password-utils.scm > +++ b/gnu/packages/password-utils.scm > @@ -6,7 +6,7 @@ > ;;; Copyright © 2016 Jessica Tallon <tsyesika@tsyesika.se> > ;;; Copyright © 2016 Andreas Enge <andreas@enge.fr> > ;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org> > -;;; Copyright © 2016 Alex Griffin <a@ajgrf.com> > +;;; Copyright © 2016, 2019 Alex Griffin <a@ajgrf.com> > ;;; Copyright © 2017 Leo Famulari <leo@famulari.name> > ;;; Copyright © 2017, 2018 Clément Lassieur <clement@lassieur.org> > ;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr> > @@ -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")))))) I'm still not quite sure why, but currently it's at least more consistent if phases like the one above evaluate to #t, so I've added #t in at the end. > From 0c695f7ee5151a4c1747591ca165b44c5b9e553b Mon Sep 17 00:00:00 2001 > From: Alex Griffin <a@ajgrf.com> > Date: Sat, 20 Apr 2019 11:59:35 -0500 > Subject: [PATCH 2/2] gnu: Add pass-otp. > > * gnu/packages/password-utils.scm (pass-otp): New variable. > --- > gnu/packages/password-utils.scm | 49 +++++++++++++++++++++++++++++++++ > 1 file changed, 49 insertions(+) > > diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm > index 5cd8e2f160..fd0a7c6501 100644 > --- a/gnu/packages/password-utils.scm > +++ b/gnu/packages/password-utils.scm ... > + (inputs > + `(("password-store" ,password-store) > + ("expect" ,expect) > + ("oath-toolkit" ,oath-toolkit) > + ("git" ,git) > + ("gnupg" ,gnupg) > + ("which" ,which))) oath-toolkit is the only one of these inputs referenced by the output, so I've changed the others in to native-inputs, as I think this makes a bit more sense. > + (home-page "https://github.com/tadfisher/pass-otp") > + (synopsis "Pass extension for managing one-time-password (OTP) tokens") > + (description " An extension for password-store that allows adding > +one-time-password (OTP) secrets, generating OTP codes, and displaying secret > +key URIs using the standard otpauth:// scheme.") I've tweaked the description slightly, removing the space at the start, and making it more of a complete sentence: "Pass OTP is an extension for password-store that allows ..." Thanks again, Chris [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 962 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* [bug#35346] Add patch tag to #35346 2019-04-20 17:50 [bug#35346] [0/2] Add pass-otp Alex Griffin 2019-04-20 17:54 ` [bug#35346] [PATCH 1/2] gnu: password-store: Allow external packages to provide extensions Alex Griffin 2019-04-20 17:55 ` [bug#35346] [PATCH 2/2] gnu: Add pass-otp Alex Griffin @ 2019-04-20 19:59 ` Alex Griffin 2 siblings, 0 replies; 7+ messages in thread From: Alex Griffin @ 2019-04-20 19:59 UTC (permalink / raw) To: 35346 tags 35346 patch ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2019-04-22 9:37 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2019-04-20 17:50 [bug#35346] [0/2] Add pass-otp Alex Griffin 2019-04-20 17:54 ` [bug#35346] [PATCH 1/2] gnu: password-store: Allow external packages to provide extensions Alex Griffin 2019-04-20 17:55 ` [bug#35346] [PATCH 2/2] gnu: Add pass-otp Alex Griffin 2019-04-21 21:30 ` Christopher Baines 2019-04-22 0:26 ` Alex Griffin 2019-04-22 9:36 ` bug#35346: " Christopher Baines 2019-04-20 19:59 ` [bug#35346] Add patch tag to #35346 Alex Griffin
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).