summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d9091a3b9d184d0eeb9d996d743b01747af9d79c (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
36
37
38
39
40
41
42
# This file was generated by GoReleaser. DO NOT EDIT.
# Maintainer: Fernandez Ludovic <lfernandez dot dev at gmail dot com>

pkgname='golangci-lint'
pkgver=2.1.6
pkgrel=1
pkgdesc='Fast linters runner for Go.'
url='https://golangci.com'
arch=('aarch64' 'x86_64')
license=('GPL-3.0')
provides=('golangci-lint')
conflicts=('golangci-lint')
makedepends=('go' 'git')
source=("${pkgname}_${pkgver}.tar.gz::https://github.com/golangci/golangci-lint/releases/download/v2.1.6/golangci-lint-2.1.6-source.tar.gz")
sha256sums=('9a103a775cb55153ca42ba2ffc4b296dec21fbb436c06cdaa82bcda09d47446d')
build() {
  local _commit _flags
  _commit=$(bsdcat "${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')"
  -linkmode=external
  )
  export CGO_ENABLED=1
  export CGO_CFLAGS="${CFLAGS}"
  export CGO_CPPFLAGS="$CPPFLAGS"
  export CGO_CXXFLAGS="$CXXFLAGS"
  export CGO_LDFLAGS="${LDFLAGS}"
  export GOFLAGS='-buildmode=pie -trimpath -modcacherw'

  go build -o "$pkgname" -ldflags="${_flags[*]}" ./cmd/"$pkgname"
  ./"$pkgname" completion bash > completion.bash
  ./"$pkgname" completion zsh > completion.zsh
  ./"$pkgname" completion fish > completion.fish
}
package() {
  install -Dm755 "$pkgname" -t "$pkgdir"/usr/bin
  install -Dm644 completion.bash "$pkgdir"/usr/share/bash-completion/completions/"$pkgname"
  install -Dm644 completion.zsh "$pkgdir"/usr/share/zsh/site-functions/_"$pkgname"
  install -Dm644 completion.fish "$pkgdir"/usr/share/fish/vendor_completions.d/"$pkgname".fish
}