summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: cc474c2c870f81bd967bf0e62457dfb6965b4c91 (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Maintainer: David Rheinsberg <david@readahead.eu>

pkgbase="dbus-broker-git"
pkgname=(
  "dbus-broker-git"
  "dbus-broker-units-git"
)

pkgdesc="Linux D-Bus Message Broker"
pkgver=35.0.gb71a541
pkgrel=1

arch=("x86_64")
license=("Apache-2.0")
url="https://github.com/bus1/dbus-broker/wiki"

depends=(
  'audit>=3.0'
  'expat>=2.2'
  'libcap-ng>=0.6'
  'linux>=4.17'
  'systemd-libs>=230'
)
makedepends=(
  'git'
  'meson>=0.60.0'
  'systemd'
  'python-docutils'
)

source=(
  "$pkgbase::git+https://github.com/bus1/dbus-broker"
  "c-dvar-1::git+https://github.com/c-util/c-dvar#branch=v1"
  "c-ini-1::git+https://github.com/c-util/c-ini#branch=v1"
  "c-list-3::git+https://github.com/c-util/c-list#branch=v3"
  "c-rbtree-3::git+https://github.com/c-util/c-rbtree#branch=v3"
  "c-shquote-1::git+https://github.com/c-util/c-shquote#branch=v1"
  "c-stdaux-1::git+https://github.com/c-util/c-stdaux#branch=v1"
  "c-utf8-1::git+https://github.com/c-util/c-utf8#branch=v1"
  "0001-units-Enable-statically.patch"
)

sha256sums=(
  'SKIP'
  'SKIP'
  'SKIP'
  'SKIP'
  'SKIP'
  'SKIP'
  'SKIP'
  'SKIP'
  'SKIP'
)

pkgver() {
  cd "$pkgbase"
  git describe --long --tags | sed 's/^v//;s/-/./g'
}

prepare() {
  cd "$pkgbase"

  local sp
  for sp in {dvar-1,ini-1,list-3,rbtree-3,shquote-1,stdaux-1,utf8-1}; do
    ln -fs "$(realpath --relative-to "subprojects" "$srcdir/c-$sp")" "subprojects/libc$sp"
  done

  patch -Np1 -i "../0001-units-Enable-statically.patch"
}

build() {
  local meson_options=(
    -D audit=true
    -D docs=true
    -D linux-4-17=true
    -D system-console-users=gdm,sddm,lightdm,lxdm
  )

  arch-meson "$pkgbase" build "${meson_options[@]}"
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

_pick() {
  local p="$1" f d; shift
  for f; do
    d="$srcdir/$p/${f#$pkgdir/}"
    mkdir -p "$(dirname "$d")"
    mv "$f" "$d"
    rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
  done
}

package_dbus-broker-git() {
  depends+=(
    "libaudit.so"
    "libcap-ng.so"
    "libexpat.so"
    "libsystemd.so"
  )
  provides=("dbus-broker")
  conflicts=("dbus-broker")

  meson install -C build --destdir "$pkgdir"

  _pick unit "$pkgdir"/usr/lib/systemd/{system,user}/dbus.service
}

package_dbus-broker-units-git() {
  pkgdesc+=" - Service units"
  depends=("dbus-broker")
  provides=(
    "dbus-broker-units"
    "dbus-units"
  )
  conflicts=(
    "dbus-broker-units"
    "dbus-daemon-units"
  )

  mv unit/* "$pkgdir"
}

# vim:set sw=2 sts=-1 et: