From b0e536a257d418be062d1db2530c884cc62517b1 Mon Sep 17 00:00:00 2001 From: Faheem Pervez Date: Mon, 15 Jun 2020 10:39:37 +0100 Subject: [PATCH] new package: shfmt (#5402) --- packages/shfmt/build.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 packages/shfmt/build.sh diff --git a/packages/shfmt/build.sh b/packages/shfmt/build.sh new file mode 100644 index 000000000..c6a45c12d --- /dev/null +++ b/packages/shfmt/build.sh @@ -0,0 +1,21 @@ +TERMUX_PKG_HOMEPAGE=https://github.com/mvdan/sh +TERMUX_PKG_DESCRIPTION="A shell parser and formatter" +TERMUX_PKG_LICENSE="BSD 3-Clause" +TERMUX_PKG_VERSION=3.1.1 +TERMUX_PKG_SRCURL=https://github.com/mvdan/sh/archive/v${TERMUX_PKG_VERSION}.tar.gz +TERMUX_PKG_SHA256=db5d86d9caeb025e41307cb834b21d7a35e171afe5257277e74cb3e44a17ae00 + +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 +}