diff options
author | Samuli Suominen <ssuominen@gentoo.org> | 2011-03-20 15:36:36 +0000 |
---|---|---|
committer | Samuli Suominen <ssuominen@gentoo.org> | 2011-03-20 15:36:36 +0000 |
commit | 04120c36e537f33b5f48b552845f738b69b130fc (patch) | |
tree | 40006f31e309973ccc3311af9b7d3a718e766de6 /xfce-extra | |
parent | app-laptop/ibam: Revbump to 0.5.2-r2. Fixes bug #346811. (diff) | |
download | gentoo-2-04120c36e537f33b5f48b552845f738b69b130fc.tar.gz gentoo-2-04120c36e537f33b5f48b552845f738b69b130fc.tar.bz2 gentoo-2-04120c36e537f33b5f48b552845f738b69b130fc.zip |
Upstream patch for getting temperature from sysfs wrt #356385 by Pavel Goran.
(Portage version: 2.2.0_alpha28/cvs/Linux x86_64)
Diffstat (limited to 'xfce-extra')
3 files changed, 107 insertions, 1 deletions
diff --git a/xfce-extra/xfce4-battery-plugin/ChangeLog b/xfce-extra/xfce4-battery-plugin/ChangeLog index a9e661417387..d79ec39c4e64 100644 --- a/xfce-extra/xfce4-battery-plugin/ChangeLog +++ b/xfce-extra/xfce4-battery-plugin/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for xfce-extra/xfce4-battery-plugin # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/xfce-extra/xfce4-battery-plugin/ChangeLog,v 1.3 2011/03/13 16:28:01 hwoarang Exp $ +# $Header: /var/cvsroot/gentoo-x86/xfce-extra/xfce4-battery-plugin/ChangeLog,v 1.4 2011/03/20 15:36:36 ssuominen Exp $ + +*xfce4-battery-plugin-1.0.0-r1 (20 Mar 2011) + + 20 Mar 2011; Samuli Suominen <ssuominen@gentoo.org> + +xfce4-battery-plugin-1.0.0-r1.ebuild, + +files/xfce4-battery-plugin-1.0.0-sysfs.patch: + Upstream patch for getting temperature from sysfs wrt #356385 by Pavel Goran. 13 Mar 2011; Markos Chandras <hwoarang@gentoo.org> xfce4-battery-plugin-1.0.0.ebuild: diff --git a/xfce-extra/xfce4-battery-plugin/files/xfce4-battery-plugin-1.0.0-sysfs.patch b/xfce-extra/xfce4-battery-plugin/files/xfce4-battery-plugin-1.0.0-sysfs.patch new file mode 100644 index 000000000000..d20680ed8d90 --- /dev/null +++ b/xfce-extra/xfce4-battery-plugin/files/xfce4-battery-plugin-1.0.0-sysfs.patch @@ -0,0 +1,66 @@ +From e33899de3205edfc0b2c330f43da6a4bc8141b85 Mon Sep 17 00:00:00 2001 +From: Florian Rivoal <frivoal@xfce.org> +Date: Sat, 26 Feb 2011 13:53:09 +0000 +Subject: Add support for getting the temperature from sysfs + +Up to the linux kernel version 2.6.37, this information was available in +the proc file system, but after that, it is only available from the sys +file system. + +This fixes bug #7339. +--- +diff --git a/panel-plugin/libacpi.c b/panel-plugin/libacpi.c +index 838a760..0e368f4 100644 +--- a/panel-plugin/libacpi.c ++++ b/panel-plugin/libacpi.c +@@ -1002,18 +1002,36 @@ const char *get_temperature(void) + #ifdef __linux__ + FILE *fp; + char *proc_temperature="/proc/acpi/thermal_zone/*/temperature"; +- static char *p,line[256]; +- +- if ( (fp=fopen_glob(proc_temperature, "r")) == NULL) return NULL; +- fgets(line,255,fp); +- fclose(fp); +- p=strtok(line," "); +- if (!p) return NULL; +- p=p+strlen(p)+1; +- while (p && *p ==' ') p++; +- if (*p==0) return NULL; +- if (strchr(p,'\n')) p=strtok(p,"\n"); +- return (const char *)p; ++ char *sys_temperature="/sys/class/thermal/thermal_zone*/temp"; ++ static char *p,*p2,line[256]; ++ ++ if ( (fp=fopen_glob(proc_temperature, "r")) != NULL ) ++ { ++ fgets(line,255,fp); ++ fclose(fp); ++ p=strtok(line," "); ++ if (!p) return NULL; ++ p=p+strlen(p)+1; ++ while (p && *p ==' ') p++; ++ if (*p==0) return NULL; ++ if (strchr(p,'\n')) p=strtok(p,"\n"); ++ return (const char *)p; ++ } ++ else if ( (fp=fopen_glob(sys_temperature, "r")) != NULL ) ++ { ++ fgets(line,255,fp); ++ fclose(fp); ++ p = line; ++ if (strchr(p,'\n')) *strchr(p,'\n') = 0; ++ if (strlen(p) <= 3) return NULL; ++ p2 = p + strlen(p) - 3; ++ strcpy(p2, " C"); ++ return (const char *)p; ++ } ++ else ++ { ++ return NULL; ++ } + #else + #ifdef HAVE_SYSCTL + static char buf[BUFSIZ]; +-- +cgit v0.8.3.4 diff --git a/xfce-extra/xfce4-battery-plugin/xfce4-battery-plugin-1.0.0-r1.ebuild b/xfce-extra/xfce4-battery-plugin/xfce4-battery-plugin-1.0.0-r1.ebuild new file mode 100644 index 000000000000..32049886db2d --- /dev/null +++ b/xfce-extra/xfce4-battery-plugin/xfce4-battery-plugin-1.0.0-r1.ebuild @@ -0,0 +1,33 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/xfce-extra/xfce4-battery-plugin/xfce4-battery-plugin-1.0.0-r1.ebuild,v 1.1 2011/03/20 15:36:36 ssuominen Exp $ + +EAPI=3 +inherit xfconf + +DESCRIPTION="A battery monitor panel plugin for the Xfce desktop environment" +HOMEPAGE="http://goodies.xfce.org/projects/panel-plugins/xfce4-battery-plugin" +SRC_URI="mirror://xfce/src/panel-plugins/${PN}/1.0/${P}.tar.bz2" + +LICENSE="GPL-2 LGPL-2" +SLOT="0" +KEYWORDS="~amd64 ~arm ~ppc ~x86" +IUSE="debug" + +RDEPEND=">=x11-libs/gtk+-2.6:2 + >=xfce-base/xfce4-panel-4.3.90.2 + >=xfce-base/libxfce4util-4.3.90.2 + >=xfce-base/libxfcegui4-4.3.90.2" +DEPEND="${RDEPEND} + dev-util/pkgconfig + dev-util/intltool" + +pkg_setup() { + PATCHES=( "${FILESDIR}"/${P}-sysfs.patch ) + XFCONF=( + --disable-dependency-tracking + $(xfconf_use_debug) + ) + + DOCS="AUTHORS ChangeLog NEWS README" +} |