summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 57764acf866fbdac34e9294c2cc596a863ed8ec3 (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
# Maintainer: Pieter Joost van de Sande <pj@born2code.net>
pkgname=colorgo-git
_pkgname=colorgo
pkgver=20161027.1e1a5b5
pkgrel=1
pkgdesc='Colorize (highlight) `go build` command output'
url='https://github.com/songgao/colorgo'
arch=('i686' 'x86_64' 'armv7h')
makedepends=('git' 'go')
source=('git://github.com/songgao/colorgo.git')
sha256sums=('SKIP')

provides=("${_pkgname}")
conflicts=("${_pkgname}")

pkgver() {
	cd "${srcdir}/${_pkgname}"
	git log -1 --format='%cd.%h' --date=short | tr -d -
}

build() {
  cd "${srcdir}/${_pkgname}"
  export CGO_CPPFLAGS="${CPPFLAGS}"
  export CGO_CFLAGS="${CFLAGS}"
  export CGO_CXXFLAGS="${CXXFLAGS}"
  export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
  GO111MODULE=off go get github.com/songgao/go.pipeline
  GO111MODULE=off go build -o ${_pkgname} -ldflags "-extldflags ${LDFLAGS} -s -w -X main.version=${pkgver}"
}

package() {
  install -Dm755 "${srcdir}/${_pkgname}/${_pkgname}" ${pkgdir}/usr/bin/${_pkgname}
}

# vim: ft=sh ts=2 sw=2 et