summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a11d1f7e7caeb89d9d001ada6e30c15277bc69a8 (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
44
45
46
47
# Maintainer: justforlxz <justforlxz@gmail.com>

pkgname=golang-github-linuxdeepin-go-x11-client-git
pkgver=0.6.8.r2.g9476531
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.v2')
checkdepends=('xorg-server-xvfb' 'golang-github-stretchr-testify' 'golang-gopkg-check.v1' 'golang-gopkg-yaml.v2' '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
  if [[ ! -z ${sha} ]];then
    git checkout -b $sha
  fi
  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
  go get gopkg.in/yaml.v3
  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
}