gofumpt-git/PKGBUILD
Knut Ahlers be2ae5e418
Initial version
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2020-08-08 20:06:25 +02:00

34 lines
843 B
Bash

# Maintainer: Knut Ahlers <knut at ahlers dot me>
pkgname=gofumpt-git
pkgver=r111.ab5a819
pkgrel=1
pkgdesc="A stricter gofmt"
arch=('i686' 'x86_64')
url="https://github.com/mvdan/gofumpt"
license=('custom')
makedepends=('go')
source=("${pkgname}::git+${url}.git")
sha512sums=('SKIP')
build() {
cd "${srcdir}/${pkgname}"
GO111MODULE=on go build -mod=readonly
cd "${srcdir}/${pkgname}/gofumports"
GO111MODULE=on go build -mod=readonly
}
package() {
cd ${pkgname}
install -Dm755 -t "${pkgdir}/usr/bin" gofumpt gofumports/gofumports
install -Dm644 -t "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE LICENSE.google
}
pkgver() {
cd "${srcdir}/${pkgname}"
(
set -o pipefail
git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
)
}