aboutsummaryrefslogtreecommitdiffstats
path: root/testing/shfmt/APKBUILD
blob: bfe128eb282be4c5bb7ad39bb796e71ee8a1d5ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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
makedepends="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"