# Tanım: Dde-daemon için go-lang bağları
# URL: https://github.com/linuxdeepin/dde-api
# Paketçi: Cihan_Alkan
# Gerekler: gobject-introspection xorg-libdrm xorg-libxext xorg-libxdamage xorg-libxcomposite gdk-pixbuf pango xorg-libxrandr
# Grup: masaüstü

isim=deepin-api
surum=3.12.0
devir=1
kaynak=(https://github.com/linuxdeepin/dde-api/archive/$surum.tar.gz::$isim-$surum.tar.gz
        deepin-api.sysusers)

derle() {
 export GOPATH="$SRC/build:/usr/share/gocode"
  mkdir -p build/src/pkg.deepin.io/dde/api
  cp -a dde-api-$surum/* build/src/pkg.deepin.io/dde/api/

  # https://github.com/niemeyer/gopkg/issues/50
  git config --global http.https://gopkg.in.followRedirects true

  cd "$SRC"/dde-api-$surum
  make build-dep
  go get -insecure gopkg.in/alecthomas/kingpin.v2 github.com/nfnt/resize github.com/cryptix/wav \
         golang.org/x/net/context github.com/fogleman/gg
  make

 # make DESTDIR="$pkgdir" SYSTEMD_LIB_DIR=/usr/lib install
  make DESTDIR="${PKG}" install
  install -Dm644 ../deepin-api.sysusers "$PKG"/usr/lib/sysusers.d/deepin-api.conf
}