fzf: Update from 0.16.9 to 0.16.11
[termux-packages] / packages / fzf / build.sh
CommitLineData
9a653b46
FF
1TERMUX_PKG_HOMEPAGE=https://github.com/junegunn/fzf
2TERMUX_PKG_DESCRIPTION="Command-line fuzzy finder"
c3288ef2
FF
3TERMUX_PKG_VERSION=0.16.11
4TERMUX_PKG_SHA256=e3067d4ad58d7be51eba9a35c06518cd7145c0cc297882796c7e40285f268a99
39e14913
FF
5TERMUX_PKG_SRCURL=https://github.com/junegunn/fzf/archive/${TERMUX_PKG_VERSION}.tar.gz
6TERMUX_PKG_FOLDERNAME=fzf-$TERMUX_PKG_VERSION
9a653b46 7TERMUX_PKG_BUILD_IN_SRC="yes"
77a28266
FF
8# Depend on findutils as fzf uses the -fstype option, which busybox
9# find does not support, when invoking find:
10TERMUX_PKG_DEPENDS="bash, findutils"
9a653b46 11
f1a05d25
FF
12termux_step_make() {
13 :
14}
15
9a653b46 16termux_step_make_install () {
9a653b46 17 termux_setup_golang
39e14913 18 export CGO_CFLAGS="-I$TERMUX_PREFIX/include"
9a653b46
FF
19 export CGO_LDFLAGS="-L$TERMUX_PREFIX/lib"
20
77a28266 21 # See the fzf Makefile:
f1a05d25 22 local _BINARY="target/fzf-${GOOS}_"
77a28266
FF
23 if [ $TERMUX_ARCH = "arm" ]; then
24 _BINARY+="arm7"
25 elif [ $TERMUX_ARCH = "i686" ]; then
26 _BINARY+="386"
27 elif [ $TERMUX_ARCH = "x86_64" ]; then
28 _BINARY+="amd64"
29 elif [ $TERMUX_ARCH = "aarch64" ]; then
30 _BINARY+="arm8"
31 else
32 termux_error_exit "Unsupported arch: $TERMUX_ARCH"
33 fi
34
77a28266
FF
35 LDFLAGS="-pie" make $_BINARY
36 cp $_BINARY $TERMUX_PREFIX/bin/fzf
9a653b46
FF
37
38 # Install fzf-tmux, a bash script for launching fzf in a tmux pane:
39 cp $TERMUX_PKG_SRCDIR/bin/fzf-tmux $TERMUX_PREFIX/bin
40
41 # Install the fzf.1 man page:
42 mkdir -p $TERMUX_PREFIX/share/man/man1/
43 cp $TERMUX_PKG_SRCDIR/man/man1/fzf.1 $TERMUX_PREFIX/share/man/man1/
44
45 # Install the vim plugin:
b9f4b12c
FF
46 mkdir -p $TERMUX_PREFIX/share/vim/vim80/plugin
47 cp $TERMUX_PKG_SRCDIR/plugin/fzf.vim $TERMUX_PREFIX/share/vim/vim80/plugin/fzf.vim
9a653b46 48
faa5037a 49 # Install bash, zsh and fish helper scripts:
2c486815
B
50 mkdir -p "$TERMUX_PREFIX/share/fzf"
51 cp $TERMUX_PKG_SRCDIR/shell/* "$TERMUX_PREFIX/share/fzf"
52
9a653b46
FF
53 # Install the nvim plugin:
54 mkdir -p $TERMUX_PREFIX/share/nvim/runtime/plugin
55 cp $TERMUX_PKG_SRCDIR/plugin/fzf.vim $TERMUX_PREFIX/share/nvim/runtime/plugin/
56}
86053f6e 57
1fe99be6 58termux_step_post_massage () {
86053f6e 59 # Remove so that the vim build doesn't add it to vim-runtime:
b9f4b12c 60 rm $TERMUX_PREFIX/share/vim/vim80/plugin/fzf.vim
86053f6e 61}