Commit | Line | Data |
---|---|---|
9a653b46 FF |
1 | TERMUX_PKG_HOMEPAGE=https://github.com/junegunn/fzf |
2 | TERMUX_PKG_DESCRIPTION="Command-line fuzzy finder" | |
3 | TERMUX_PKG_VERSION=0.11.1 | |
4 | TERMUX_PKG_SRCURL=https://github.com/junegunn/fzf/archive/${TERMUX_PKG_VERSION}.tar.gz | |
5 | TERMUX_PKG_FOLDERNAME=fzf-${TERMUX_PKG_VERSION} | |
6 | TERMUX_PKG_BUILD_IN_SRC="yes" | |
7 | TERMUX_PKG_DEPENDS="bash, ncurses" | |
8 | ||
9 | termux_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 | ||
19 | for file in runewidth.go runewidth_posix.go; do | |
20 | curl -o $GOPATH/src/github.com/junegunn/fzf/src/vendor/github.com/junegunn/go-runewidth/$file \ | |
21 | https://raw.githubusercontent.com/junegunn/go-runewidth/master/$file | |
22 | done | |
23 | for file in shellwords.go util_posix.go; do | |
24 | curl -o $GOPATH/src/github.com/junegunn/fzf/src/vendor/github.com/junegunn/go-shellwords/$file \ | |
25 | https://raw.githubusercontent.com/junegunn/go-shellwords/master/$file | |
26 | done | |
27 | ||
28 | cd $GOPATH/src/github.com/junegunn/fzf/src/fzf | |
29 | CGO_ENABLED=1 go build -a -ldflags="-extldflags=-pie" -o $TERMUX_PREFIX/bin/fzf | |
30 | ||
31 | # Install fzf-tmux, a bash script for launching fzf in a tmux pane: | |
32 | cp $TERMUX_PKG_SRCDIR/bin/fzf-tmux $TERMUX_PREFIX/bin | |
33 | ||
34 | # Install the fzf.1 man page: | |
35 | mkdir -p $TERMUX_PREFIX/share/man/man1/ | |
36 | cp $TERMUX_PKG_SRCDIR/man/man1/fzf.1 $TERMUX_PREFIX/share/man/man1/ | |
37 | ||
38 | # Install the vim plugin: | |
39 | mkdir -p $TERMUX_PREFIX/share/vim/vim74/plugin | |
40 | cp $TERMUX_PKG_SRCDIR/plugin/fzf.vim $TERMUX_PREFIX/share/vim/vim74/plugin | |
41 | ||
42 | # Install the nvim plugin: | |
43 | mkdir -p $TERMUX_PREFIX/share/nvim/runtime/plugin | |
44 | cp $TERMUX_PKG_SRCDIR/plugin/fzf.vim $TERMUX_PREFIX/share/nvim/runtime/plugin/ | |
45 | } |