summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 80b49f0126de04afe7bed8a9d462149cae56b346 (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Maintainer: justforlxz <justforlxz@gmail.com>

pkgname=deepin-daemon-git
pkgver=6.0.0.r102.gbbec686c
pkgrel=1
pkgdesc='Daemon handling the DDE session settings'
arch=('x86_64' 'aarch64')
url="https://github.com/linuxdeepin/dde-daemon"
license=('GPL3')
depends=('deepin-desktop-schemas-git' 'ddcutil' 'deepin-api-git' 'gvfs' 'iso-codes' 'lsb-release'
         'mobile-broadband-provider-info' 'deepin-polkit-agent-git'
         'deepin-polkit-agent-ext-gnomekeyring-git' 'udisks2' 'upower'
         'libxkbfile' 'accountsservice' 'deepin-desktop-base-git' 'bamf' 'pulseaudio'
         'org.freedesktop.secrets' 'noto-fonts' 'imwheel')
makedepends=('golang-github-linuxdeepin-go-dbus-factory-git' 'golang-deepin-gir-git' 'golang-deepin-lib-git'
             'deepin-api-git' 'golang-github-nfnt-resize' 'golang-gopkg-yaml.v2' 'sqlite' 'deepin-gettext-tools-git'
             'git' 'mercurial' 'python-gobject' 'networkmanager' 'bluez' 'go')
optdepends=('networkmanager: for network management support'
            'bluez: for bluetooth support'
            'iw: for miracast module'
            'proxychains-ng: for proxy configuration module')
conflicts=('deepin-daemon')
provides=('deepin-daemon')
groups=('deepin-git')
install="$pkgname.install"
source=("$pkgname::git+https://github.com/linuxdeepin/dde-daemon"
        dde-daemon.patch
        remove-tc.patch
        'deepin-daemon.sysusers')
sha512sums=('SKIP'
            'SKIP'
            'SKIP'
            '808c02d4fec4cbbb01119bbb10499090199e738b7dd72c28a57dde098eef6132723f3434c151f79e21d9f788c7f7bae8046573ac93ba917afe0e803fbffa6d5a')

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

  patch -p1 -i ../remove-tc.patch
  patch -p1 -i ../dde-daemon.patch
  rm -rf system/uadp
  rm -rf session/uadpagent

  export GOPATH="$srcdir/build:/usr/share/gocode"
  export GO111MODULE=off
  # golang-deepin-lib's dependency, remove when go packaging resumes
  go get -v github.com/cryptix/wav

  go get -v github.com/axgle/mahonia github.com/msteinert/pam github.com/gosexy/gettext github.com/rickb777/date \
         github.com/jinzhu/gorm github.com/kelvins/sunrisesunset github.com/mozillazg/go-pinyin github.com/teambition/rrule-go \
         golang.org/x/xerrors github.com/mattn/go-sqlite3 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
  go get -v github.com/Lofanmi/pinyin-golang/pinyin
  go get -v gopkg.in/yaml.v3
  go get -v github.com/youpy/go-wav
  sed -i 's#/usr/share/backgrounds/default_background.jpg#/usr/share/backgrounds/deepin/desktop.jpg#' accounts/user.go
}

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"

  cd $pkgname
#  make -C network/nm_generator gen-nm-code
  make
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" PAM_MODULE_DIR=usr/lib/security install

  mv "$pkgdir"{,/usr}/lib/systemd
  mv "$pkgdir"{,/usr}/lib/udev
  rmdir "$pkgdir"/lib

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