GNU bug report logs - #70703
[PATCH 0/2] Update rofi-pass; add rofi-pass-wayland

Previous Next

Package: guix-patches;

Reported by: John Kehayias <john.kehayias <at> protonmail.com>

Date: Wed, 1 May 2024 20:28:02 UTC

Severity: normal

Tags: patch

Done: John Kehayias <john.kehayias <at> protonmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 70703 in the body.
You can then email your comments to 70703 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#70703; Package guix-patches. (Wed, 01 May 2024 20:28:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to John Kehayias <john.kehayias <at> protonmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Wed, 01 May 2024 20:28:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: John Kehayias <john.kehayias <at> protonmail.com>
To: guix-patches <at> gnu.org
Cc: John Kehayias <john.kehayias <at> protonmail.com>
Subject: [PATCH 0/2] Update rofi-pass; add rofi-pass-wayland
Date: Wed, 01 May 2024 20:26:33 +0000
Hello,

In recently moving to Wayland, I found rofi-pass doesn't support Wayland. Well
at least our version. There has been no release in over 5 years, but recent
commits (and seems from a Guix contributor) add Wayland support. So, two
patches:

1. update rof-pass to the current commit. Rewrite the package definition to
include all the needed tools, config file, extra script, and improve the
style.

2. add rofi-pass-wayland. This replaces the X tools with Wayland ones in the
inputs and phases, and modifies the default configuration file to use
them. I've been using this one locally and it works well on Wayland.

Thanks!
John

John Kehayias (2):
  gnu: rofi-pass: Update to 2.0.2-0.8aa6b92.
  gnu: Add rofi-pass-wayland.

 gnu/packages/password-utils.scm | 137 +++++++++++++++++++++++++-------
 1 file changed, 107 insertions(+), 30 deletions(-)


base-commit: 2aeb9faa421635c0531d96658414e5bf288a3142
--
2.41.0






Information forwarded to guix-patches <at> gnu.org:
bug#70703; Package guix-patches. (Wed, 01 May 2024 20:30:01 GMT) Full text and rfc822 format available.

Message #8 received at 70703 <at> debbugs.gnu.org (full text, mbox):

From: John Kehayias <john.kehayias <at> protonmail.com>
To: 70703 <at> debbugs.gnu.org
Cc: John Kehayias <john.kehayias <at> protonmail.com>
Subject: [PATCH 1/2] gnu: rofi-pass: Update to 2.0.2-0.8aa6b92.
Date: Wed, 01 May 2024 20:28:52 +0000
With no release in over 5 years, update to the most recent commit to include
features like Wayland support.  Rewrite the package definition to use the
makefile, patch paths, and generally improve the style.

* gnu/packages/password-utils.scm (rofi-pass): Update to 2.0.2-0.8aa6b92.
[origin]: Use git-fetch rather than just the individual script.
[build-system]: Switch to gnu-build-system.
[arguments]: Remove modules and builder.  Disable tests.  Add make-flags.
<phases>: Add fix-etc-path and wrap-path phases.  Remove configure and build.
[propagated-inputs]: Remove all, adding ...
[inputs]: ... here. Add bash-minimal, pwgen, xclip, and xset.

Change-Id: Ia03ef46f3b567bc2eb6d1350db3612043f06d94b
---
 gnu/packages/password-utils.scm | 90 ++++++++++++++++++++++-----------
 1 file changed, 60 insertions(+), 30 deletions(-)

diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm
index eb64a7f306..96243a60ea 100644
--- a/gnu/packages/password-utils.scm
+++ b/gnu/packages/password-utils.scm
@@ -40,6 +40,7 @@
 ;;; Copyright © 2022 Nicolas Graves <ngraves <at> ngraves.fr>
 ;;; Copyright © 2022 Petr Hodina <phodina <at> protonmail.com>
 ;;; Copyright © 2023 Christian Miller <christian.miller <at> dadoes.de>
+;;; Copyright © 2024 John Kehayias <john.kehayias <at> protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -906,35 +907,64 @@ (define-public qtpass
     (license license:gpl3+)))

 (define-public rofi-pass
-  (package
-    (name "rofi-pass")
-    (version "2.0.2")
-    (source
-     (origin
-       (method url-fetch)
-       (uri
-        (string-append "https://raw.githubusercontent.com/carnager/rofi-pass/"
-                       version "/rofi-pass"))
-       (sha256
-        (base32 "0msldkndqp40nx1s5s7ggcr97ir4nshpmnyzvj5hqw1l7m3gvw6j"))
-       (file-name name)))
-    (build-system trivial-build-system)
-    (arguments
-     `(#:modules ((guix build utils))
-       #:builder
-       (begin
-         (use-modules (guix build utils))
-         (let ((source (string-append (assoc-ref %build-inputs "source")))
-               (script "rofi-pass")
-               (out (assoc-ref %outputs "out")))
-           (copy-file source script)
-           (chmod script #o555)
-           (install-file script (string-append out "/bin"))))))
-    (propagated-inputs
-     (list password-store rofi xdotool))
-    (home-page "https://github.com/carnager/rofi-pass")
-    (synopsis "Rofi frontend for password-store")
-    (description "Rofi-pass provides a way to manipulate information stored
+  ;; No release in over 5 years with recent commits adding features like
+  ;; Wayland support.
+  (let ((commit "8aa6b9293a8f0af267425326fa966966ca42085e")
+        (revision "0"))
+    (package
+      (name "rofi-pass")
+      (version (git-version "2.0.2" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/carnager/rofi-pass")
+               (commit commit)))
+         (sha256
+          (base32
+           "0axz4ijp6fay6f2yn1cg6223l89jkg8wnxslbk1g5jpli0njxw43"))
+         (file-name (git-file-name name version))))
+      (build-system gnu-build-system)
+      (arguments
+       (list #:tests? #f ; no tests
+             #:make-flags #~(list (string-append "PREFIX=" #$output))
+             #:phases
+             #~(modify-phases %standard-phases
+                 (add-after 'unpack 'fix-etc-path
+                   (lambda _
+                     (substitute* "Makefile"
+                       (("\\$\\(DESTDIR\\)/etc")
+                        (string-append #$output "/etc")))
+                     (substitute* "rofi-pass"
+                       (("/etc")
+                        (string-append #$output "/etc")))))
+                 (delete 'configure) ; no configure
+                 (delete 'build)     ; no build
+                 (add-after 'install 'wrap-path
+                   (lambda* (#:key inputs #:allow-other-keys)
+                     (let ((bin (string-append #$output "/bin")))
+                       (for-each
+                        (lambda (script)
+                          (wrap-program (string-append bin "/" script)
+                            (list "PATH" 'prefix
+                                  (map
+                                   (lambda (binary)
+                                     (dirname (search-input-file
+                                               inputs
+                                               (string-append "bin/" binary))))
+                                   '("pass" "pwgen" "rofi"
+                                     "xclip" "xdotool" "xset")))))
+                        (list "addpass" "rofi-pass"))))))))
+      (inputs (list bash-minimal ;for wrap-program
+                    password-store
+                    pwgen
+                    rofi
+                    xclip
+                    xdotool
+                    xset))
+      (home-page "https://github.com/carnager/rofi-pass")
+      (synopsis "Rofi frontend for password-store")
+      (description "Rofi-pass provides a way to manipulate information stored
 using password-store through rofi interface:
 @enumerate
 @item open URLs of entries with hotkey;
@@ -944,7 +974,7 @@ (define-public rofi-pass
 @item auto-typing of more than one field, using the autotype entry;
 @item bookmarks mode (open stored URLs in browser, default: Alt+x).
 @end enumerate")
-    (license license:gpl3)))
+      (license license:gpl3))))

 (define-public tessen
   (package
--
2.41.0






Information forwarded to guix-patches <at> gnu.org:
bug#70703; Package guix-patches. (Wed, 01 May 2024 20:30:02 GMT) Full text and rfc822 format available.

Message #11 received at 70703 <at> debbugs.gnu.org (full text, mbox):

From: John Kehayias <john.kehayias <at> protonmail.com>
To: 70703 <at> debbugs.gnu.org
Cc: John Kehayias <john.kehayias <at> protonmail.com>
Subject: [PATCH 2/2] gnu: Add rofi-pass-wayland.
Date: Wed, 01 May 2024 20:29:00 +0000
This variant of rofi-pass swaps out the X-related tools used for Wayland
versions and changes the default configuration file to use them.

* gnu/packages/password-utils.scm (rofi-pass-wayland): New variable.

Change-Id: Ie844fc2f3a7f49fd6322e5418a6944b6b941abce
---
 gnu/packages/password-utils.scm | 47 +++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm
index 96243a60ea..50d098ca5f 100644
--- a/gnu/packages/password-utils.scm
+++ b/gnu/packages/password-utils.scm
@@ -976,6 +976,53 @@ (define-public rofi-pass
 @end enumerate")
       (license license:gpl3))))

+(define-public rofi-pass-wayland
+  (package
+    (inherit rofi-pass)
+    (name "rofi-pass-wayland")
+    (arguments
+     (substitute-keyword-arguments (package-arguments rofi-pass)
+       ((#:phases phases)
+        #~(modify-phases #$phases
+            ;; Set the clipboard and backend tools to ones for Wayland in the
+            ;; default configuration file.
+            (add-after 'fix-etc-path 'set-wayland-defaults
+                   (lambda _
+                     (substitute* "config.example"
+                       ;; Note the typo in current configuration.
+                       (("#clibpoard_backend=xclip")
+                        "clipboard_backend=wl-clipboard")
+                       (("#backend=xdotool")
+                        "backend=wtype"))
+                     (substitute* "rofi-pass"
+                       (("/etc")
+                        (string-append #$output "/etc")))))
+            ;; Use Wayland related tools instead.
+            (replace 'wrap-path
+              (lambda* (#:key inputs #:allow-other-keys)
+                (let ((bin (string-append #$output "/bin")))
+                  (for-each
+                   (lambda (script)
+                     (wrap-program (string-append bin "/" script)
+                       (list "PATH" 'prefix
+                             (map
+                              (lambda (binary)
+                                (dirname (search-input-file
+                                          inputs
+                                          (string-append "bin/" binary))))
+                              ;; wl-copy for wl-clipboard.
+                              '("pass" "pwgen" "rofi" "wl-copy" "wtype")))))
+                   (list "addpass" "rofi-pass")))))))))
+    (inputs
+     (modify-inputs (package-inputs rofi-pass)
+       (replace "rofi" rofi-wayland)
+       (replace "xclip" wl-clipboard)
+       (replace "xdotool" wtype)
+       (delete "xset")))
+    (description (string-append
+                  (package-description rofi-pass)
+                  "\nThis package provides Wayland support by default."))))
+
 (define-public tessen
   (package
     (name "tessen")
--
2.41.0






Reply sent to John Kehayias <john.kehayias <at> protonmail.com>:
You have taken responsibility. (Wed, 26 Jun 2024 19:25:02 GMT) Full text and rfc822 format available.

Notification sent to John Kehayias <john.kehayias <at> protonmail.com>:
bug acknowledged by developer. (Wed, 26 Jun 2024 19:25:02 GMT) Full text and rfc822 format available.

Message #16 received at 70703-done <at> debbugs.gnu.org (full text, mbox):

From: John Kehayias <john.kehayias <at> protonmail.com>
To: 70703-done <at> debbugs.gnu.org
Subject: Re: [bug#70703] [PATCH 0/2] Update rofi-pass; add rofi-pass-wayland
Date: Wed, 26 Jun 2024 19:24:39 +0000
On Wed, May 01, 2024 at 08:26 PM, John Kehayias wrote:

> Hello,
>
> In recently moving to Wayland, I found rofi-pass doesn't support Wayland. Well
> at least our version. There has been no release in over 5 years, but recent
> commits (and seems from a Guix contributor) add Wayland support. So, two
> patches:
>
> 1. update rof-pass to the current commit. Rewrite the package definition to
> include all the needed tools, config file, extra script, and improve the
> style.
>
> 2. add rofi-pass-wayland. This replaces the X tools with Wayland ones in the
> inputs and phases, and modifies the default configuration file to use
> them. I've been using this one locally and it works well on Wayland.
>
> Thanks!
> John
>
> John Kehayias (2):
>   gnu: rofi-pass: Update to 2.0.2-0.8aa6b92.
>   gnu: Add rofi-pass-wayland.
>
>  gnu/packages/password-utils.scm | 137 +++++++++++++++++++++++++-------
>  1 file changed, 107 insertions(+), 30 deletions(-)
>
>
> base-commit: 2aeb9faa421635c0531d96658414e5bf288a3142
> --
> 2.41.0

Pushed as eef9e0ee8fc7201020a3ef31c28a07023e23dc0c and
947005f5eea7f9e92060faefdeb705afb3d1878d

(since I didn't hear anything and have been using this locally, though
of course still happy to make revisions)






bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 25 Jul 2024 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 1 day ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.