# Contributor: Kevin Daudt # Maintainer: Kevin Daudt pkgname=fzf pkgver=0.18.0 pkgrel=2 pkgdesc="A command-line fuzzy finder" url="https://github.com/junegunn/fzf" arch="all !s390x !aarch64 !armhf !armv7" 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"/ cd "$builddir" cp "$srcdir"/glide.yaml "$srcdir"/glide.lock . glide install --skip-test default_prepare } build() { cd "$builddir" make } check() { cd "$builddir" make test } package() { cd "$builddir" make install # Just copies the target binary to $buildir/bin install -Dm0755 bin/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_if="$pkgname=$pkgver-r$pkgrel vim" cd "$builddir" mkdir -p "$subpkgdir"/usr/share/vim/vimfiles/plugin/ install -Dm0644 plugin/fzf.vim "$subpkgdir"/usr/share/vim/vimfiles/plugin/ } nvim() { pkgdesc="fzf vim plugin for neovim" install_if="$pkgname=$pkgver-r$pkgrel neovim" cd "$builddir" mkdir -p "$subpkgdir"/usr/share/nvim/runtime/plugin/ install -Dm0644 plugin/fzf.vim "$subpkgdir"/usr/share/nvim/runtime/plugin/ } sha512sums="70dcda693ed6706f232874550f89cfcdbce1d28360244a728dd0640a4cfbbbd0899601f42c9096197c159cde86e89d287a06905cb5d665bd09b9d01cca2cb754 fzf-0.18.0.tar.gz dc14dea17ea585344e16eeffdc244693d97f4519676d20ec43434f6eff460d61be833399469ccb44c25c9fed296d52d424208c4a4cae5a3beecba14593cecd49 glide.yaml 5d1c0801d79a0425e1ec02c818bf440f2201841f356f32350fac06bf3ed7a7d03c0718cbeadc07143701895152f7ee19919e6e527be9e17c0df430f93d0282c9 glide.lock"