diff options
author | ml | 2020-03-16 08:56:47 +0100 |
---|---|---|
committer | ml | 2020-03-16 08:56:47 +0100 |
commit | 2df57bcb4e1607441fb581303bb653ff93c78935 (patch) | |
tree | e3b0424094a0a28649fe33af6ab7e09981cef911 /PKGBUILD | |
parent | 1a6a8fa6dad03927c7af473db00656bdb32a9590 (diff) | |
download | aur-2df57bcb4e1607441fb581303bb653ff93c78935.tar.gz |
upgpkg: golangci-lint 1.24.0-1
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 46 |
1 files changed, 27 insertions, 19 deletions
@@ -1,32 +1,40 @@ # Maintainer: Matthias Lisin <ml@visu.li> pkgname=golangci-lint pkgdesc="Linters Runner for Go. 5x faster than gometalinter." -pkgver=1.23.8 -_commit=76a82c6 # short commit hash of release +pkgver=1.24.0 pkgrel=1 arch=('x86_64' 'i686' 'aarch64' 'armv7h' 'armv6h') url='https://github.com/golangci/golangci-lint' license=('GPL3') -makedepends=('git' 'go') -source=("$pkgname-$pkgver.tar.gz::https://github.com/golangci/golangci-lint/archive/v${pkgver}.tar.gz") -sha512sums=('fc393b2b6f5142cd260db9f3a1b7b11487d11d828ae69ad5e3130e2b2283e715f8d3d1fb2309da91eee7b03bd534c3a7479d5fe437dd338b3d211bfa93e92b3d') +depends=('glibc') +makedepends=('git' 'go' 'gzip') +source=("${pkgname}-${pkgver}.tar.gz::https://github.com/golangci/golangci-lint/archive/v${pkgver}.tar.gz") +sha256sums=('d1f1441a966f090bf3f49e1737668a0b4c7eae5916d2bcaee48cca045e881f27') build() { - cd "${pkgname}-${pkgver}" - # ISO-8601, like the official binary - _date=$(date -u -Iseconds -d "@${SOURCE_DATE_EPOCH}" | sed 's/+00:00/Z/') - go build -trimpath \ - -ldflags "-X 'main.version=${pkgver}' \ - -X 'main.commit=${_commit}' \ - -X 'main.date=${_date}' \ - -extldflags=${LDFLAGS}" \ - -buildmode=pie -o "$pkgname" ./cmd/"$pkgname" + export CGO_LDFLAGS="$LDFLAGS" + export GOFLAGS='-buildmode=pie -trimpath -modcacherw' + _commit=$(zcat "${pkgname}-${pkgver}.tar.gz" | git get-tar-commit-id) + _flags=( + -X=main.version=$pkgver + -X=main.commit=${_commit::7} + -X=main.date=$(date -u -d "@${SOURCE_DATE_EPOCH}" +'%FT%TZ') + ) + cd "${pkgname}-${pkgver}" + go build -o "$pkgname" -ldflags="${_flags[*]}" ./cmd/"$pkgname" +} + +check() { + cd "${pkgname}-${pkgver}" + # some tests build the binary and overwrite our build + chmod 555 "$pkgname" # canary + GOLANGCI_LINT_INSTALLED=true go test ./... } package() { - cd "${pkgname}-${pkgver}" - install -dm755 "$pkgdir"/usr/share/{bash-completion/completions,zsh/site-functions} - install -Dm755 "$pkgname" "$pkgdir"/usr/bin/"$pkgname" - "$pkgdir"/usr/bin/"$pkgname" completion bash > "$pkgdir"/usr/share/bash-completion/completions/golangci-lint - "$pkgdir"/usr/bin/"$pkgname" completion zsh > "$pkgdir"/usr/share/zsh/site-functions/_golangci-lint + cd "${pkgname}-${pkgver}" + install -dm755 "$pkgdir"/usr/share/{bash-completion/completions,zsh/site-functions} + install -Dm755 "$pkgname" "$pkgdir"/usr/bin/"$pkgname" + ./"$pkgname" completion bash >"$pkgdir"/usr/share/bash-completion/completions/golangci-lint + ./"$pkgname" completion zsh >"$pkgdir"/usr/share/zsh/site-functions/_golangci-lint } |