aboutsummaryrefslogtreecommitdiffstats
path: root/community/fzf/APKBUILD
blob: 45cabd9f6fbbdc8482550fcec3511206f38ff6f3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Contributor: Robert White <rjwhite2453@gmail.com>
# Contributor: Kevin Daudt <kdaudt@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=fzf
pkgver=0.24.4
pkgrel=0
pkgdesc="A command-line fuzzy finder"
url="https://github.com/junegunn/fzf"
arch="all !mips !mips64" # limited by go
license="MIT"
makedepends="go bash tmux"
options="net"
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
	find-buzybox-compat.patch
	"

export GOPATH="$srcdir"

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/
}

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="348cc000b4e28054bff56a37171ef4dd7ac22c7c292c19c3c0b95f3d30856b443887447604e1e38cfd71b421a22c1135a13cb40c78e5b34d477acaa3dcadb821  fzf-0.24.4.tar.gz
c59e7eb712f5072a2c66b79800f7674d1f9208b1ead4f654e57f8dcb673a45a751725a005c89759847f78c7ae7f246980b2c94e5fff5a3e8c2f6a364965e567e  find-buzybox-compat.patch"