# Tanım: Deepin masaüstü ortamı - Oturum UI modülü
# URL: https://github.com/linuxdeepin/dde-session-ui
# Paketçi: Cihan_Alkan
# Gerekler: deepin-desktop-schemas gvfs libcanberra poppler-glib rfkill bluez deepin-notifications iso-codes lsb-release mobile-broadband-provider-info deepin-polkit-agent udisks2 upower xorg-libxkbfile accountsservice deepin-desktop-base bamf pulseaudio gnome-keyring noto-fonts deepin-dbus-factory deepin-gir-generator deepin-go-lib deepin-api sqlite deepin-gettext-tools mercurial python-gobject networkmanager go18
# Grup: deepin

isim=deepin-daemon
surum=3.14.0
devir=1
kaynak=(https://github.com/linuxdeepin/dde-daemon/archive/$surum.tar.gz::$isim-$surum.tar.gz
        https://raw.githubusercontent.com/jouyouyun/tap-gesture-patches/master/patches/dde-daemon_3.8.0.patch
        deepin-daemon.sysusers)

derle() {
cd dde-daemon-$surum
  patch -p1 -i ../dde-daemon_3.8.0.patch
  export GOPATH="$SRC/build:/usr/share/gocode"


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

  go get -insecure github.com/BurntSushi/xgb github.com/BurntSushi/xgbutil github.com/linuxdeepin/go-x11-client \
         github.com/mattn/go-sqlite3 gopkg.in/alecthomas/kingpin.v2 github.com/disintegration/imaging \
         github.com/BurntSushi/freetype-go/freetype github.com/BurntSushi/freetype-go/freetype/truetype \
         github.com/BurntSushi/graphics-go/graphics github.com/fsnotify/fsnotify golang.org/x/sys/unix \
         gopkg.in/yaml.v2 github.com/axgle/mahonia github.com/msteinert/pam github.com/nfnt/resize \
         golang.org/x/text/encoding/charmap github.com/cryptix/wav golang.org/x/net/context

  sed -i 's#/usr/share/backgrounds/default_background.jpg#/usr/share/backgrounds/deepin/desktop.jpg#' accounts/user.go


  make -C network/nm_generator gen-nm-code
  make # USE_GCCGO=1

  make DESTDIR="$PKG" install # USE_GCCGO=1

  install -Dm644 ../deepin-daemon.sysusers "$PKG/usr/lib/sysusers.d/deepin-daemon.conf"
}
