aboutsummaryrefslogtreecommitdiffstats
path: root/community/fzf/APKBUILD
blob: 4e073e0ddbab98a4992e50bdd646f44d26a854af (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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# Contributor: Kevin Daudt <kdaudt@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=fzf
pkgver=0.18.0
pkgrel=3
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="$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
}

sha512sums="70dcda693ed6706f232874550f89cfcdbce1d28360244a728dd0640a4cfbbbd0899601f42c9096197c159cde86e89d287a06905cb5d665bd09b9d01cca2cb754  fzf-0.18.0.tar.gz
dc14dea17ea585344e16eeffdc244693d97f4519676d20ec43434f6eff460d61be833399469ccb44c25c9fed296d52d424208c4a4cae5a3beecba14593cecd49  glide.yaml
5d1c0801d79a0425e1ec02c818bf440f2201841f356f32350fac06bf3ed7a7d03c0718cbeadc07143701895152f7ee19919e6e527be9e17c0df430f93d0282c9  glide.lock"