git: 639d431057fd - main - sysutils/upower: update to 1.90.0

From: Guido Falsi <madpilot_at_FreeBSD.org>
Date: Sun, 28 Aug 2022 19:18:12 UTC
The branch main has been updated by madpilot:

URL: https://cgit.FreeBSD.org/ports/commit/?id=639d431057fdb37f6557832900080e0efe999d09

commit 639d431057fdb37f6557832900080e0efe999d09
Author:     Olivier Duchateau <duchateau.olivier@gmail.com>
AuthorDate: 2022-08-28 19:16:45 +0000
Commit:     Guido Falsi <madpilot@FreeBSD.org>
CommitDate: 2022-08-28 19:16:45 +0000

    sysutils/upower: update to 1.90.0
    
    - Update to 1.90.0
    - Fix warnings (suggested by clang) in src/up-device-battery.c
    
    PR:             266070
---
 sysutils/upower/Makefile                           |  2 +-
 sysutils/upower/distinfo                           |  6 ++---
 .../upower/files/patch-src_up-device-battery.c     | 28 ++++++++++++++++++++++
 3 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/sysutils/upower/Makefile b/sysutils/upower/Makefile
index 6d6cdd3f1723..f8524e4bced6 100644
--- a/sysutils/upower/Makefile
+++ b/sysutils/upower/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	upower
-PORTVERSION=	0.99.20
+PORTVERSION=	1.90.0
 DISTVERSIONPREFIX=	v
 CATEGORIES=	sysutils
 MASTER_SITES=	https://gitlab.freedesktop.org/upower/upower/-/archive/${DISTVERSIONFULL}/
diff --git a/sysutils/upower/distinfo b/sysutils/upower/distinfo
index b81b37f68ac3..f0fd8b527289 100644
--- a/sysutils/upower/distinfo
+++ b/sysutils/upower/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1657781987
-SHA256 (upower-v0.99.20.tar.bz2) = 6b11baeb4e9273def260ca86f2ed482ab4e56e8f4e999b2632d6ba0ea2bccd9a
-SIZE (upower-v0.99.20.tar.bz2) = 126098
+TIMESTAMP = 1661608460
+SHA256 (upower-v1.90.0.tar.bz2) = eafa0a367dc0417390984eeb81e9d1a2b449999ba6ad20ed39bf270d0b4e5e77
+SIZE (upower-v1.90.0.tar.bz2) = 129505
diff --git a/sysutils/upower/files/patch-src_up-device-battery.c b/sysutils/upower/files/patch-src_up-device-battery.c
new file mode 100644
index 000000000000..d6a2f2579b44
--- /dev/null
+++ b/sysutils/upower/files/patch-src_up-device-battery.c
@@ -0,0 +1,28 @@
+--- src/up-device-battery.c.orig	2022-07-21 09:06:49 UTC
++++ src/up-device-battery.c
+@@ -19,6 +19,7 @@
+  */
+ 
+ #include <string.h>
++#include <math.h>
+ 
+ #include "up-constants.h"
+ #include "up-config.h"
+@@ -125,7 +126,7 @@ up_device_battery_estimate_power (UpDeviceBattery *sel
+ 			continue;
+ 
+ 		/* Stop searching if the new reference is further away from the long timeout. */
+-		if (abs(UP_DAEMON_LONG_TIMEOUT * G_USEC_PER_SEC - abs (td)) > abs(UP_DAEMON_SHORT_TIMEOUT * G_USEC_PER_SEC - ref_td))
++		if (labs(UP_DAEMON_LONG_TIMEOUT * G_USEC_PER_SEC - labs (td)) > labs(UP_DAEMON_SHORT_TIMEOUT * G_USEC_PER_SEC - ref_td))
+ 			break;
+ 
+ 		ref_td = td;
+@@ -155,7 +156,7 @@ up_device_battery_estimate_power (UpDeviceBattery *sel
+ 	 */
+ 	if (cur->state == UP_DEVICE_STATE_UNKNOWN) {
+ 		/* Consider a rate of 0.5W as "no change", otherwise set CHARGING/DISCHARGING */
+-		if (abs(energy_rate) < 0.5)
++		if (fabs(energy_rate) < 0.5)
+ 			return;
+ 		else if (energy_rate < 0.0)
+ 			cur->state = UP_DEVICE_STATE_DISCHARGING;