termux-packages/packages/fzf/build.sh

66 lines
2.1 KiB
Bash
Raw Normal View History

2016-01-11 01:51:38 +01:00
TERMUX_PKG_HOMEPAGE=https://github.com/junegunn/fzf
TERMUX_PKG_DESCRIPTION="Command-line fuzzy finder"
2019-01-21 13:53:58 +01:00
TERMUX_PKG_LICENSE="MIT"
2018-10-07 19:20:01 +02:00
TERMUX_PKG_VERSION=0.17.5
TERMUX_PKG_SHA256=de3b39758e01b19bbc04ee0d5107e14052d3a32ce8f40d4a63d0ed311394f7ee
2017-01-16 10:35:29 +01:00
TERMUX_PKG_SRCURL=https://github.com/junegunn/fzf/archive/${TERMUX_PKG_VERSION}.tar.gz
2016-01-11 01:51:38 +01:00
TERMUX_PKG_BUILD_IN_SRC="yes"
2017-02-20 04:34:13 +01:00
# Depend on findutils as fzf uses the -fstype option, which busybox
# find does not support, when invoking find:
TERMUX_PKG_DEPENDS="bash, findutils"
2016-01-11 01:51:38 +01:00
2017-07-10 10:09:47 +02:00
termux_step_make() {
:
}
2016-01-11 01:51:38 +01:00
termux_step_make_install () {
termux_setup_golang
2017-01-16 10:35:29 +01:00
export CGO_CFLAGS="-I$TERMUX_PREFIX/include"
2016-01-11 01:51:38 +01:00
export CGO_LDFLAGS="-L$TERMUX_PREFIX/lib"
2017-02-20 04:34:13 +01:00
# See the fzf Makefile:
2017-07-10 10:09:47 +02:00
local _BINARY="target/fzf-${GOOS}_"
2017-02-20 04:34:13 +01:00
if [ $TERMUX_ARCH = "arm" ]; then
_BINARY+="arm7"
elif [ $TERMUX_ARCH = "i686" ]; then
_BINARY+="386"
elif [ $TERMUX_ARCH = "x86_64" ]; then
_BINARY+="amd64"
elif [ $TERMUX_ARCH = "aarch64" ]; then
_BINARY+="arm8"
else
termux_error_exit "Unsupported arch: $TERMUX_ARCH"
fi
LDFLAGS="-pie" make $_BINARY
cp $_BINARY $TERMUX_PREFIX/bin/fzf
2016-01-11 01:51:38 +01:00
# Install fzf-tmux, a bash script for launching fzf in a tmux pane:
cp $TERMUX_PKG_SRCDIR/bin/fzf-tmux $TERMUX_PREFIX/bin
# Install the fzf.1 man page:
mkdir -p $TERMUX_PREFIX/share/man/man1/
cp $TERMUX_PKG_SRCDIR/man/man1/fzf.1 $TERMUX_PREFIX/share/man/man1/
# Install the vim plugin:
mkdir -p $TERMUX_PREFIX/share/vim/vim81/plugin
cp $TERMUX_PKG_SRCDIR/plugin/fzf.vim $TERMUX_PREFIX/share/vim/vim81/plugin/fzf.vim
2016-01-11 01:51:38 +01:00
2018-09-14 20:59:52 +02:00
# Install bash completion script:
mkdir -p $TERMUX_PREFIX/share/bash-completion/completions/
cp $TERMUX_PKG_SRCDIR/shell/completion.bash $TERMUX_PREFIX/share/bash-completion/completions/fzf
# Install the rest of the shell scripts:
mkdir -p "$TERMUX_PREFIX/share/fzf"
cp $TERMUX_PKG_SRCDIR/shell/* "$TERMUX_PREFIX/share/fzf"
2016-01-11 01:51:38 +01:00
# Install the nvim plugin:
mkdir -p $TERMUX_PREFIX/share/nvim/runtime/plugin
cp $TERMUX_PKG_SRCDIR/plugin/fzf.vim $TERMUX_PREFIX/share/nvim/runtime/plugin/
}
2016-02-15 14:14:37 +01:00
termux_step_post_massage () {
# Remove so that the vim build doesn't add it to vim-runtime:
rm $TERMUX_PREFIX/share/vim/vim81/plugin/fzf.vim
}