pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/sysutils/mate-power-manager 2 Fixes for NetBSD, OpenBS...
details: https://anonhg.NetBSD.org/pkgsrc/rev/039feee8268e
branches: trunk
changeset: 390461:039feee8268e
user: youri <youri%pkgsrc.org@localhost>
date: Mon Jan 21 13:12:32 2019 +0000
description:
2 Fixes for NetBSD, OpenBSD, FreeBSD:
- Add cpu times calculations
- Disable backlight handling, it is linux-only.
diffstat:
sysutils/mate-power-manager/Makefile | 3 +-
sysutils/mate-power-manager/distinfo | 4 +-
sysutils/mate-power-manager/patches/patch-src_gpm-backlight-helper.c | 16 ++++
sysutils/mate-power-manager/patches/patch-src_gpm-load.c | 40 ++++++++++
4 files changed, 61 insertions(+), 2 deletions(-)
diffs (91 lines):
diff -r 940ae047e3ef -r 039feee8268e sysutils/mate-power-manager/Makefile
--- a/sysutils/mate-power-manager/Makefile Mon Jan 21 13:03:56 2019 +0000
+++ b/sysutils/mate-power-manager/Makefile Mon Jan 21 13:12:32 2019 +0000
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.13 2019/01/16 18:09:52 youri Exp $
+# $NetBSD: Makefile,v 1.14 2019/01/21 13:12:32 youri Exp $
.include "../../meta-pkgs/mate/Makefile.common"
DISTNAME= mate-power-manager-${VERSION:R}.1
+PKGREVISION= 1
CATEGORIES= sysutils
COMMENT= Power manager for MATE
diff -r 940ae047e3ef -r 039feee8268e sysutils/mate-power-manager/distinfo
--- a/sysutils/mate-power-manager/distinfo Mon Jan 21 13:03:56 2019 +0000
+++ b/sysutils/mate-power-manager/distinfo Mon Jan 21 13:12:32 2019 +0000
@@ -1,6 +1,8 @@
-$NetBSD: distinfo,v 1.4 2019/01/16 18:09:52 youri Exp $
+$NetBSD: distinfo,v 1.5 2019/01/21 13:12:32 youri Exp $
SHA1 (mate-power-manager-1.21.1.tar.xz) = e6094ab906de5dbde508359705e92f859537f0f5
RMD160 (mate-power-manager-1.21.1.tar.xz) = 91aa1d44262affcc039c90074f7b41c1eb405ebf
SHA512 (mate-power-manager-1.21.1.tar.xz) = e7a63e5693f70f233b44983261837b5224c956720340ad70f500fef44e7f9fdb15c1a183bc23a2f28d0f423c2163c23178d346c2ac5d0ac46fdbcc2b334721ae
Size (mate-power-manager-1.21.1.tar.xz) = 3214980 bytes
+SHA1 (patch-src_gpm-backlight-helper.c) = 01c6549805efa557ec6a219c99bf2b6fb77d6fb8
+SHA1 (patch-src_gpm-load.c) = 86b3189f77cf64f05631ddc72fd56acafadc1714
diff -r 940ae047e3ef -r 039feee8268e sysutils/mate-power-manager/patches/patch-src_gpm-backlight-helper.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/mate-power-manager/patches/patch-src_gpm-backlight-helper.c Mon Jan 21 13:12:32 2019 +0000
@@ -0,0 +1,16 @@
+$NetBSD: patch-src_gpm-backlight-helper.c,v 1.1 2019/01/21 13:12:32 youri Exp $
+
+Disable backlight helper for non linux.
+
+--- src/gpm-backlight-helper.c.orig 2018-01-29 14:50:11.000000000 +0000
++++ src/gpm-backlight-helper.c
+@@ -146,6 +146,9 @@ out:
+ gint
+ main (gint argc, gchar *argv[])
+ {
++#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
++ return GCM_BACKLIGHT_HELPER_EXIT_CODE_FAILED;
++#endif
+ GOptionContext *context;
+ gint uid;
+ gint euid;
diff -r 940ae047e3ef -r 039feee8268e sysutils/mate-power-manager/patches/patch-src_gpm-load.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/mate-power-manager/patches/patch-src_gpm-load.c Mon Jan 21 13:12:32 2019 +0000
@@ -0,0 +1,40 @@
+$NetBSD: patch-src_gpm-load.c,v 1.1 2019/01/21 13:12:32 youri Exp $
+
+Add cpu times calculations for *BSD.
+
+--- src/gpm-load.c.orig 2018-01-29 14:50:11.000000000 +0000
++++ src/gpm-load.c
+@@ -151,6 +151,33 @@ out:
+ return FALSE;
+ }
+
++#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
++
++/**
++ * gpm_load_get_cpu_values:
++ * @cpu_idle: The idle time reported by the CPU
++ * @cpu_total: The total time reported by the CPU
++ * Return value: Success of reading of the kern.cp_time sysctl.
++ **/
++static gboolean
++gpm_load_get_cpu_values (long unsigned *cpu_idle, long unsigned *cpu_total)
++{
++ long cpts[CPUSTATES];
++ size_t length;
++
++ length = sizeof (cpts);
++ if (sysctlbyname ("kern.cp_time", cpts, &length, NULL, 0)) {
++ return FALSE;
++ }
++
++ *cpu_idle = (unsigned long) cpts[CP_IDLE];
++ *cpu_total = (unsigned long) (cpts[CP_USER] + cpts[CP_NICE] + \
++ cpts[CP_SYS] + cpts[CP_IDLE] + cpts[CP_INTR]);
++
++ return TRUE;
++}
++
++
+ #else
+
+ /**
Home |
Main Index |
Thread Index |
Old Index