autossh: Update from 1.4e to 1.4f
[termux-packages] / packages / fzf / build.sh
index 06c48c1..5b9a604 100644 (file)
@@ -1,39 +1,38 @@
 TERMUX_PKG_HOMEPAGE=https://github.com/junegunn/fzf
 TERMUX_PKG_DESCRIPTION="Command-line fuzzy finder"
-# Use git master until next release with https://github.com/junegunn/fzf/pull/768
-TERMUX_PKG_VERSION=0.15.9.1
-_COMMIT=847c512539f9909ae69a5067c1a64cb9bb485ea3
-# TERMUX_PKG_SRCURL=https://github.com/junegunn/fzf/archive/${TERMUX_PKG_VERSION}.tar.gz
-# TERMUX_PKG_FOLDERNAME=fzf-${TERMUX_PKG_VERSION}
-TERMUX_PKG_SRCURL=https://github.com/junegunn/fzf/archive/$_COMMIT.zip
-TERMUX_PKG_FOLDERNAME=fzf-$_COMMIT
+TERMUX_PKG_VERSION=0.17.3
+TERMUX_PKG_SHA256=e843904417adf926613431e4403fded24fade56269446e92aac6ff1db86af81e
+TERMUX_PKG_SRCURL=https://github.com/junegunn/fzf/archive/${TERMUX_PKG_VERSION}.tar.gz
 TERMUX_PKG_BUILD_IN_SRC="yes"
-TERMUX_PKG_DEPENDS="bash, ncurses"
+# 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_install () {
-       export GOPATH=$TERMUX_PKG_TMPDIR
-       cd $GOPATH
-       mkdir -p src/github.com/junegunn/fzf
-       cp -Rf $TERMUX_PKG_SRCDIR/* src/github.com/junegunn/fzf
+termux_step_make() {
+       :
+}
 
+termux_step_make_install () {
        termux_setup_golang
-       export CGO_CFLAGS="-I$TERMUX_PREFIX/include -L$TERMUX_PREFIX/lib"
+       export CGO_CFLAGS="-I$TERMUX_PREFIX/include"
        export CGO_LDFLAGS="-L$TERMUX_PREFIX/lib"
 
-       mkdir -p $GOPATH/src/github.com/junegunn/fzf/src/vendor/github.com/junegunn/{go-runewidth,go-shellwords,go-isatty}
-       for file in runewidth.go runewidth_posix.go; do
-               curl -o $GOPATH/src/github.com/junegunn/fzf/src/vendor/github.com/junegunn/go-runewidth/$file \
-                       https://raw.githubusercontent.com/junegunn/go-runewidth/master/$file
-       done
-       for file in shellwords.go util_posix.go; do
-               curl -o $GOPATH/src/github.com/junegunn/fzf/src/vendor/github.com/junegunn/go-shellwords/$file \
-                       https://raw.githubusercontent.com/junegunn/go-shellwords/master/$file
-       done
-       curl -o $GOPATH/src/github.com/junegunn/fzf/src/vendor/github.com/junegunn/go-isatty/isatty_linux.go \
-               https://raw.githubusercontent.com/junegunn/go-isatty/master/isatty_linux.go
-
-       cd $GOPATH/src/github.com/junegunn/fzf/src/fzf
-       CGO_ENABLED=1 go build -a -ldflags="-extldflags=-pie" -o $TERMUX_PREFIX/bin/fzf
+       # 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
+
+       LDFLAGS="-pie" make $_BINARY
+       cp $_BINARY $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