upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / shfmt / trunk / PKGBUILD
blob33db3270a6e4794f81a8d5dc6842056d14050331
1 # Maintainer: Christian Rebischke <chris.rebischke@archlinux.org>
2 # Maintainer: Maxim Baz <$pkgname at maximbaz dot com>
3 # Contributor: Daniel Martí <mvdan@mvdan.cc>
5 pkgname=shfmt
6 pkgver=3.6.0
7 pkgrel=1
8 pkgdesc="Format shell programs"
9 url="https://github.com/mvdan/sh"
10 license=('BSD')
11 arch=('x86_64')
12 depends=('glibc')
13 makedepends=('git' 'go' 'scdoc')
14 options=('!lto')
15 source=("${pkgname}-${pkgver}.tar.gz::https://github.com/mvdan/sh/archive/v${pkgver}.tar.gz")
16 b2sums=('a4b9e711eb1d8889e317775fcbab95a273c0bef9ff46ce043c1db39b4b21ca944272b595f60d190bf169ce4924f6c37c9aa1945155e62f9f27c7af2ff9008e3f')
18 build() {
19     cd "${srcdir}/sh-${pkgver}/cmd/shfmt/"
21     export CGO_CPPFLAGS="${CPPFLAGS}"
22     export CGO_CFLAGS="${CFLAGS}"
23     export CGO_CXXFLAGS="${CXXFLAGS}"
24     export CGO_LDFLAGS="${LDFLAGS}"
25     export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
26     go build -ldflags "-linkmode=external -extldflags=$LDFLAGS -X main.version=${pkgver}"
28     scdoc < "${pkgname}.1.scd" | gzip > "${pkgname}.1.gz"
31 check() {
32     cd "${srcdir}/sh-${pkgver}/"
33     go test ./...
36 package() {
37     cd "${srcdir}/sh-${pkgver}/"
38     install -Dm755 -t "${pkgdir}/usr/bin/" "cmd/${pkgname}/${pkgname}"
39     install -Dm644 -t "${pkgdir}/usr/share/man/man1/" "cmd/${pkgname}/${pkgname}.1.gz"
40     install -Dm644 -t "${pkgdir}/usr/share/licenses/${pkgname}/" LICENSE