summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/upower/upower_1.91.2.bb
blob: d6505974e9cd1350896426a7e1389458a90d9f39 (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
SUMMARY = "UPower is an abstraction for enumerating power devices"
DESCRIPTION = "UPower is an abstraction for enumerating power devices, listening to device events and querying history and statistics."
HOMEPAGE = "https://upower.freedesktop.org/"
LICENSE = "GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=0de8fbf1d97a140d1d93b9f14dcfbf08"

DEPENDS = " \
    intltool-native \
    libusb1 \
    libgudev \
    glib-2.0 \
    dbus-glib \
"

SRC_URI = "https://gitlab.freedesktop.org/${BPN}/${BPN}/-/archive/v${PV}/${BPN}-v${PV}.tar.bz2"
SRC_URI[sha256sum] = "f07f19b78a43a5053973d95a2fe96a12ede270b8db232b2e2c4ac4186fb42539"
S = "${UNPACKDIR}/${BPN}-v${PV}"

UPSTREAM_CHECK_URI = "https://gitlab.freedesktop.org/${BPN}/${BPN}/-/tags"
UPSTREAM_CHECK_REGEX = "v(?P<pver>\d+(\.\d+)+)"

GIR_MESON_ENABLE_FLAG = "enabled"
GIR_MESON_DISABLE_FLAG = "disabled"
GTKDOC_MESON_OPTION = "gtk-doc"

inherit meson pkgconfig gtk-doc gettext gobject-introspection systemd

PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd polkit', d)}"
PACKAGECONFIG[idevice] = "-Didevice=enabled,-Didevice=disabled,libimobiledevice libplist"
PACKAGECONFIG[systemd] = "-Dsystemdsystemunitdir=${systemd_system_unitdir},-Dsystemdsystemunitdir=no -Dudevrulesdir=${base_libdir}/udev/rules.d,systemd"
PACKAGECONFIG[polkit] = "-Dpolkit=enabled,-Dpolkit=disabled,polkit"

EXTRA_OEMESON = " \
    -Dos_backend=linux \
    -Dman=false \
"

SYSTEMD_SERVICE:${PN} = "upower.service"
# don't start on boot by default - dbus does that on demand
SYSTEMD_AUTO_ENABLE = "disable"

RDEPENDS:${PN} += "${VIRTUAL-RUNTIME_dbus}"
RRECOMMENDS:${PN} += "pm-utils"
PACKAGES += "${PN}-zsh-completion"
FILES:${PN} += " \
    ${datadir}/dbus-1/ \
    ${datadir}/polkit-1/ \
    ${base_libdir}/udev/* \
"
FILES:${PN}-zsh-completion = "${datadir}/zsh"

do_install:append() {
    # remove integration tests scripts
    rm -rf ${D}${datadir}/installed-tests
    rm -rf ${D}${libexecdir}/upower
}