Skip to content

Instantly share code, notes, and snippets.

@aidanharris
Created November 9, 2017 02:41
Show Gist options
  • Save aidanharris/03ce326e1b06e3ced8897c55094a52cd to your computer and use it in GitHub Desktop.
Save aidanharris/03ce326e1b06e3ced8897c55094a52cd to your computer and use it in GitHub Desktop.
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
GOLANG_PKG_IMPORTPATH="github.com/junegunn"
GOLANG_PKG_TAGS="${PV}"
GOLANG_PKG_HAVE_TEST=1
GOLANG_PKG_USE_CGO=1
inherit golang-live bash-completion-r1
DESCRIPTION="A general-purpose command-line fuzzy finder"
LICENSE="MIT"
SLOT="0"
KEYWORDS="amd64 arm x86"
IUSE="tmux neovim vim bash-completion zsh-completion fish-completion"
RDEPEND="tmux? ( app-misc/tmux )"
src_install() {
golang-live_src_install
doman man/man1/${PN}.1
# Install TMUX utils
if use tmux; then
dobin bin/${PN}-tmux
doman man/man1/${PN}-tmux.1
fi
# Install bash completion files
if use bash-completion; then
newbashcomp shell/completion.bash ${PN}
insinto /etc/profile.d/
newins shell/key-bindings.bash ${PN}.sh
fi
# Install zsh completion files
if use zsh-completion; then
insinto /usr/share/zsh/site-functions
newins shell/completion.zsh _${PN}
insinto /usr/share/zsh/site-contrib/
newins shell/key-bindings.zsh ${PN}.zsh
fi
# Install fish completion files
if use fish-completion; then
insinto /usr/share/fish/functions/
newins shell/key-bindings.fish fzf_key_bindings.fish
fi
# Install VIM plugin
if use vim; then
insinto /usr/share/vim/vimfiles/plugin
doins plugin/${PN}.vim
fi
# Install Neovim plugin
if use neovim; then
insinto /usr/share/nvim/runtime/plugin
doins plugin/${PN}.vim
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment