summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 763863a1c216c50f17eac9ea7cf8883e1a7ead61 (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
# Maintainer: Sematre <sematre at gmx dot de>
pkgname=piknik-git
pkgver=0.9.1.r61.g00ee34c
pkgrel=4
pkgdesc="Copy/paste anything over the network."
arch=('any')
url="https://github.com/jedisct1/${pkgname%-git}"
license=('ISC')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
makedepends=('go' 'git')
source=("git+${url}")
md5sums=('SKIP')

pkgver() {
  cd "${pkgname%-git}"
  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd "${pkgname%-git}"
  export CGO_CPPFLAGS="${CPPFLAGS}"
  export CGO_CFLAGS="${CFLAGS}"
  export CGO_CXXFLAGS="${CXXFLAGS}"
  export CGO_LDFLAGS="${LDFLAGS}"
  export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
  go build
}

package() {
  cd "${pkgname%-git}"
  install -Dm 755 "${pkgname%-git}" -t "$pkgdir/usr/bin"
  install -Dm 644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname%-git}/LICENSE"
}