termux-packages/packages/shfmt/build.sh

23 lines
706 B
Bash
Raw Normal View History

2020-06-15 11:39:37 +02:00
TERMUX_PKG_HOMEPAGE=https://github.com/mvdan/sh
TERMUX_PKG_DESCRIPTION="A shell parser and formatter"
TERMUX_PKG_LICENSE="BSD 3-Clause"
TERMUX_PKG_MAINTAINER="@termux"
2020-12-07 23:41:43 +01:00
TERMUX_PKG_VERSION=3.2.1
2020-06-15 11:39:37 +02:00
TERMUX_PKG_SRCURL=https://github.com/mvdan/sh/archive/v${TERMUX_PKG_VERSION}.tar.gz
2020-12-07 23:41:43 +01:00
TERMUX_PKG_SHA256=a1470285e04b69ee7a2bb3948b64e1da9cabe59658997b50aac7c64465f330bd
2020-06-15 11:39:37 +02:00
termux_step_make_install() {
cd "$TERMUX_PKG_SRCDIR"
termux_setup_golang
export GOPATH="$TERMUX_PKG_BUILDDIR"
mkdir -p "$GOPATH/src/github.com/mvdan"
ln -sf "$TERMUX_PKG_SRCDIR" "$GOPATH/src/github.com/mvdan/sh"
go build -modcacherw \
-ldflags "-X main.version=$TERMUX_PKG_VERSION" \
-o "$TERMUX_PREFIX/bin/shfmt" \
./cmd/shfmt
}