diff options
author | bouyer <bouyer@pkgsrc.org> | 2018-04-12 16:09:50 +0000 |
---|---|---|
committer | bouyer <bouyer@pkgsrc.org> | 2018-04-12 16:09:50 +0000 |
commit | 832a7d62b3860d7491b9c19cf9d668759ea4ab53 (patch) | |
tree | 17b3d8cc506fb533ae2e4699217ce89e56e0b88a | |
parent | 22d850e413e3857e6e82e51f6076cf66ad7be4be (diff) | |
download | pkgsrc-832a7d62b3860d7491b9c19cf9d668759ea4ab53.tar.gz |
Also est machdep.cpu.frequency, which is the sysctl's name on recent NetBSD
on arm.
While there also check that the frequency changed before updating the
gtk_label this makes the panel use much less CPU time.
OK khorben@
-rw-r--r-- | x11/deforaos-panel/Makefile | 4 | ||||
-rw-r--r-- | x11/deforaos-panel/distinfo | 3 | ||||
-rw-r--r-- | x11/deforaos-panel/patches/patch-src_applets_cpufreq.c | 42 |
3 files changed, 46 insertions, 3 deletions
diff --git a/x11/deforaos-panel/Makefile b/x11/deforaos-panel/Makefile index ef6553a7b5f..fec304617d6 100644 --- a/x11/deforaos-panel/Makefile +++ b/x11/deforaos-panel/Makefile @@ -1,9 +1,9 @@ -# $NetBSD: Makefile,v 1.29 2018/03/12 11:15:49 wiz Exp $ +# $NetBSD: Makefile,v 1.30 2018/04/12 16:09:50 bouyer Exp $ # DISTNAME= Panel-0.3.6 PKGNAME= deforaos-panel-0.3.6 -PKGREVISION= 5 +PKGREVISION= 6 CATEGORIES= x11 MASTER_SITES= https://www.defora.org/os/download/download/4417/ diff --git a/x11/deforaos-panel/distinfo b/x11/deforaos-panel/distinfo index 2e26f474c63..53f11cd6a99 100644 --- a/x11/deforaos-panel/distinfo +++ b/x11/deforaos-panel/distinfo @@ -1,6 +1,7 @@ -$NetBSD: distinfo,v 1.13 2016/02/20 00:46:55 khorben Exp $ +$NetBSD: distinfo,v 1.14 2018/04/12 16:09:50 bouyer Exp $ SHA1 (Panel-0.3.6.tar.gz) = a87f49c638a2d8df210c21bd684b3fbdc01a375a RMD160 (Panel-0.3.6.tar.gz) = 31a25b60c60b0198352b3fa2f26ee4f59418620d SHA512 (Panel-0.3.6.tar.gz) = cafdeb2e9127520dd65f1cef5e24dadac063146868517173771e8d44eb742687d9d79fa2738086008628c9cadfa39188cc0eb5624bd5efafbc00556e1b58c487 Size (Panel-0.3.6.tar.gz) = 146129 bytes +SHA1 (patch-src_applets_cpufreq.c) = 76b1fbd3ba6f72b0cd2cc0ef7ad324e98bb29cc3 diff --git a/x11/deforaos-panel/patches/patch-src_applets_cpufreq.c b/x11/deforaos-panel/patches/patch-src_applets_cpufreq.c new file mode 100644 index 00000000000..2476d46ce87 --- /dev/null +++ b/x11/deforaos-panel/patches/patch-src_applets_cpufreq.c @@ -0,0 +1,42 @@ +$NetBSD: patch-src_applets_cpufreq.c,v 1.1 2018/04/12 16:09:50 bouyer Exp $ +Fix systctl name on newer NetBSD +Avoid updating display when not needed. + +--- src/applets/cpufreq.c.orig 2016-01-12 02:32:16.000000000 +0100 ++++ src/applets/cpufreq.c 2018-04-10 19:27:01.584667727 +0200 +@@ -43,6 +43,7 @@ + int min; + int max; + int step; ++ int actual; + #if defined(__FreeBSD__) || defined(__NetBSD__) + char const * name; + #endif +@@ -101,6 +102,9 @@ + else if(sysctlbyname("machdep.frequency.available", &freq, &freqsize, + NULL, 0) == 0) + p = "machdep.frequency.current"; ++ else if(sysctlbyname("machdep.cpu.frequency.available", &freq, &freqsize, ++ NULL, 0) == 0) ++ p = "machdep.cpu.frequency.current"; + else + { + error_set("%s: %s", applet.name, _("No support detected")); +@@ -125,6 +129,7 @@ + gtk_box_pack_start(GTK_BOX(cpufreq->hbox), image, FALSE, TRUE, 0); + cpufreq->min = 0; + cpufreq->max = 0; ++ cpufreq->actual = 0; + cpufreq->step = 1; + cpufreq->name = p; + cpufreq->max = atoi(freq); +@@ -181,6 +186,9 @@ + helper->error(NULL, error_get(NULL), 1); + return TRUE; + } ++ if (freq == cpufreq->actual) ++ return TRUE; ++ cpufreq->actual = freq; + snprintf(buf, sizeof(buf), "%4u", (unsigned int)freq); + gtk_label_set_text(GTK_LABEL(cpufreq->label), buf); + # if GTK_CHECK_VERSION(2, 12, 0) |