diff options
author | Michele Noberasco <s4t4n@gentoo.org> | 2012-10-18 14:15:51 +0000 |
---|---|---|
committer | Michele Noberasco <s4t4n@gentoo.org> | 2012-10-18 14:15:51 +0000 |
commit | 5da137cfd79c048e111d7c20046c4874d6102f42 (patch) | |
tree | 604c6166cb1651517cf56dafd0ce72db634cb4e9 /x11-plugins | |
parent | Marked ~hppa too. (diff) | |
download | gentoo-2-5da137cfd79c048e111d7c20046c4874d6102f42.tar.gz gentoo-2-5da137cfd79c048e111d7c20046c4874d6102f42.tar.bz2 gentoo-2-5da137cfd79c048e111d7c20046c4874d6102f42.zip |
Revision bump. Closes bug #372417.
(Portage version: 2.1.10.49/cvs/Linux x86_64)
Diffstat (limited to 'x11-plugins')
5 files changed, 226 insertions, 2 deletions
diff --git a/x11-plugins/wmacpiload-ac/ChangeLog b/x11-plugins/wmacpiload-ac/ChangeLog index 5d87ad3de5c7..b1ebd1a47b24 100644 --- a/x11-plugins/wmacpiload-ac/ChangeLog +++ b/x11-plugins/wmacpiload-ac/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for x11-plugins/wmacpiload-ac -# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/x11-plugins/wmacpiload-ac/ChangeLog,v 1.9 2008/06/28 06:38:33 maekke Exp $ +# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/x11-plugins/wmacpiload-ac/ChangeLog,v 1.10 2012/10/18 14:15:51 s4t4n Exp $ + +*wmacpiload-ac-0.2.0-r1 (18 Oct 2012) + + 18 Oct 2012; Michele Noberasco <s4t4n@gentoo.org> wmacpiload-ac-0.2.0-r1.ebuild: + Revision bump. Closes bug #372417. 28 Jun 2008; Markus Meier <maekke@gentoo.org> wmacpiload-ac-0.2.0.ebuild: x86 stable, bug #229547 diff --git a/x11-plugins/wmacpiload-ac/files/wmacpiload-ac-acpi-fix-battery-unit.patch b/x11-plugins/wmacpiload-ac/files/wmacpiload-ac-acpi-fix-battery-unit.patch new file mode 100644 index 000000000000..6bf6179e7fc6 --- /dev/null +++ b/x11-plugins/wmacpiload-ac/files/wmacpiload-ac-acpi-fix-battery-unit.patch @@ -0,0 +1,30 @@ +--- wmacpiload-0.2.0/src/battery.c 2012-10-18 15:42:04.000000000 +0200 ++++ wmacpiload-0.2.0.new/src/battery.c 2012-10-18 15:43:33.000000000 +0200 +@@ -42,7 +42,8 @@ + ************************************************************************/ + + /* used to parse the battery state file */ +-#define CAPACITY_UNIT " mAh" ++#define CAPACITY_UNIT1 " mAh" ++#define CAPACITY_UNIT2 " mWh" + + /************************************************************************ + * Global constants definitions +@@ -164,7 +165,7 @@ + char *endptr; + + capacity = strtoul(buf, &endptr, 10); +- if (strcmp(endptr, CAPACITY_UNIT) != 0) { ++ if (strcmp(endptr, CAPACITY_UNIT1) != 0 && strcmp(endptr, CAPACITY_UNIT2) != 0) { + fprintf(stderr, + "%s : Battery %s unplugged or unconsistent data\n", + PACKAGE, bat->name); +@@ -238,7 +239,7 @@ + char *endptr; + + remain = strtol(buf, &endptr, 10); +- if (strcmp(endptr, CAPACITY_UNIT) == 0) ++ if (strcmp(endptr, CAPACITY_UNIT1) == 0 || strcmp(endptr, CAPACITY_UNIT2) == 0) + bat->percentage = (int) ((remain * 100.0) / bat->capacity); + else + bat->percentage = -1;
\ No newline at end of file diff --git a/x11-plugins/wmacpiload-ac/files/wmacpiload-ac-acpi-segfault.patch b/x11-plugins/wmacpiload-ac/files/wmacpiload-ac-acpi-segfault.patch new file mode 100644 index 000000000000..15f8e05579a2 --- /dev/null +++ b/x11-plugins/wmacpiload-ac/files/wmacpiload-ac-acpi-segfault.patch @@ -0,0 +1,22 @@ +diff -ru wmacpiload-0.2.0/include/lib_acpi.h wmacpiload-0.2.0.new//include/lib_acpi.h +--- wmacpiload-0.2.0/include/lib_acpi.h 2005-07-21 21:33:19.000000000 -0400 ++++ wmacpiload-0.2.0.new//include/lib_acpi.h 2011-06-20 19:53:30.458953984 -0400 +@@ -32,7 +32,7 @@ + * Macros + ************************************************************************/ + +-# define ACPIDEV "/proc/acpi/info" ++# define ACPIDEV "/proc/acpi/battery" + + /* use ? */ + # ifndef ACPI_32_BIT_SUPPORT +diff -ru wmacpiload-0.2.0/src/dockapp.c wmacpiload-0.2.0.new//src/dockapp.c +--- wmacpiload-0.2.0/src/dockapp.c 2005-08-16 18:38:36.000000000 -0400 ++++ wmacpiload-0.2.0.new//src/dockapp.c 2011-06-20 19:44:20.022684448 -0400 +@@ -431,5 +431,6 @@ + void + dockapp_cleanup(void) + { ++ if (display != NULL) + XCloseDisplay(display); + }
\ No newline at end of file diff --git a/x11-plugins/wmacpiload-ac/files/wmacpiload-ac-acpi-sys-temp-hwmon.patch b/x11-plugins/wmacpiload-ac/files/wmacpiload-ac-acpi-sys-temp-hwmon.patch new file mode 100644 index 000000000000..69857717daeb --- /dev/null +++ b/x11-plugins/wmacpiload-ac/files/wmacpiload-ac-acpi-sys-temp-hwmon.patch @@ -0,0 +1,121 @@ +diff -ru wmacpiload-0.2.0/src/lib_acpi.c wmacpiload-0.2.0.new//src/lib_acpi.c +--- wmacpiload-0.2.0/src/lib_acpi.c 2005-07-21 21:41:31.000000000 -0400 ++++ wmacpiload-0.2.0.new//src/lib_acpi.c 2011-06-28 23:37:50.148092904 -0400 +@@ -83,7 +83,7 @@ + if (!k->ac) + fprintf(stderr, "%s : no AC adapter detected\n", PACKAGE); + +- n = snprintf(dir, FILENAME_MAX + 1, "%s%s", "/proc/acpi", ++ n = snprintf(dir, FILENAME_MAX + 1, "%s%s", "/sys/class", + thermal_zone_dir); + if (n > FILENAME_MAX) { + fprintf(stderr, "%s : file name too long, " +@@ -322,10 +322,10 @@ + n = strlen(searched); + + if (dest != NULL && dest_size > 0 +- && n > 0 && n < (sizeof buffer) - 1 ++ && n < (sizeof buffer) - 1 + && file_name != NULL && (fd = fopen(file_name, "r")) != NULL) { + while (fgets(buffer, sizeof buffer, fd) != NULL) +- if (strncmp(buffer, searched, n) == 0) { ++ if (n == 0 || strncmp(buffer, searched, n) == 0) { + char *src; + char *end; + size_t len; +diff -ru wmacpiload-0.2.0/src/thermal.c wmacpiload-0.2.0.new//src/thermal.c +--- wmacpiload-0.2.0/src/thermal.c 2005-09-29 19:32:46.000000000 -0400 ++++ wmacpiload-0.2.0.new//src/thermal.c 2011-06-29 00:18:24.851904854 -0400 +@@ -30,12 +30,17 @@ + #endif + + #include <stdio.h> ++#include <errno.h> ++#include <limits.h> + #include <stdlib.h> + #include <string.h> + #include <dirent.h> + #include "lib_acpi.h" + #include "wmacpiload.h" + #include "thermal.h" ++#include <unistd.h> ++#include <sys/types.h> ++#include <sys/stat.h> + + /************************************************************************ + * Macro definitions +@@ -48,8 +53,10 @@ + * Global constants definitions + ************************************************************************/ + +-const char *const thermal_zone_dir = "/thermal_zone/"; +-const char *const thermal_zone_status_file = "/temperature"; ++const char *const thermal_zone_dir = "/hwmon/"; ++const char *const thermal_zone_status_file = "/temp1_input"; ++const char *const thermal_zone_search[] = { "", "/device" }; ++const int thermal_zone_MAX_SEARCH = 2; + + /************************************************************************ + * Function definitions +@@ -86,9 +93,24 @@ + } + strcpy(tz->name, fd->d_name); + +- tz->tempfile = +- strcat4("/proc/acpi", thermal_zone_dir, tz->name, +- thermal_zone_status_file); ++ int i; ++ for (i=0; i < thermal_zone_MAX_SEARCH ; i++) { ++ char device_name[MAXSTRLEN+1]; ++ char *tempfile; ++ struct stat tempstat; ++ snprintf(device_name, MAXSTRLEN, "%s%s", tz->name, thermal_zone_search[i]); ++ tempfile = ++ strcat4("/sys/class", thermal_zone_dir, device_name, ++ thermal_zone_status_file); ++ if (stat(tempfile, &tempstat) == -1) { ++ if (verbose) ++ printf("Unable to read thermal zone '%s'\n", tempfile); ++ } else { ++ tz->tempfile = tempfile; ++ break; ++ } ++ } ++ + if (!tz->tempfile) { + fprintf(stderr, "%s : could not allocate memory " + "for thermal zone tempfile concerning " +@@ -127,16 +149,19 @@ + + if (tz != NULL) { + if (parse_file(tz->tempfile, +- "temperature:", buf, sizeof buf) != NULL) { ++ "", buf, sizeof buf) != NULL) { + char *endptr; + + temp = strtoul(buf, &endptr, 10); + /* +- * The format is "temperature: xx C" where xx is the +- * temperature in celcius degrees. So we check if we have the +- * " C" left in the buffer to see if all went well. ++ * The format is "xxxxxx" where xx is the ++ * temperature in celcius degrees times 1000. + */ +- if (strcmp(endptr, TEMP_UNIT) != 0) { ++ errno = 0; ++ if ((errno == ERANGE && (temp == LONG_MAX || temp == LONG_MIN) ) || ++ (errno != 0 && temp == 0) || ++ endptr == buf) { ++ perror("strtol"); + fprintf(stderr, "%s : Unconsistent temperature " + "about thermal zone %s\n", PACKAGE, tz->name); + temp = 0; +@@ -144,7 +169,7 @@ + } else { + temp = 0; + } +- tz->temp = temp; ++ tz->temp = temp / 1000; + } + } +
\ No newline at end of file diff --git a/x11-plugins/wmacpiload-ac/wmacpiload-ac-0.2.0-r1.ebuild b/x11-plugins/wmacpiload-ac/wmacpiload-ac-0.2.0-r1.ebuild new file mode 100644 index 000000000000..2d3888e64eb6 --- /dev/null +++ b/x11-plugins/wmacpiload-ac/wmacpiload-ac-0.2.0-r1.ebuild @@ -0,0 +1,46 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/x11-plugins/wmacpiload-ac/wmacpiload-ac-0.2.0-r1.ebuild,v 1.1 2012/10/18 14:15:51 s4t4n Exp $ + +EAPI="2" + +inherit eutils + +MY_P=${P/-ac} +DESCRIPTION="Hacked version of WMACPILoad, a dockapp to monitor CPU temp and battery time on ACPI kernels." +HOMEPAGE="http://wmacpiload.tuxfamily.org/" +SRC_URI="http://wmacpiload.tuxfamily.org/download/${MY_P}.tar.bz2" + +SLOT="0" +LICENSE="GPL-2" +KEYWORDS="~amd64 ~x86" +IUSE="debug" + +RDEPEND="x11-libs/libX11 + x11-libs/libXt + x11-libs/libXext + x11-libs/libXpm" + +DEPEND="${RDEPEND} + x11-proto/xextproto" + +S="${WORKDIR}/${MY_P}" + +src_prepare() { + epatch "${FILESDIR}/${PN}-acpi-segfault.patch" || die "epatch failed" + epatch "${FILESDIR}/${PN}-acpi-sys-temp-hwmon.patch" || die "epatch failed" + epatch "${FILESDIR}/${PN}-acpi-fix-battery-unit.patch" || die "epatch failed" +} + +src_configure() { + econf $(use_enable debug) +} + +src_compile() { + emake || die "compile failed" +} + +src_install() { + emake DESTDIR="${D}" install || die "install failed" + dodoc AUTHORS ChangeLog NEWS README THANKS TODO +} |