fzf: Update from 0.15.5 to 0.15.8
[termux-packages] / packages / fzf / build.sh
CommitLineData
9a653b46
FF
1TERMUX_PKG_HOMEPAGE=https://github.com/junegunn/fzf
2TERMUX_PKG_DESCRIPTION="Command-line fuzzy finder"
926b0cba 3TERMUX_PKG_VERSION=0.15.8
9a653b46
FF
4TERMUX_PKG_SRCURL=https://github.com/junegunn/fzf/archive/${TERMUX_PKG_VERSION}.tar.gz
5TERMUX_PKG_FOLDERNAME=fzf-${TERMUX_PKG_VERSION}
6TERMUX_PKG_BUILD_IN_SRC="yes"
7TERMUX_PKG_DEPENDS="bash, ncurses"
8
9termux_step_make_install () {
10 export GOPATH=$TERMUX_PKG_TMPDIR
11 cd $GOPATH
12 mkdir -p src/github.com/junegunn/fzf
13 cp -Rf $TERMUX_PKG_SRCDIR/* src/github.com/junegunn/fzf
14
15 termux_setup_golang
16 export CGO_CFLAGS="-I$TERMUX_PREFIX/include -L$TERMUX_PREFIX/lib"
17 export CGO_LDFLAGS="-L$TERMUX_PREFIX/lib"
18
926b0cba 19 mkdir -p $GOPATH/src/github.com/junegunn/fzf/src/vendor/github.com/junegunn/{go-runewidth,go-shellwords,go-isatty}
9a653b46
FF
20 for file in runewidth.go runewidth_posix.go; do
21 curl -o $GOPATH/src/github.com/junegunn/fzf/src/vendor/github.com/junegunn/go-runewidth/$file \
22 https://raw.githubusercontent.com/junegunn/go-runewidth/master/$file
23 done
24 for file in shellwords.go util_posix.go; do
25 curl -o $GOPATH/src/github.com/junegunn/fzf/src/vendor/github.com/junegunn/go-shellwords/$file \
26 https://raw.githubusercontent.com/junegunn/go-shellwords/master/$file
27 done
926b0cba
FF
28 curl -o $GOPATH/src/github.com/junegunn/fzf/src/vendor/github.com/junegunn/go-isatty/isatty_linux.go \
29 https://raw.githubusercontent.com/junegunn/go-isatty/master/isatty_linux.go
9a653b46
FF
30
31 cd $GOPATH/src/github.com/junegunn/fzf/src/fzf
32 CGO_ENABLED=1 go build -a -ldflags="-extldflags=-pie" -o $TERMUX_PREFIX/bin/fzf
33
34 # Install fzf-tmux, a bash script for launching fzf in a tmux pane:
35 cp $TERMUX_PKG_SRCDIR/bin/fzf-tmux $TERMUX_PREFIX/bin
36
37 # Install the fzf.1 man page:
38 mkdir -p $TERMUX_PREFIX/share/man/man1/
39 cp $TERMUX_PKG_SRCDIR/man/man1/fzf.1 $TERMUX_PREFIX/share/man/man1/
40
41 # Install the vim plugin:
b9f4b12c
FF
42 mkdir -p $TERMUX_PREFIX/share/vim/vim80/plugin
43 cp $TERMUX_PKG_SRCDIR/plugin/fzf.vim $TERMUX_PREFIX/share/vim/vim80/plugin/fzf.vim
9a653b46 44
faa5037a 45 # Install bash, zsh and fish helper scripts:
2c486815
B
46 mkdir -p "$TERMUX_PREFIX/share/fzf"
47 cp $TERMUX_PKG_SRCDIR/shell/* "$TERMUX_PREFIX/share/fzf"
48
9a653b46
FF
49 # Install the nvim plugin:
50 mkdir -p $TERMUX_PREFIX/share/nvim/runtime/plugin
51 cp $TERMUX_PKG_SRCDIR/plugin/fzf.vim $TERMUX_PREFIX/share/nvim/runtime/plugin/
52}
86053f6e 53
1fe99be6 54termux_step_post_massage () {
86053f6e 55 # Remove so that the vim build doesn't add it to vim-runtime:
b9f4b12c 56 rm $TERMUX_PREFIX/share/vim/vim80/plugin/fzf.vim
86053f6e 57}