summaryrefslogtreecommitdiff
path: root/repo/util/fzf.xibuild
blob: a144f28a2950ba84dc9f639facb786c4413bb133 (plain)
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
#!/bin/sh

MAKEDEPS="git go"
DEPS="sh"

PKG_VER=0.29.0
SOURCE=https://github.com/junegunn/fzf.git
BRANCH=$PKG_VER
DESC="Command-line fuzzy finder"

prepare () {
	sed -i 's/-w /-w -linkmode external /' Makefile
}

build () {
    export CGO_LDFLAGS="${LDFLAGS}"
	export CGO_CFLAGS="${CFLAGS}"
	export CGO_CPPFLAGS="${CPPFLAGS}"
	export CGO_CXXFLAGS="${CXXFLAGS}"
	export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
	make

}

package () {
	## Man page
	install -Dm644 man/man1/fzf.1 "$PKG_DEST"/usr/share/man/man1/fzf.1
	install -Dm644 man/man1/fzf-tmux.1 "$PKG_DEST"/usr/share/man/man1/fzf-tmux.1

	## License
	install -Dm644 LICENSE "$PKG_DEST"/usr/share/licenses/fzf/LICENSE

	## Binaries
	install -dm755 "$PKG_DEST"/usr/bin
	install -m755 bin/fzf-tmux "$PKG_DEST"/usr/bin/
	install -Dm755 target/fzf-linux_amd64 "$PKG_DEST"/usr/bin/fzf

	## Completion and keybindings
	install -dm755 "$PKG_DEST"/usr/share/fzf
	install -m644 shell/*.bash shell/*.zsh "$PKG_DEST"/usr/share/fzf

	## Fish keybindings
	install -Dm644 shell/key-bindings.fish "$PKG_DEST"/usr/share/fish/vendor_functions.d/fzf_key_bindings.fish

	## Vim plugin
	install -Dm644 doc/fzf.txt "$PKG_DEST"/usr/share/vim/vimfiles/doc/fzf.txt
	install -Dm644 plugin/fzf.vim "$PKG_DEST"/usr/share/vim/vimfiles/plugin/fzf.vim

}