aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlliver Schinagl <oliver@schinagl.nl>2019-10-15 08:01:26 +0200
committerKevin Daudt <kdaudt@alpinelinux.org>2019-10-20 19:08:30 +0000
commit5d511cda04396d1522aaf734171431005056967f (patch)
tree23ed83dcf41271c7d25566cbddab1d7c1d28b236
parent460b2e2d31490890f5c5077c2deaae341b3ef69f (diff)
downloadaports-5d511cda04396d1522aaf734171431005056967f.tar.gz
aports-5d511cda04396d1522aaf734171431005056967f.tar.bz2
aports-5d511cda04396d1522aaf734171431005056967f.tar.xz
testing/shfmt: new aport
https://mvdan.cc/sh A shell parser, formatter, and interpreter (sh/bash/mksh) Note, there is currently a known warning about cgo, which according to 'kaey'. loadinternal: cannot find runtime/cgo Signed-off-by: Olliver Schinagl <oliver@schinagl.nl> Closes !482
-rw-r--r--testing/shfmt/APKBUILD35
1 files changed, 35 insertions, 0 deletions
diff --git a/testing/shfmt/APKBUILD b/testing/shfmt/APKBUILD
new file mode 100644
index 0000000000..b0766a79f6
--- /dev/null
+++ b/testing/shfmt/APKBUILD
@@ -0,0 +1,35 @@
+# Contributor: Olliver Schinagl <oliver@schinagl.nl>
+# Maintainer: Olliver Schinagl <oliver@schinagl.nl>
+pkgname="shfmt"
+pkgver="v2.6.4"
+pkgrel=0
+pkgdesc="A shell parser, formatter, and interpreter (sh/bash/mksh)"
+url="https://mvdan.cc/sh"
+arch="all"
+license="BSD-3-Clause"
+options="!check" # No tests available
+depends="go"
+source="$pkgname-$pkgver.tar.gz::https://github.com/mvdan/sh/archive/$pkgver.tar.gz"
+builddir="$srcdir/sh-${pkgver#v*}"
+
+prepare() {
+ mkdir -p "$srcdir/go/src/mvdan.cc"
+ if [ ! -L "$srcdir/go/src/mvdan.cc/sh" ]; then
+ ln -s "$builddir" "$srcdir/go/src/mvdan.cc/sh"
+ fi
+}
+
+build() {
+ export GOPATH="$srcdir/go"
+ go build \
+ -ldflags "-w -X main.version=$pkgver-$pkgrel" \
+ -v \
+ "./cmd/shfmt/"
+}
+
+package() {
+ install -D -m 755 -t "$pkgdir/usr/bin" \
+ "$builddir/shfmt"
+}
+
+sha512sums="e7afd566a35606c6e137654fa1caf349429ba3a27ee804e6763ecdfab779bd189fd5ac853a301bf1d4371dc6115fd89b80474cf051678768f84dd553f7faafe8 shfmt-v2.6.4.tar.gz"