summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryouri <youri@pkgsrc.org>2019-01-21 13:12:32 +0000
committeryouri <youri@pkgsrc.org>2019-01-21 13:12:32 +0000
commitfed6412cf548c614d2984c31b7384d9ec6803aae (patch)
treed4dc322aa182fe2433192a03fa6cd8ab85572764
parent2a6f986eca88e597edc8dd37759bc3cfd556d67f (diff)
downloadpkgsrc-fed6412cf548c614d2984c31b7384d9ec6803aae.tar.gz
2 Fixes for NetBSD, OpenBSD, FreeBSD:
- Add cpu times calculations - Disable backlight handling, it is linux-only.
-rw-r--r--sysutils/mate-power-manager/Makefile3
-rw-r--r--sysutils/mate-power-manager/distinfo4
-rw-r--r--sysutils/mate-power-manager/patches/patch-src_gpm-backlight-helper.c16
-rw-r--r--sysutils/mate-power-manager/patches/patch-src_gpm-load.c40
4 files changed, 61 insertions, 2 deletions
diff --git a/sysutils/mate-power-manager/Makefile b/sysutils/mate-power-manager/Makefile
index 29c7686c516..079ffcb7c93 100644
--- a/sysutils/mate-power-manager/Makefile
+++ b/sysutils/mate-power-manager/Makefile
@@ -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 --git a/sysutils/mate-power-manager/distinfo b/sysutils/mate-power-manager/distinfo
index 55cb96d611c..8e86cb59468 100644
--- a/sysutils/mate-power-manager/distinfo
+++ b/sysutils/mate-power-manager/distinfo
@@ -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 --git a/sysutils/mate-power-manager/patches/patch-src_gpm-backlight-helper.c b/sysutils/mate-power-manager/patches/patch-src_gpm-backlight-helper.c
new file mode 100644
index 00000000000..9a540a17bc3
--- /dev/null
+++ b/sysutils/mate-power-manager/patches/patch-src_gpm-backlight-helper.c
@@ -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 --git a/sysutils/mate-power-manager/patches/patch-src_gpm-load.c b/sysutils/mate-power-manager/patches/patch-src_gpm-load.c
new file mode 100644
index 00000000000..b8f21040729
--- /dev/null
+++ b/sysutils/mate-power-manager/patches/patch-src_gpm-load.c
@@ -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
+
+ /**