aboutsummaryrefslogtreecommitdiffstats
path: root/community/shfmt/APKBUILD
blob: 1c8c9b1dcdf95e03b6c6e4b06378e47b4c4d6c6c (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
# Contributor: Olliver Schinagl <oliver@schinagl.nl>
# Maintainer: Olliver Schinagl <oliver@schinagl.nl>
pkgname=shfmt
pkgver=3.3.1
pkgrel=0
pkgdesc="A shell parser, formatter, and interpreter (sh/bash/mksh)"
url="https://mvdan.cc/sh"
arch="all"
license="BSD-3-Clause"
makedepends="go scdoc"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/mvdan/sh/archive/v$pkgver.tar.gz"
builddir="$srcdir/sh-$pkgver"

build() {
	go build \
		-ldflags "-w -X main.version=$pkgver-$pkgrel" \
		-v \
		./cmd/shfmt
	scdoc < cmd/shfmt/shfmt.1.scd | gzip > shfmt.1.gz
}

check() {
	go test ./...
}

package() {
	install -Dm755 shfmt "$pkgdir"/usr/bin/shfmt
	install -Dm644 shfmt.1.gz "$pkgdir"/usr/share/man/man1/shfmt.1.gz
}

sha512sums="
f3640275577b3c7ab2130efe54435fd4ae6f1c8e59d516d09575f3692f4489572600f4a0671914bcc14d2f66f9849f312b586d4ec97618ca2c5bfec9ab278ee1  shfmt-3.3.1.tar.gz
"