diff mbox series

[bug#54090,v3] gnu: Add tessen.

Message ID 20220311075412.17869-1-tanguy@bioneland.org
State Accepted
Headers show
Series [bug#54090,v3] gnu: Add tessen. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Tanguy LE CARROUR March 11, 2022, 7:54 a.m. UTC
* gnu/packages/password-utils.scm (tessen): New variable.
---
 gnu/packages/password-utils.scm | 38 ++++++++++++++++++++++++++++++++-
 1 file changed, 37 insertions(+), 1 deletion(-)

Comments

Ludovic Courtès March 16, 2022, 2:45 p.m. UTC | #1
Hi,

Tanguy Le Carrour <tanguy@bioneland.org> skribis:

> * gnu/packages/password-utils.scm (tessen): New variable.

Applied.  Thank you, and thanks to the reviewers!

Ludo’.
Tanguy LE CARROUR March 16, 2022, 3:01 p.m. UTC | #2
Hi,


Quoting Ludovic Courtès (2022-03-16 15:45:35)
> Tanguy Le Carrour <tanguy@bioneland.org> skribis:
> 
> > * gnu/packages/password-utils.scm (tessen): New variable.
> 
> Applied.  Thank you, and thanks to the reviewers!

Thank you, in deed!
Andrew Tropin March 25, 2022, 3:10 p.m. UTC | #3
On 2022-03-11 08:54, Tanguy Le Carrour wrote:

> * gnu/packages/password-utils.scm (tessen): New variable.
> ---
>  gnu/packages/password-utils.scm | 38 ++++++++++++++++++++++++++++++++-
>  1 file changed, 37 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm
> index 440bb927a6..0e5f63e1be 100644
> --- a/gnu/packages/password-utils.scm
> +++ b/gnu/packages/password-utils.scm
> @@ -23,7 +23,7 @@
>  ;;; Copyright © 2018 Amirouche Boubekki <amirouche@hypermove.net>
>  ;;; Copyright © 2018, 2019, 2020 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
>  ;;; Copyright © 2019 Jens Mølgaard <jens@zete.tk>
> -;;; Copyright © 2019 Tanguy Le Carrour <tanguy@bioneland.org>
> +;;; Copyright © 2019,2022 Tanguy Le Carrour <tanguy@bioneland.org>
>  ;;; Copyright © 2020 Guillaume Le Vaillant <glv@posteo.net>
>  ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
>  ;;; Copyright © 2020 Jean-Baptiste Note <jean-baptiste.note@m4x.org>
> @@ -56,6 +56,7 @@ (define-module (gnu packages password-utils)
>    #:use-module (guix build-system go)
>    #:use-module (guix build-system trivial)
>    #:use-module (guix download)
> +  #:use-module (guix gexp)
>    #:use-module (guix git-download)
>    #:use-module (guix packages)
>    #:use-module (gnu packages)
> @@ -736,6 +737,41 @@ (define-public rofi-pass
>  @end enumerate")
>      (license license:gpl3)))
>  
> +(define-public tessen
> +  (package
> +    (name "tessen")
> +    (version "2.1.0")
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "https://github.com/ayushnix/tessen/")
> +                    (commit (string-append "v" version))))
> +              (file-name (git-file-name name version))
> +              (sha256
> +               (base32
> +                "1ddsjhzp1qy3jfhxlrzcxgp0gza234yc0sdlngwa3xdj0wr40zs0"))))
> +    (build-system gnu-build-system)
> +    (arguments
> +     (list #:tests?
> +           #f ;no tests
> +           #:phases
> +           #~(modify-phases %standard-phases
> +               (add-after 'unpack 'patch-wtype-path
> +                 (lambda* (#:key inputs #:allow-other-keys)
> +                   (substitute* "tessen"
> +                     (("wtype") (search-input-file inputs "/bin/wtype")))))
> +               (delete 'configure)) ;no configure script
> +           #:make-flags
> +           #~(list (string-append "PREFIX="
> +                                  #$output))))
> +    (native-inputs (list scdoc))
> +    (inputs (list wtype))
> +    (home-page "https://github.com/ayushnix/tessen")
> +    (synopsis "Frontend for password-store and gopass")
> +    (description "Tessen is a bash script that can autotype and copy data
> +from password-store and gopass files.")
> +    (license license:gpl2+)))
> +
>  (define-public browserpass-native
>    (package
>      (name "browserpass-native")

Sorry, for comming up late, but the path to wl-copy binary should be
hardcoded as well.

/gnu/store/f48prcjwpw8wrfz0srjf096a9s8fja2w-profile/bin/tessen: line 476: wl-copy: command not found
Tanguy LE CARROUR March 25, 2022, 4:22 p.m. UTC | #4
Hi Andrew,


Quoting Andrew Tropin (2022-03-25 16:10:25)
> On 2022-03-11 08:54, Tanguy Le Carrour wrote:
> 
> > * gnu/packages/password-utils.scm (tessen): New variable.
> > […]
> > +    (arguments
> > +     (list #:tests?
> > +           #f ;no tests
> > +           #:phases
> > +           #~(modify-phases %standard-phases
> > +               (add-after 'unpack 'patch-wtype-path
> > +                 (lambda* (#:key inputs #:allow-other-keys)
> > +                   (substitute* "tessen"
> > +                     (("wtype") (search-input-file inputs "/bin/wtype")))))
> > +               (delete 'configure)) ;no configure script
> > +           #:make-flags
> > +           #~(list (string-append "PREFIX="
> > […]
> 
> Sorry, for comming up late, but the path to wl-copy binary should be
> hardcoded as well.
> 
> /gnu/store/f48prcjwpw8wrfz0srjf096a9s8fja2w-profile/bin/tessen: line 476: wl-copy: command not found

Oh, my bad! I'm not using the "copy to clipboard" feature. Fortunatly,
the patch is trivial. But, before submitting it, I have a question!…

Why not also add as inputs and substitute `pass`, `gopass`, `wofi`,
`notify-send`, `xdg-open`… that are also used by tessen?!

Regards,
Andrew Tropin March 25, 2022, 5:14 p.m. UTC | #5
On 2022-03-25 17:22, Tanguy LE CARROUR wrote:

> Hi Andrew,
>
>
> Quoting Andrew Tropin (2022-03-25 16:10:25)
>> On 2022-03-11 08:54, Tanguy Le Carrour wrote:
>> 
>> > * gnu/packages/password-utils.scm (tessen): New variable.
>> > […]
>> > +    (arguments
>> > +     (list #:tests?
>> > +           #f ;no tests
>> > +           #:phases
>> > +           #~(modify-phases %standard-phases
>> > +               (add-after 'unpack 'patch-wtype-path
>> > +                 (lambda* (#:key inputs #:allow-other-keys)
>> > +                   (substitute* "tessen"
>> > +                     (("wtype") (search-input-file inputs "/bin/wtype")))))
>> > +               (delete 'configure)) ;no configure script
>> > +           #:make-flags
>> > +           #~(list (string-append "PREFIX="
>> > […]
>> 
>> Sorry, for comming up late, but the path to wl-copy binary should be
>> hardcoded as well.
>> 
>> /gnu/store/f48prcjwpw8wrfz0srjf096a9s8fja2w-profile/bin/tessen: line 476: wl-copy: command not found
>
> Oh, my bad! I'm not using the "copy to clipboard" feature. Fortunatly,
> the patch is trivial. But, before submitting it, I have a question!…
>
> Why not also add as inputs and substitute `pass`, `gopass`, `wofi`,

We can't hardcode pass, because it's an optional dependency with
explicit alternative and user can prefer gopass, so we keep tessen to
use the first option available in $PATH and fail if there is no pass or
gopass available.

The same for rofi, fuzzel, bemenu, wofi, dmenu.  Due to design of tessen
we can't know "compile time", which one will be used.

> `notify-send`, `xdg-open`… that are also used by tessen?!

IMO, notify-send and xdg-open are good candidates for inclusion to
inputs.
Tanguy LE CARROUR March 29, 2022, 7:45 a.m. UTC | #6
Hi Andrew,


Quoting Andrew Tropin (2022-03-25 18:14:17)
> > Quoting Andrew Tropin (2022-03-25 16:10:25)
> >> On 2022-03-11 08:54, Tanguy Le Carrour wrote:
> >> 
> >> > * gnu/packages/password-utils.scm (tessen): New variable.
> >> > […]
> >> > +    (arguments
> >> > +     (list #:tests?
> >> > +           #f ;no tests
> >> > +           #:phases
> >> > +           #~(modify-phases %standard-phases
> >> > +               (add-after 'unpack 'patch-wtype-path
> >> > +                 (lambda* (#:key inputs #:allow-other-keys)
> >> > +                   (substitute* "tessen"
> >> > +                     (("wtype") (search-input-file inputs "/bin/wtype")))))
> >> > +               (delete 'configure)) ;no configure script
> >> > +           #:make-flags
> >> > +           #~(list (string-append "PREFIX="
> >> > […]
> >> 
> >> Sorry, for comming up late, but the path to wl-copy binary should be
> >> hardcoded as well.
> >> 
> >> /gnu/store/f48prcjwpw8wrfz0srjf096a9s8fja2w-profile/bin/tessen: line 476: wl-copy: command not found
> >
> > Oh, my bad! I'm not using the "copy to clipboard" feature. Fortunatly,
> > the patch is trivial. But, before submitting it, I have a question!…
> >
> > Why not also add as inputs and substitute `pass`, `gopass`, `wofi`,
> 
> We can't hardcode pass, because it's an optional dependency with
> explicit alternative and user can prefer gopass, so we keep tessen to
> use the first option available in $PATH and fail if there is no pass or
> gopass available.
> 
> The same for rofi, fuzzel, bemenu, wofi, dmenu.  Due to design of tessen
> we can't know "compile time", which one will be used.
> 
> > `notify-send`, `xdg-open`… that are also used by tessen?!
> 
> IMO, notify-send and xdg-open are good candidates for inclusion to
> inputs.

It would make sense, indeed! I'm submitting a patch using the same bug ID.

Cheers,
diff mbox series

Patch

diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm
index 440bb927a6..0e5f63e1be 100644
--- a/gnu/packages/password-utils.scm
+++ b/gnu/packages/password-utils.scm
@@ -23,7 +23,7 @@ 
 ;;; Copyright © 2018 Amirouche Boubekki <amirouche@hypermove.net>
 ;;; Copyright © 2018, 2019, 2020 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
 ;;; Copyright © 2019 Jens Mølgaard <jens@zete.tk>
-;;; Copyright © 2019 Tanguy Le Carrour <tanguy@bioneland.org>
+;;; Copyright © 2019,2022 Tanguy Le Carrour <tanguy@bioneland.org>
 ;;; Copyright © 2020 Guillaume Le Vaillant <glv@posteo.net>
 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
 ;;; Copyright © 2020 Jean-Baptiste Note <jean-baptiste.note@m4x.org>
@@ -56,6 +56,7 @@  (define-module (gnu packages password-utils)
   #:use-module (guix build-system go)
   #:use-module (guix build-system trivial)
   #:use-module (guix download)
+  #:use-module (guix gexp)
   #:use-module (guix git-download)
   #:use-module (guix packages)
   #:use-module (gnu packages)
@@ -736,6 +737,41 @@  (define-public rofi-pass
 @end enumerate")
     (license license:gpl3)))
 
+(define-public tessen
+  (package
+    (name "tessen")
+    (version "2.1.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/ayushnix/tessen/")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1ddsjhzp1qy3jfhxlrzcxgp0gza234yc0sdlngwa3xdj0wr40zs0"))))
+    (build-system gnu-build-system)
+    (arguments
+     (list #:tests?
+           #f ;no tests
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'patch-wtype-path
+                 (lambda* (#:key inputs #:allow-other-keys)
+                   (substitute* "tessen"
+                     (("wtype") (search-input-file inputs "/bin/wtype")))))
+               (delete 'configure)) ;no configure script
+           #:make-flags
+           #~(list (string-append "PREFIX="
+                                  #$output))))
+    (native-inputs (list scdoc))
+    (inputs (list wtype))
+    (home-page "https://github.com/ayushnix/tessen")
+    (synopsis "Frontend for password-store and gopass")
+    (description "Tessen is a bash script that can autotype and copy data
+from password-store and gopass files.")
+    (license license:gpl2+)))
+
 (define-public browserpass-native
   (package
     (name "browserpass-native")