summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 50029cba8340d6d62c79c5f8c8681b96e78a1f33 (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
43
# Maintainer: justforlxz <justforlxz@gmail.com>

pkgname=golang-github-linuxdeepin-go-x11-client-git
pkgver=0.6.9.r16.g811d87e
pkgrel=1
pkgdesc='X11 protocol go language binding'
arch=('any')
url="https://github.com/linuxdeepin/go-x11-client"
license=('GPL')
conflicts=('golang-github-linuxdeepin-go-x11-client')
provides=('golang-github-linuxdeepin-go-x11-client')
groups=('deepin-git')
depends=('golang-golang-x-text')
makedepends=('git' 'go' 'xorg-server-xvfb' 'golang-github-stretchr-testify' 'golang-gopkg-check.v1' 'golang-gopkg-yaml.v3')
checkdepends=('xorg-server-xvfb' 'golang-github-stretchr-testify' 'golang-gopkg-check.v1' 'golang-gopkg-yaml.v3' 'git')
source=("$pkgname::git+https://github.com/linuxdeepin/go-x11-client")
sha512sums=('SKIP')

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

prepare() {
  cd $pkgname
  rm -rf tools
}

check() {
  export GOPATH="$srcdir/build:/usr/share/gocode"
  export GO111MODULE=off
  mkdir -p "$srcdir"/build/src/github.com/linuxdeepin
  cp -a "$srcdir/$pkgname" "$srcdir"/build/src/github.com/linuxdeepin/go-x11-client
  cd "$srcdir"/build/src/github.com/linuxdeepin/go-x11-client
  xvfb-run go test -v $(go list ./...)
}

package() {
  mkdir -p "$pkgdir"/usr/share/gocode/src/github.com/linuxdeepin
  cp -a "$srcdir/$pkgname" "$pkgdir"/usr/share/gocode/src/github.com/linuxdeepin/go-x11-client

  rm -r "$pkgdir"/usr/share/gocode/src/github.com/linuxdeepin/go-x11-client/debian
}