summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b867f42ecabdabd5606a4d5e5b9fea81e9b2f249 (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Maintainer: DingYuan <justforlxz@gmail.com>

pkgname=golang-github-linuxdeepin-go-dbus-factory-git
pkgver=2.0.2.r1.gbda82fd
pkgrel=1
pkgdesc='GO DBus factory for DDE'
arch=('any')
url="https://github.com/linuxdeepin/go-dbus-factory"
license=('GPL3')
depends=('golang-deepin-lib-git')
makedepends=('git' 'go' 'golang-gopkg-yaml.v3' 'golang-github-stretchr-testify')
provides=('golang-github-linuxdeepin-go-dbus-factory')
conflicts=('golang-github-linuxdeepin-go-dbus-factory')
groups=('deepin-git')
source=("$pkgname::git+https://github.com/linuxdeepin/go-dbus-factory")
sha512sums=('SKIP')

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

prepare() {
  cd $pkgname
  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-dbus-factory
  go get -v github.com/fsnotify/fsnotify
  go get -v github.com/godbus/dbus
  go get -v github.com/godbus/dbus/introspect
  go get -v github.com/godbus/dbus/prop
}

build() {
  export CGO_CPPFLAGS="${CPPFLAGS}"
  export CGO_CFLAGS="${CFLAGS}"
  export CGO_CXXFLAGS="${CXXFLAGS}"
  export CGO_LDFLAGS="${LDFLAGS}"
  export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
  export GOPATH="$srcdir/build:/usr/share/gocode"
  export GO111MODULE=off

  cd "$srcdir"/build/src/github.com/linuxdeepin/go-dbus-factory
  make bin

  # Suggested by upstream: don't run
  # ./gen.sh
}

check() {
  export GOPATH="$srcdir/build:/usr/share/gocode"
  export GO111MODULE=off
  cd "$srcdir"/build/src/github.com/linuxdeepin/go-dbus-factory
  go test -v $(go list ./...)
}

package() {
  cd "$srcdir"/build/src/github.com/linuxdeepin/go-dbus-factory
  install -dm755 "$pkgdir"/usr/share/gocode/src/github.com/linuxdeepin/go-dbus-factory
  cp -a com.* org.* object_manager session system "$pkgdir"/usr/share/gocode/src/github.com/linuxdeepin/go-dbus-factory/
}