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