unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: EuAndreh via Guix-patches via <guix-patches@gnu.org>
To: mail@nicolasgoaziou.fr, 45965@debbugs.gnu.org
Cc: EuAndreh <eu@euandre.org>
Subject: [bug#45965] [PATCH] gnu: Add fzf.
Date: Mon,  8 Feb 2021 14:08:27 -0300	[thread overview]
Message-ID: <20210208170827.29641-1-eu@euandre.org> (raw)
In-Reply-To: <87v9b6ywml.fsf@euandre.org>

* 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	other threads:[~2021-02-08 20:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-18 18:59 [bug#45965] [PATCH 0/2] Update fzf, include binaries and install completions guix-patches--- via
2021-01-18 19:04 ` [bug#45965] [PATCH 1/2] gnu: go-github-com-junegunn-fzf: Copy binaries and install shell completions guix-patches--- via
2021-01-18 19:04   ` [bug#45965] [PATCH 2/2] gnu: go-github-com-junegunn-fzf: Update to 0.25.0 guix-patches--- via
2021-02-05 20:57 ` [bug#45965] [PATCH 0/2] Update fzf, include binaries and install completions Nicolas Goaziou
2021-02-05 22:31   ` EuAndreh via Guix-patches via
2021-02-08 17:08     ` EuAndreh via Guix-patches via [this message]
2021-03-19 21:15       ` bug#45965: " Ludovic Courtès
2021-03-21 13:42         ` [bug#45965] " EuAndreh via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210208170827.29641-1-eu@euandre.org \
    --to=guix-patches@gnu.org \
    --cc=45965@debbugs.gnu.org \
    --cc=eu@euandre.org \
    --cc=mail@nicolasgoaziou.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).