# Contributor: Robert White # Contributor: Kevin Daudt # Maintainer: Kevin Daudt pkgname=fzf pkgver=0.18.0 pkgrel=4 pkgdesc="A command-line fuzzy finder" url="https://github.com/junegunn/fzf" arch="all" license="MIT" makedepends="go glide bash tmux" subpackages=" $pkgname-tmux::noarch $pkgname-bash-completion:bashcomp:noarch $pkgname-zsh-completion:zshcomp:noarch $pkgname-vim:vim:noarch $pkgname-neovim:nvim:noarch $pkgname-doc " source="$pkgname-$pkgver.tar.gz::https://github.com/junegunn/fzf/archive/$pkgver.tar.gz glide.yaml glide.lock" builddir="$srcdir/src/github.com/junegunn/$pkgname" prepare() { export GOPATH="$srcdir" mkdir -p "$(dirname "$builddir")" mv "$srcdir"/$pkgname-$pkgver "$builddir"/ cp "$srcdir"/glide.yaml "$srcdir"/glide.lock . glide install --skip-test default_prepare } build() { go build } check() { # shellcheck disable=SC1007 SHELL=/bin/sh GOOS= go test -v \ github.com/junegunn/fzf/src \ github.com/junegunn/fzf/src/algo \ github.com/junegunn/fzf/src/tui \ github.com/junegunn/fzf/src/util } package() { install -Dm0755 fzf "$pkgdir"/usr/bin/fzf install -D man/man1/fzf.1 "$pkgdir"/usr/share/man/man1/fzf.1 install -D man/man1/fzf-tmux.1 "$pkgdir"/usr/share/man/man1/fzf-tmux.1 } tmux() { depends="tmux bash" pkgdesc="Helper script to start fzf in a tmux pane" cd "$builddir" install -Dm0755 bin/fzf-tmux "$subpkgdir"/usr/bin/fzf-tmux } bashcomp() { pkgdesc="additional scripts for bash like shell completion and keybindings" depends="" install_if="$pkgname=$pkgver-r$pkgrel bash-completion" cd "$builddir" install -Dm0644 shell/completion.bash \ "$subpkgdir"/usr/share/bash-completion/completions/$pkgname mkdir -p "$subpkgdir"/usr/share/fzf/ install -m0644 shell/key-bindings.bash "$subpkgdir"/usr/share/fzf/ } zshcomp() { pkgdesc="additional scripts for zsh like shell completion and keybindings" depends="" install_if="$pkgname=$pkgver-r$pkgrel zsh" cd "$builddir" install -Dm0644 shell/completion.zsh \ "$subpkgdir"/usr/share/zsh/site-functions/_$pkgname mkdir -p "$subpkgdir"/usr/share/fzf/ install -m0644 shell/key-bindings.zsh "$subpkgdir"/usr/share/fzf/ } glide_init() { abuild clean deps unpack prepare cd "$builddir" export GOPATH="$startdir" rm -f glide.yaml glide.lock glide init --non-interactive glide update cp glide.yaml glide.lock "$startdir" cd "$startdir" && abuild checksum clean } vim() { pkgdesc="fzf vim plugin" install="$pkgname-vim.post-install" install_if="$pkgname=$pkgver-r$pkgrel vim" cd "$builddir" install -Dm0644 plugin/fzf.vim "$subpkgdir"/usr/share/vim/vimfiles/plugin/fzf.vim install -Dm0644 doc/fzf.txt "$subpkgdir"/usr/share/vim/vimfiles/doc/fzf.txt } nvim() { pkgdesc="fzf vim plugin for neovim" install_if="$pkgname=$pkgver-r$pkgrel neovim" cd "$builddir" install -Dm0644 plugin/fzf.vim "$subpkgdir"/usr/share/nvim/runtime/plugin/fzf.vim install -Dm0644 doc/fzf.txt "$subpkgdir"/usr/share/nvim/runtime/doc/fzf.txt } cleanup_srcdir() { export GOPATH="$srcdir" go clean -modcache default_cleanup_srcdir } sha512sums="70dcda693ed6706f232874550f89cfcdbce1d28360244a728dd0640a4cfbbbd0899601f42c9096197c159cde86e89d287a06905cb5d665bd09b9d01cca2cb754 fzf-0.18.0.tar.gz dc14dea17ea585344e16eeffdc244693d97f4519676d20ec43434f6eff460d61be833399469ccb44c25c9fed296d52d424208c4a4cae5a3beecba14593cecd49 glide.yaml 5d1c0801d79a0425e1ec02c818bf440f2201841f356f32350fac06bf3ed7a7d03c0718cbeadc07143701895152f7ee19919e6e527be9e17c0df430f93d0282c9 glide.lock"