archrelease: copy trunk to community-any
[ArchLinux/community.git] / git-sizer / trunk / PKGBUILD
blob6a9aef5155fa3ac3669fd9a1fc240c7e590063fc
1 # Maintainer: Caleb Maclennan <caleb@alerque.com>
2 # Contributor: AUR[ogarcia]
4 pkgname=git-sizer
5 pkgver=1.5.0
6 pkgrel=2
7 pkgdesc='Compute various size metrics for a Git repository'
8 arch=(x86_64 i686 armv6h armv7h aarch64)
9 url="https://github.com/github/$pkgname"
10 license=(MIT)
11 depends=(git)
12 makedepends=(go)
13 _archive="$pkgname-$pkgver"
14 source=("$_archive.tar.gz::$url/archive/v$pkgver.tar.gz")
15 sha256sums=('07a5ac5f30401a17d164a6be8d52d3d474ee9c3fb7f60fd83a617af9f7e902bb')
17 build() {
18         cd "$_archive"
19         export CGO_CPPFLAGS="$CPPFLAGS"
20         export CGO_CFLAGS="$CFLAGS"
21         export CGO_CXXFLAGS="$CXXFLAGS"
22         export CGO_LDFLAGS="$LDFLAGS"
23         go build \
24                 -trimpath \
25                 -buildmode=pie \
26                 -mod=readonly \
27                 -modcacherw \
28                 -ldflags="-X main.BuildVersion=$pkgver -linkmode external" \
29                 -o . ./...
32 # Note: Upstream tests seem to do goofy things like assume a terminal, if
33 # anybody knows how to run these so they work in a chroot build properly I'm
34 # open to contributions.
35 check() {
36         cd "$_archive"
37         # go test ./...
40 package() {
41         cd "$_archive"
42         install -Dm0755 -t "$pkgdir/usr/bin/" git-sizer
43         install -Dm0644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
44         install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE.md