GNU bug report logs - #45965
[PATCH 0/2] Update fzf, include binaries and install completions

Previous Next

Package: guix-patches;

Reported by: EuAndreh <eu <at> euandre.org>

Date: Mon, 18 Jan 2021 19:00:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

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 45965 in the body.
You can then email your comments to 45965 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#45965; Package guix-patches. (Mon, 18 Jan 2021 19:00:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to EuAndreh <eu <at> euandre.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 18 Jan 2021 19:00:02 GMT) Full text and rfc822 format available.

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

From: EuAndreh <eu <at> euandre.org>
To: guix-patches <at> gnu.org
Cc: EuAndreh <eu <at> euandre.org>
Subject: [PATCH 0/2] Update fzf, include binaries and install completions
Date: Mon, 18 Jan 2021 15:59:25 -0300
I've tested both the package update and the extra phases added.
The Bash completions are being installed properly, but I haven't tested
the zsh ones.

I remember seeing somewhere a discussion on aliasing this type of package,
so that the "go-github-com-junegunn-fzf" is the default imported Go module,
to be used as input for other packages, and adding a top-level "fzf" package,
which does the ad-hoc packaging code I've added, so that a user can install
the "fzf" package with Bash integration and similar features.

I couldn't find anything on the manual also, I welcome comments on this :)

EuAndreh (2):
  gnu: go-github-com-junegunn-fzf: Copy binaries and install shell
    completions.
  gnu: go-github-com-junegunn-fzf: Update to 0.25.0.

 gnu/packages/terminals.scm | 35 +++++++++++++++++++++++++++++++----
 1 file changed, 31 insertions(+), 4 deletions(-)

-- 
2.30.0





Information forwarded to guix-patches <at> gnu.org:
bug#45965; Package guix-patches. (Mon, 18 Jan 2021 19:06:01 GMT) Full text and rfc822 format available.

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

From: EuAndreh <eu <at> euandre.org>
To: 45965 <at> debbugs.gnu.org
Cc: EuAndreh <eu <at> euandre.org>
Subject: [PATCH 1/2] gnu: go-github-com-junegunn-fzf: Copy binaries and
 install shell completions.
Date: Mon, 18 Jan 2021 16:04:58 -0300
* gnu/packages/terminals.scm (go-github-com-junegunn-fzf)[arguments]: Add
  copy-binaries, wrap-programs and install-completion phases.
---
 gnu/packages/terminals.scm | 31 +++++++++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/terminals.scm b/gnu/packages/terminals.scm
index 74e1937bbc..308ff99bf0 100644
--- a/gnu/packages/terminals.scm
+++ b/gnu/packages/terminals.scm
@@ -813,7 +813,33 @@ programmer to write text-based user interfaces.")
          "0n0cy5q2r3dm1a3ivlzrv9c5d11awxlqim5b9x8zc85dlr73n35l"))))
     (build-system go-build-system)
     (arguments
-     `(#:import-path "github.com/junegunn/fzf"))
+     `(#:import-path "github.com/junegunn/fzf"
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'copy-binaries
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (with-directory-excursion "src/github.com/junegunn/fzf"
+                 (install-file "bin/fzf-tmux"
+                               (string-append out "/bin"))))))
+         (add-after 'copy-binaries 'wrap-programs
+           (lambda* (#:key outputs inputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out"))
+                   (ncurses (assoc-ref inputs "ncurses")))
+               (wrap-program (string-append out "/bin/fzf-tmux")
+                 `("PATH" ":" prefix (,(string-append ncurses "/bin")))))))
+         (add-after 'install 'install-completions
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bash-completion (string-append out "/etc/bash_completion.d"))
+                    (zsh-completion (string-append out "/share/zsh/site-functions")))
+               (with-directory-excursion "src/github.com/junegunn/fzf"
+                 (mkdir-p bash-completion)
+                 (copy-file "shell/completion.bash"
+                            (string-append bash-completion "/fzf"))
+                 (mkdir-p zsh-completion)
+                 (copy-file "shell/completion.zsh"
+                            (string-append zsh-completion "/_fzf")))))))))
     (inputs
      `(("go-github.com-mattn-go-runewidth" ,go-github.com-mattn-go-runewidth)
        ("go-github-com-mattn-go-shellwords" ,go-github-com-mattn-go-shellwords)
@@ -821,7 +847,8 @@ programmer to write text-based user interfaces.")
        ("go-github-com-gdamore-tcell" ,go-github-com-gdamore-tcell)
        ("go-github-com-saracen-walker" ,go-github-com-saracen-walker)
        ("go-golang.org-x-sync-errgroup" ,go-golang.org-x-sync-errgroup)
-       ("go-golang-org-x-crypto" ,go-golang-org-x-crypto)))
+       ("go-golang-org-x-crypto" ,go-golang-org-x-crypto)
+       ("ncurses" ,ncurses)))
     (home-page "https://github.com/junegunn/fzf")
     (synopsis "Command-line fuzzy-finder")
     (description "This package provides an interactive command-line filter
-- 
2.30.0





Information forwarded to guix-patches <at> gnu.org:
bug#45965; Package guix-patches. (Mon, 18 Jan 2021 19:06:02 GMT) Full text and rfc822 format available.

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

From: EuAndreh <eu <at> euandre.org>
To: 45965 <at> debbugs.gnu.org
Cc: EuAndreh <eu <at> euandre.org>
Subject: [PATCH 2/2] gnu: go-github-com-junegunn-fzf: Update to 0.25.0.
Date: Mon, 18 Jan 2021 16:04:59 -0300
* gnu/packages/terminals.scm (go-github-com-junegunn-fzf): Update to 0.25.0.
---
 gnu/packages/terminals.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/terminals.scm b/gnu/packages/terminals.scm
index 308ff99bf0..9c89134aaa 100644
--- a/gnu/packages/terminals.scm
+++ b/gnu/packages/terminals.scm
@@ -800,7 +800,7 @@ programmer to write text-based user interfaces.")
 (define-public go-github-com-junegunn-fzf
   (package
     (name "go-github-com-junegunn-fzf")
-    (version "0.22.0")
+    (version "0.25.0")
     (source
      (origin
        (method git-fetch)
@@ -810,7 +810,7 @@ programmer to write text-based user interfaces.")
        (file-name (git-file-name name version))
        (sha256
         (base32
-         "0n0cy5q2r3dm1a3ivlzrv9c5d11awxlqim5b9x8zc85dlr73n35l"))))
+         "1j5bfxl4w8w3n89p051y8dhxg0py9l98v7r2gkr63bg4lj32faz8"))))
     (build-system go-build-system)
     (arguments
      `(#:import-path "github.com/junegunn/fzf"
-- 
2.30.0





Information forwarded to guix-patches <at> gnu.org:
bug#45965; Package guix-patches. (Fri, 05 Feb 2021 20:58:01 GMT) Full text and rfc822 format available.

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

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: guix-patches--- via <guix-patches <at> gnu.org>
Cc: 45965 <at> debbugs.gnu.org, EuAndreh <eu <at> euandre.org>
Subject: Re: [bug#45965] [PATCH 0/2] Update fzf, include binaries and
 install completions
Date: Fri, 05 Feb 2021 21:57:33 +0100
Hello,

guix-patches--- via <guix-patches <at> gnu.org> writes:

> I've tested both the package update and the extra phases added.
> The Bash completions are being installed properly, but I haven't tested
> the zsh ones.
>
> I remember seeing somewhere a discussion on aliasing this type of package,
> so that the "go-github-com-junegunn-fzf" is the default imported Go module,
> to be used as input for other packages, and adding a top-level "fzf" package,
> which does the ad-hoc packaging code I've added, so that a user can install
> the "fzf" package with Bash integration and similar features.

Indeed, having to install "go-github-com-junegunn-fzf" when you are
really looking for "fzf" is not very intuitive.

So, "fzf" could inherit from "go-github-com-junegunn-fzf" and add all
the bells and whistles.

Would you want to provide a patch for that?

Meanwhile, I'm going to apply the update and leave the first patch out.

Regards,
-- 
Nicolas Goaziou




Information forwarded to guix-patches <at> gnu.org:
bug#45965; Package guix-patches. (Fri, 05 Feb 2021 20:58:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#45965; Package guix-patches. (Fri, 05 Feb 2021 22:37:02 GMT) Full text and rfc822 format available.

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

From: EuAndreh <eu <at> euandre.org>
To: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>, 45965 <at> debbugs.gnu.org
Subject: Re: [bug#45965] [PATCH 0/2] Update fzf, include binaries and
 install completions
Date: Fri, 05 Feb 2021 19:31:46 -0300
Nicolas Goaziou <mail <at> nicolasgoaziou.fr> writes:

> Would you want to provide a patch for that?

Sure, I'll do it in the next few days.




Information forwarded to guix-patches <at> gnu.org:
bug#45965; Package guix-patches. (Mon, 08 Feb 2021 17:09:02 GMT) Full text and rfc822 format available.

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

From: EuAndreh <eu <at> euandre.org>
To: mail <at> nicolasgoaziou.fr,
	45965 <at> debbugs.gnu.org
Cc: EuAndreh <eu <at> euandre.org>
Subject: [PATCH] gnu: Add fzf.
Date: Mon,  8 Feb 2021 14:08:27 -0300
* gnu/packages/terminals.scm (fzf): New variable, which inherits
  from the existing go-github-com-junegunn-fzf package, but also
  install other binary, and completion for direct usage.
---
Done as discussed.

 gnu/packages/terminals.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/gnu/packages/terminals.scm b/gnu/packages/terminals.scm
index a9897ec623..7ccba97968 100644
--- a/gnu/packages/terminals.scm
+++ b/gnu/packages/terminals.scm
@@ -824,6 +824,43 @@ programmer to write text-based user interfaces.")
 usable with any list--including files, command history, processes and more.")
     (license license:expat)))
 
+(define-public fzf
+  (package
+    (inherit go-github-com-junegunn-fzf)
+    (name "fzf")
+    (arguments
+     `(,@(ensure-keyword-arguments
+          (package-arguments go-github-com-junegunn-fzf)
+          `(#:phases
+            (modify-phases %standard-phases
+              (add-after 'install 'copy-binaries
+                (lambda* (#:key outputs #:allow-other-keys)
+                  (let ((out (assoc-ref outputs "out")))
+                    (with-directory-excursion "src/github.com/junegunn/fzf"
+                      (install-file "bin/fzf-tmux"
+                                    (string-append out "/bin"))))))
+              (add-after 'copy-binaries 'wrap-programs
+                (lambda* (#:key outputs inputs #:allow-other-keys)
+                  (let ((out (assoc-ref outputs "out"))
+                        (ncurses (assoc-ref inputs "ncurses")))
+                    (wrap-program (string-append out "/bin/fzf-tmux")
+                      `("PATH" ":" prefix (,(string-append ncurses "/bin")))))))
+              (add-after 'install 'install-completions
+                (lambda* (#:key outputs #:allow-other-keys)
+                  (let* ((out (assoc-ref outputs "out"))
+                         (bash-completion (string-append out "/etc/bash_completion.d"))
+                         (zsh-completion (string-append out "/share/zsh/site-functions")))
+                    (with-directory-excursion "src/github.com/junegunn/fzf"
+                      (mkdir-p bash-completion)
+                      (copy-file "shell/completion.bash"
+                                 (string-append bash-completion "/fzf"))
+                      (mkdir-p zsh-completion)
+                      (copy-file "shell/completion.zsh"
+                                 (string-append zsh-completion "/_fzf")))))))))))
+    (inputs
+     `(,@(package-inputs go-github-com-junegunn-fzf)
+       ("ncurses" ,ncurses)))))
+
 (define-public go-github.com-howeyc-gopass
   (let ((commit "bf9dde6d0d2c004a008c27aaee91170c786f6db8")
         (revision "0"))
-- 
2.30.0





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Fri, 19 Mar 2021 21:17:02 GMT) Full text and rfc822 format available.

Notification sent to EuAndreh <eu <at> euandre.org>:
bug acknowledged by developer. (Fri, 19 Mar 2021 21:17:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: EuAndreh <eu <at> euandre.org>
Cc: 45965-done <at> debbugs.gnu.org, mail <at> nicolasgoaziou.fr
Subject: Re: bug#45965: [PATCH 0/2] Update fzf, include binaries and install
 completions
Date: Fri, 19 Mar 2021 22:15:56 +0100
Hi,

EuAndreh <eu <at> euandre.org> skribis:

> * gnu/packages/terminals.scm (fzf): New variable, which inherits
>   from the existing go-github-com-junegunn-fzf package, but also
>   install other binary, and completion for direct usage.

I think it had fallen through the cracks; applied!

> +    (arguments
> +     `(,@(ensure-keyword-arguments
        ^^^
I simplified this to:

  (arguments (ensure-keyword-arguments …))

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#45965; Package guix-patches. (Sun, 21 Mar 2021 13:43:02 GMT) Full text and rfc822 format available.

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

From: EuAndreh <eu <at> euandre.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 45965-done <at> debbugs.gnu.org, mail <at> nicolasgoaziou.fr
Subject: Re: bug#45965: [PATCH 0/2] Update fzf,
 include binaries and install completions
Date: Sun, 21 Mar 2021 10:42:35 -0300
Thanks :)




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

This bug report was last modified 2 years and 344 days ago.

Previous Next


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