Skip to content

Commit b1482fb

Browse files
author
vins
committed
sysutils/upower: update to 1.90.9
Catch up on the last 3 years of updates. Packages tested against new version: wmbattery, lxqt-powermanagement # pkgsrc changes * Switch to build with meson. * Requires pkgsrc gettext-tools. * Optionally enable polkit support. TODO: fix and test Linux backend after importing wip/libgudev # upstream changes (since 0.99.13) ## 1.90.9 * Fix unstable OnBattery status (#306 #307) ## 1.90.8 * Fix the incorrect percentage value of a removed battery. (#292) (!246) * Fix device type for the gaming device. (#296 #295) (!247) * Determine the battery discharging status when connecting a low-power charger. (#276) (!244) * Fix memory leak when refreshing battery info. (#305) (!261) * Fix memory leak when getting device id. (!261) ## 1.90.7 * Find the correct parent id for input devices. (#268 #286) * Fix race condition in test_sibling_priority_no_overwrite. (!240) * Show charge-threshold-* status as yes/no. (!242) * Add zsh-completions for CLI. (!241) * Fix integration test. Extend the daemon stopping timeout to 10sec (#290) * Added pre-commit test and fixed code spelling, markdown, and code style issues. (!248) ## 1.90.6 * Fractional battery percentage (!226) * CI enhancement. (!236) * Tweak the default battery charging threshold to 75-80. (!234) * Fix g_object_weak_ref: assertion 'g_atomic_int_get (&object->ref_count) >= 1' failed (#281, !233) ## 1.90.5 * Suspend and Ignore as the CriticalPowerActions (!218 and !218) * Support for battery charging threshold (!208) * Tweak the device priority to make sure the device kind joystick can be correctly shown. (#267) ## 1.90.4 * Update the information for version 1.90.3. * Resolved high disk and CPU rate. (#256) * Stop guessing the unknown battery as a power supply. * Continue to support lid handling. * Fix org.freedesktop.UPower: EnergyRate is a positive value. (#252) * Fix uni-test python script. (!205) ## 1.90.3 * Resolved high disk and CPU rate. * Update glib2 requirement to 2.66.0. * Stop guessing the unknown battery as a power supply. * Continue to support lid handling. * Document fixes and bug fixes. ## 1.90.2 Note that this is the last release of UPower with lid handling. OS components that rely on the lid status should get it from logind instead. See: https://www.freedesktop.org/software/systemd/man/org.freedesktop.login1.html * Fix wireless devices not disappearing from Settings when disconnected * Require a newer libgudev to avoid bugs related to newline stripping when reading sysfs attributes * Add installed-tests files for use with gnome-desktop-testing * Fix integration test to work with system installed upower binary and under jhbuild ## 1.90.1 * Detect headsets with kernel batteries such as Logitech and Steelseries headsets, and make them automatically disappear if the headset is turned off (if the kernel driver supports the wireless_status attribute) * Hide duplicate Logitech Bluetooth devices (Bolt-compatible devices connected through Bluetooth would show as 2 batteries) * Hide duplicate Logitech wireless devices when they get connected through USB as well * Fix Bluetooth device names not synchronising, and use user-chosen names when available * Handle the "present" sysfs attribute changing * Fix iDevices not appearing * Fix reading capacity_level with newer libgudev * Fix OpenBSD backend ## 1.90.0 Note that the version number bump was made to allow bugfixes for older releases while also making new releases that contain with more in-depth code changes. The old (soft) API/ABI guarantees are currently unchanged. Changes: * Refactor internal battery handling into separate classes * Guess charging/discharging state based on energy rate (#196) Bug fixes: * Fix polling after resume (#198) * Fix battery state guessing (NetBSD#146) * Reload history when battery ID changes * Test fixes ## 0.99.20 Bug fixes: * Ensure polling is resumed after suspend (#198) * Bugfixes to state guessing code (NetBSD#146) * Stability improvements of automated tests ## 0.99.19 Changes: * Move state guessing into DisplayDevice * Always use 90% threshold to consider a battery full * Various test improvements Bug fixes: * Fix mice showing up as keyboards (#189) * Allow unit test inspector to fail (#187) * Fix test cases when daemon shuts down too slowly (#188) ## 0.99.18 Changes: * Remove broken wakeup DBus API * Tag UPS hid devices using hwdb and update list from upstream * Only permit Refresh method when in debug mode * Refactor device polling * Refactor udev device discovery and sibling detection * Improved testing and CI * Handle SIGTERM to trigger a clean shutdown Bug fixes: * Improve polling of batteries after line-power "online" status change * Multiple wacom tablet detection fixes * Fix updates after a BT hid power supply moves in sysfs * Fix enumeration of "Whats Up!" devices on startup * Accept USB power supplies without warning * Allow building without gtk-doc ## 0.99.17 Bug fixes: * Fix FD handling issues that may cause lid to not be detected ## 0.99.16 Bug fixes: * Silence unnecessary udev event warnings * Increase test timeout (NetBSD#171) * Explicitly link with plist * Fix UpClient reference leak * Fix DisplayDevice state on battery hotplug * Fix critical action to work after it was cancelled (NetBSD#172) ## 0.99.15 Bug fixes: * Various build fixes * Update bluetooth device alias when it changes (NetBSD#169) ## 0.99.14 Changes: * Port build system to meson * New ChargeCycles D-Bus property (NetBSD#152) * New async GLib APIs (NetBSD#121) * lid related functions are now deprecated * Refresh API is now deprecated Bug fixes: * Plenty of test suite fixes * Fix leak of inhibitor lock (NetBSD#160) * Recognize USB power supplies (NetBSD#148) * Fix time compression of data points (NetBSD#167) * Fix disk write amplification when battery is low (NetBSD#150)
1 parent e835464 commit b1482fb

8 files changed

Lines changed: 143 additions & 36 deletions

File tree

sysutils/upower/Makefile

Lines changed: 43 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,77 @@
1-
# $NetBSD: Makefile,v 1.24 2023/07/22 08:39:26 nia Exp $
1+
# $NetBSD: Makefile,v 1.25 2025/05/04 05:55:49 vins Exp $
22

3-
DISTNAME= upower-0.99.13
4-
PKGREVISION= 1
3+
DISTNAME= upower-v1.90.9
4+
PKGNAME= ${DISTNAME:S/v//}
55
CATEGORIES= sysutils
6-
MASTER_SITES= https://gitlab.freedesktop.org/upower/upower/uploads/177df5b9f9b76f25a2ad9da41aa0c1fa/
7-
EXTRACT_SUFX= .tar.xz
6+
MASTER_SITES= https://gitlab.freedesktop.org/upower/upower/-/archive/v${PKGVERSION_NOREV}/
7+
EXTRACT_SUFX= .tar.bz2
88

99
MAINTAINER= pkgsrc-users@NetBSD.org
1010
HOMEPAGE= https://upower.freedesktop.org/
1111
COMMENT= Power management system message bus service
1212
LICENSE= gnu-gpl-v2
1313

14-
USE_LIBTOOL= yes
15-
GNU_CONFIGURE= yes
16-
USE_TOOLS+= gmake pkg-config intltool xgettext msgmerge msgfmt
17-
BUILD_DEFS+= VARBASE PKG_SYSCONFBASE
14+
USE_CC_FEATURES= c11
15+
USE_TOOLS+= pkg-config intltool xgettext msgmerge msgfmt
1816

19-
TOOL_DEPENDS+= docbook-xsl-[0-9]*:../../textproc/docbook-xsl
17+
USE_PKGLOCALEDIR= yes
2018

21-
CONFIGURE_ARGS+= --localstatedir=${VARBASE}
22-
CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR}
23-
CONFIGURE_ARGS+= --with-libintl-prefix=${BUILDLINK_PREFIX.gettext}
24-
CONFIGURE_ARGS+= --enable-introspection
19+
BUILD_DEFS+= VARBASE PKG_SYSCONFBASE
2520

26-
# Real Linux backend requires gudev, which we lack in pkgsrc.
27-
CONFIGURE_ARGS.Linux+= --with-backend=dummy
21+
TOOL_DEPENDS+= docbook-xsl-[0-9]*:../../textproc/docbook-xsl
2822

2923
PKG_SYSCONFSUBDIR= UPower
30-
INSTALL_MAKE_FLAGS+= configdir=${EGDIR} dbusconfdir=${EGDIR}
3124
EGDIR= ${PREFIX}/share/examples/upower
3225
CONF_FILES+= ${EGDIR}/UPower.conf ${PKG_SYSCONFDIR}/UPower.conf
3326
CONF_FILES+= ${EGDIR}/org.freedesktop.UPower.conf \
3427
${PKG_SYSCONFBASE}/dbus-1/system.d/org.freedesktop.UPower.conf
3528

3629
PKGCONFIG_OVERRIDE+= upower-glib.pc.in
37-
USE_PKGLOCALEDIR= yes
30+
31+
.include "../../mk/bsd.prefs.mk"
32+
33+
# Free/OpenBSD and Linux are officially supported.
34+
# However, the Linux backend requires gudev, which we lack in pkgsrc.
35+
.if ${OPSYS} == "OpenBSD" || ${OPSYS} == "FreeBSD"
36+
MESON_ARGS+= -Dos_backend=${LOWER_OPSYS}
37+
.else
38+
MESON_ARGS+= -Dos_backend=dummy
39+
.endif
40+
41+
MESON_ARGS+= --sysconfdir=${PKG_SYSCONFBASEDIR} \
42+
--localedir=${PKGLOCALEDIR}/locale \
43+
-Dstatedir=${VARBASE} \
44+
-Dhistorydir=${VARBASE}/db/upower \
45+
-Degdir=${EGDIR} \
46+
-Dman=true \
47+
-Dgtk-doc=false \
48+
-Dudevrulesdir=disabled \
49+
-Dudevhwdbdir=disabled \
50+
-Dsystemdsystemunitdir=no \
51+
-Didevice=disabled
52+
53+
.include "options.mk"
3854

3955
BUILDLINK_TRANSFORM.Darwin+= rm:-Wl,--as-needed
4056
BUILDLINK_TRANSFORM.Darwin+= rm:-Wl,--no-as-needed
4157
BUILDLINK_TRANSFORM.SunOS+= opt:-Wl,--no-as-needed:-Wl,-zrecord
4258
BUILDLINK_TRANSFORM.SunOS+= opt:-Wl,--as-needed:-Wl,-zignore
4359

44-
TEST_TARGET= check
45-
4660
# with --nonet, xsltproc needs a helping hand finding some dtds
4761
XSLTPROC_PATH= ${PREFIX}/share/doc/dbus
4862

63+
# GNU msgfmt >=0.19.7 required to produce files of type: xml
64+
BUILDLINK_API_DEPENDS.gettext-tools+= gettext-tools>=0.19.7
65+
# Otherwise built-in msgfmt is used regardless of line above
66+
USE_BUILTIN.gettext= no
67+
.include "../../devel/gettext-tools/buildlink3.mk"
68+
4969
.include "../../devel/gettext-lib/buildlink3.mk"
70+
BUILDLINK_API_DEPENDS.glib2+= glib2>=2.66.0
5071
.include "../../devel/glib2/buildlink3.mk"
51-
BUILDLINK_DEPMETHOD.gobject-introspection+= build
52-
.include "../../devel/gobject-introspection/buildlink3.mk"
72+
.include "../../devel/zlib/buildlink3.mk"
5373
.include "../../sysutils/dbus/buildlink3.mk"
5474
.include "../../sysutils/dbus-glib/buildlink3.mk"
5575
.include "../../textproc/libxslt/xsltproc-nonet.mk"
76+
.include "../../devel/meson/build.mk"
5677
.include "../../mk/bsd.pkg.mk"

sysutils/upower/PLIST

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@comment $NetBSD: PLIST,v 1.6 2022/06/28 11:13:42 nia Exp $
1+
@comment $NetBSD: PLIST,v 1.7 2025/05/04 05:55:49 vins Exp $
22
bin/upower
33
include/libupower-glib/up-autocleanups.h
44
include/libupower-glib/up-client.h
@@ -7,25 +7,27 @@ include/libupower-glib/up-history-item.h
77
include/libupower-glib/up-stats-item.h
88
include/libupower-glib/up-types.h
99
include/libupower-glib/up-version.h
10-
include/libupower-glib/up-wakeup-item.h
11-
include/libupower-glib/up-wakeups.h
1210
include/libupower-glib/upower.h
13-
lib/girepository-1.0/UPowerGlib-1.0.typelib
14-
lib/libupower-glib.la
11+
${PLIST.introspection}lib/girepository-1.0/UPowerGlib-1.0.typelib
12+
lib/libupower-glib.so
13+
lib/libupower-glib.so.3
14+
lib/libupower-glib.so.3.1.0
1515
lib/pkgconfig/upower-glib.pc
1616
libexec/upowerd
1717
man/man1/upower.1
1818
man/man7/UPower.7
1919
man/man8/upowerd.8
2020
share/dbus-1/interfaces/org.freedesktop.UPower.Device.xml
2121
share/dbus-1/interfaces/org.freedesktop.UPower.KbdBacklight.xml
22-
share/dbus-1/interfaces/org.freedesktop.UPower.Wakeups.xml
2322
share/dbus-1/interfaces/org.freedesktop.UPower.xml
2423
share/dbus-1/system-services/org.freedesktop.UPower.service
2524
share/examples/upower/UPower.conf
2625
share/examples/upower/org.freedesktop.UPower.conf
27-
share/gir-1.0/UPowerGlib-1.0.gir
26+
${PLIST.introspection}share/gir-1.0/UPowerGlib-1.0.gir
2827
share/locale/fr/LC_MESSAGES/upower.mo
2928
share/locale/it/LC_MESSAGES/upower.mo
29+
share/locale/ka/LC_MESSAGES/upower.mo
3030
share/locale/pl/LC_MESSAGES/upower.mo
3131
share/locale/sv/LC_MESSAGES/upower.mo
32+
${PLIST.polkit}share/polkit-1/actions/org.freedesktop.upower.policy
33+
share/zsh/site-functions/_upower

sysutils/upower/buildlink3.mk

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
1-
# $NetBSD: buildlink3.mk,v 1.4 2021/12/08 16:02:40 adam Exp $
1+
# $NetBSD: buildlink3.mk,v 1.5 2025/05/04 05:55:49 vins Exp $
22

33
BUILDLINK_TREE+= upower
44

55
.if !defined(UPOWER_BUILDLINK3_MK)
66
UPOWER_BUILDLINK3_MK:=
77

8-
BUILDLINK_API_DEPENDS.upower+= upower>=0.99.8
9-
BUILDLINK_ABI_DEPENDS.upower?= upower>=0.99.13
8+
BUILDLINK_API_DEPENDS.upower+= upower>=1.90.9
9+
BUILDLINK_ABI_DEPENDS.upower?= upower>=1.90.9
1010
BUILDLINK_PKGSRCDIR.upower?= ../../sysutils/upower
1111

1212
.include "../../devel/glib2/buildlink3.mk"
13+
14+
pkgbase := upower
15+
.include "../../mk/pkg-build-options.mk"
16+
17+
.if ${PKG_BUILD_OPTIONS.upower:Mpolkit}
18+
. include "../../security/polkit/buildlink3.mk"
19+
.endif
20+
1321
.endif # UPOWER_BUILDLINK3_MK
1422

1523
BUILDLINK_TREE+= -upower

sysutils/upower/distinfo

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
$NetBSD: distinfo,v 1.10 2021/10/26 11:20:20 nia Exp $
1+
$NetBSD: distinfo,v 1.11 2025/05/04 05:55:49 vins Exp $
22

3-
BLAKE2s (upower-0.99.13.tar.xz) = efbb4d9c07b6777757f22bd9a007185c4b5c15f2db30aa6c7479fb49c5b1a56d
4-
SHA512 (upower-0.99.13.tar.xz) = 5e72d3a67060e3053bc0753b5a2ab3b5fc5bc5e9d6e32165286c7d4c97d23441ef7c095af3af7a6f1f59841e63c1d46b2d90681abad22eb442047bd628d859d2
5-
Size (upower-0.99.13.tar.xz) = 448876 bytes
3+
BLAKE2s (upower-v1.90.9.tar.bz2) = 6dc6fa5fb37914fb9c66059b8da90272d02c106a6a7fbca19a03691906ceb961
4+
SHA512 (upower-v1.90.9.tar.bz2) = 7308e03125a5a888242253f9260f68283f5b53677c08dbc4d7e4d48cc6f600f50f8ab161d100f152138208d5119acddc90f0f19742aa8cca58e3a0ec54975110
5+
Size (upower-v1.90.9.tar.bz2) = 154756 bytes
6+
SHA1 (patch-etc_meson.build) = 45108a898e21f4107bf3e994f63a9ca46e49d571
7+
SHA1 (patch-meson__options.txt) = b99b5ef65c1b6f317425f1c46dc0063768b5f83c
8+
SHA1 (patch-src_meson.build) = 9e403a60db0acc78a8d5d6ebf267a88b8118045f

sysutils/upower/options.mk

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# $NetBSD: options.mk,v 1.4 2025/05/04 05:55:49 vins Exp $
2+
3+
PKG_OPTIONS_VAR= PKG_OPTIONS.upower
4+
5+
PKG_SUPPORTED_OPTIONS+= introspection polkit
6+
PKG_SUGGESTED_OPTIONS= introspection polkit
7+
8+
PLIST_VARS+= introspection polkit
9+
10+
.include "../../mk/bsd.options.mk"
11+
12+
###
13+
### Build GObject Introspection data
14+
###
15+
.if !empty(PKG_OPTIONS:Mintrospection)
16+
BUILDLINK_DEPMETHOD.gobject-introspection+= build
17+
.include "../../devel/gobject-introspection/buildlink3.mk"
18+
MESON_ARGS+= -Dintrospection=enabled
19+
PLIST.introspection= yes
20+
.else
21+
MESON_ARGS+= -Dintrospection=disabled
22+
.endif
23+
24+
###
25+
### Polkit support in UPower Daemon
26+
###
27+
.if !empty(PKG_OPTIONS:Mpolkit)
28+
. include "../../security/polkit/buildlink3.mk"
29+
MESON_ARGS+= -Dpolkit=enabled
30+
PLIST.polkit= yes
31+
.else
32+
MESON_ARGS+= -Dpolkit=disabled
33+
.endif
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
$NetBSD: patch-etc_meson.build,v 1.1 2025/05/04 05:55:49 vins Exp $
2+
3+
Install to EGDIR.
4+
5+
--- etc/meson.build.orig 2025-05-03 17:01:48.903892228 +0000
6+
+++ etc/meson.build
7+
@@ -1 +1 @@
8+
-install_data('UPower.conf', install_dir: get_option('sysconfdir') / 'UPower')
9+
+install_data('UPower.conf', install_dir: get_option('egdir'))
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
$NetBSD: patch-meson__options.txt,v 1.1 2025/05/04 05:55:49 vins Exp $
2+
3+
Support EGDIR.
4+
5+
--- meson_options.txt.orig 2025-05-03 17:11:16.376958008 +0000
6+
+++ meson_options.txt
7+
@@ -27,6 +27,9 @@ option('statedir',
8+
option('systemdsystemunitdir',
9+
type : 'string',
10+
description : 'Directory for systemd service files ("no" to disable)')
11+
+option('egdir',
12+
+ type : 'string',
13+
+ description : 'Directory for upower sample configuration files')
14+
option('os_backend',
15+
type : 'combo',
16+
choices : [ 'auto', 'linux', 'freebsd', 'openbsd', 'dummy'],
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
$NetBSD: patch-src_meson.build,v 1.1 2025/05/04 05:55:49 vins Exp $
2+
3+
Install to EGDIR.
4+
5+
--- src/meson.build.orig 2025-05-03 17:09:05.336647531 +0000
6+
+++ src/meson.build
7+
@@ -100,7 +100,7 @@ configure_file(
8+
configure_file(
9+
input: 'org.freedesktop.UPower.conf.in',
10+
output: 'org.freedesktop.UPower.conf',
11+
- install_dir: dbusdir / 'system.d',
12+
+ install_dir: get_option('egdir'),
13+
configuration: cdata,
14+
)
15+

0 commit comments

Comments
 (0)