unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: guix-patches--- via <guix-patches@gnu.org>
To: 45965@debbugs.gnu.org
Cc: EuAndreh <eu@euandre.org>
Subject: [bug#45965] [PATCH 1/2] gnu: go-github-com-junegunn-fzf: Copy binaries and install shell completions.
Date: Mon, 18 Jan 2021 16:04:58 -0300	[thread overview]
Message-ID: <20210118190459.27787-1-eu@euandre.org> (raw)
In-Reply-To: <20210118185925.24412-1-eu@euandre.org>

* 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





  reply	other threads:[~2021-01-18 19:06 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 ` guix-patches--- via [this message]
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     ` [bug#45965] [PATCH] gnu: Add fzf EuAndreh via Guix-patches via
2021-03-19 21:15       ` bug#45965: [PATCH 0/2] Update fzf, include binaries and install completions 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=20210118190459.27787-1-eu@euandre.org \
    --to=guix-patches@gnu.org \
    --cc=45965@debbugs.gnu.org \
    --cc=eu@euandre.org \
    /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).