archrelease: copy trunk to community-any
[arch-community.git] / peco / trunk / PKGBUILD
blobdd6dbe7e14846c60e9b00c323fa63cd9ce48951a
1 # Maintainer: George Rawlinson <grawlinson@archlinux.org>
2 # Contributor: Morteza NourelahiAlamdari <m@0t1.me>
3 # Contributor: Samuel Walladge <aur at swalladge dot net>
5 pkgname=peco
6 pkgver=0.5.11
7 pkgrel=1
8 pkgdesc='Simplistic interactive filtering tool'
9 arch=('x86_64')
10 url='https://github.com/peco/peco'
11 license=('MIT')
12 depends=('glibc')
13 makedepends=('git' 'go')
14 options=('!lto')
15 _commit='46703dc3aa48838f1f3c3d7d7c96a452914fb456'
16 source=("$pkgname::git+$url#commit=$_commit")
17 b2sums=('SKIP')
19 pkgver() {
20   cd "$pkgname"
22   git describe --tags | sed 's/^v//'
25 prepare() {
26   cd "$pkgname"
28   # create directory for build output
29   mkdir build
31   # download dependencies
32   export GOPATH="${srcdir}"
33   go mod download
35 build() {
36   cd "$pkgname"
38   # set Go flags
39   export CGO_CPPFLAGS="${CPPFLAGS}"
40   export CGO_CFLAGS="${CFLAGS}"
41   export CGO_CXXFLAGS="${CXXFLAGS}"
42   export GOPATH="${srcdir}"
44   go build -v \
45     -buildmode=pie \
46     -mod=readonly \
47     -modcacherw \
48     -ldflags "-compressdwarf=false \
49     -linkmode external \
50     -extldflags ${LDFLAGS}" \
51     -o build \
52     ./cmd/...
56 package() {
57   cd "$pkgname"
59   # binary
60   install -vDm755 -t "$pkgdir/usr/bin" "build/$pkgname"
62   # license
63   install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
65   # documentation
66   install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md
69 # vim:set ts=2 sw=2 et: