mc: multple fixes (#2367)
[termux-packages] / packages / fzf / build.sh
1 TERMUX_PKG_HOMEPAGE=https://github.com/junegunn/fzf
2 TERMUX_PKG_DESCRIPTION="Command-line fuzzy finder"
3 TERMUX_PKG_VERSION=0.17.3
4 TERMUX_PKG_SHA256=e843904417adf926613431e4403fded24fade56269446e92aac6ff1db86af81e
5 TERMUX_PKG_SRCURL=https://github.com/junegunn/fzf/archive/${TERMUX_PKG_VERSION}.tar.gz
6 TERMUX_PKG_BUILD_IN_SRC="yes"
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"
10
11 termux_step_make() {
12 :
13 }
14
15 termux_step_make_install () {
16 termux_setup_golang
17 export CGO_CFLAGS="-I$TERMUX_PREFIX/include"
18 export CGO_LDFLAGS="-L$TERMUX_PREFIX/lib"
19
20 # See the fzf Makefile:
21 local _BINARY="target/fzf-${GOOS}_"
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
34 LDFLAGS="-pie" make $_BINARY
35 cp $_BINARY $TERMUX_PREFIX/bin/fzf
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:
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
47
48 # Install bash, zsh and fish helper scripts:
49 mkdir -p "$TERMUX_PREFIX/share/fzf"
50 cp $TERMUX_PKG_SRCDIR/shell/* "$TERMUX_PREFIX/share/fzf"
51
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 }
56
57 termux_step_post_massage () {
58 # Remove so that the vim build doesn't add it to vim-runtime:
59 rm $TERMUX_PREFIX/share/vim/vim80/plugin/fzf.vim
60 }