Browse Source

fzf: fix build errors

android-5
Leonid Plyushch 6 years ago
committed by Fredrik Fornwall
parent
commit
1d0423b54b
  1. 11
      packages/fzf/Makefile.patch
  2. 40
      packages/fzf/build.sh

11
packages/fzf/Makefile.patch

@ -1,11 +0,0 @@
--- ../cache/fzf-0.17.3/Makefile 2017-12-03 14:55:24.000000000 +0000
+++ ./Makefile 2018-02-24 00:04:59.992543575 +0000
@@ -99,7 +99,7 @@
ln -sf $(ROOT_DIR)/vendor $(VENDOR_LINK)
vendor: $(GLIDE_YAML)
- go get -u github.com/Masterminds/glide && $(GOPATH)/bin/glide install && touch $@
+ GOOS= CC= GOARCH= CGO_ENABLED= go get -u github.com/Masterminds/glide && $(GOPATH)/bin/glide install && touch $@
test: $(SOURCES) vendor
SHELL=/bin/sh GOOS= go test -v -tags "$(TAGS)" \

40
packages/fzf/build.sh

@ -4,39 +4,31 @@ TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_VERSION=0.18.0
TERMUX_PKG_SHA256=5406d181785ea17b007544082b972ae004b62fb19cdb41f25e265ea3cc8c2d9d
TERMUX_PKG_SRCURL=https://github.com/junegunn/fzf/archive/${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_BUILD_IN_SRC="yes"
# Depend on findutils as fzf uses the -fstype option, which busybox
# find does not support, when invoking find:
TERMUX_PKG_DEPENDS="bash, findutils"
termux_step_make() {
:
termux_setup_golang
export GOPATH=$TERMUX_PKG_BUILDDIR
mkdir -p $GOPATH/src/github.com/junegunn
ln -sf $TERMUX_PKG_SRCDIR $GOPATH/src/github.com/junegunn/fzf
cd $GOPATH/src/github.com/junegunn/fzf
go get -d -v github.com/junegunn/fzf
go build
}
termux_step_make_install() {
termux_setup_golang
export CGO_CFLAGS="-I$TERMUX_PREFIX/include"
export CGO_LDFLAGS="-L$TERMUX_PREFIX/lib"
# See the fzf Makefile:
local _BINARY="target/fzf-${GOOS}_"
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
cd $GOPATH/src/github.com/junegunn/fzf
LDFLAGS="-pie" make $_BINARY
cp $_BINARY $TERMUX_PREFIX/bin/fzf
install -Dm700 fzf $TERMUX_PREFIX/bin/fzf
# Install fzf-tmux, a bash script for launching fzf in a tmux pane:
cp $TERMUX_PKG_SRCDIR/bin/fzf-tmux $TERMUX_PREFIX/bin
install -Dm700 $TERMUX_PKG_SRCDIR/bin/fzf-tmux $TERMUX_PREFIX/bin/fzf-tmux
# Install the fzf.1 man page:
mkdir -p $TERMUX_PREFIX/share/man/man1/
@ -51,8 +43,8 @@ termux_step_make_install() {
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"
mkdir -p $TERMUX_PREFIX/share/fzf
cp $TERMUX_PKG_SRCDIR/shell/* $TERMUX_PREFIX/share/fzf/
# Install the nvim plugin:
mkdir -p $TERMUX_PREFIX/share/nvim/runtime/plugin

Loading…
Cancel
Save