summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichele Noberasco <s4t4n@gentoo.org>2012-10-18 14:15:51 +0000
committerMichele Noberasco <s4t4n@gentoo.org>2012-10-18 14:15:51 +0000
commit70cc380906f5701b31a524819cb636eeb60df15e (patch)
tree98dfe6fc308fc91237b4b011e04de316605a0c51 /x11-plugins
parentMarked ~hppa too. (diff)
downloadhistorical-70cc380906f5701b31a524819cb636eeb60df15e.tar.gz
historical-70cc380906f5701b31a524819cb636eeb60df15e.tar.bz2
historical-70cc380906f5701b31a524819cb636eeb60df15e.zip
Revision bump. Closes bug #372417.
Package-Manager: portage-2.1.10.49/cvs/Linux x86_64
Diffstat (limited to 'x11-plugins')
-rw-r--r--x11-plugins/wmacpiload-ac/ChangeLog9
-rw-r--r--x11-plugins/wmacpiload-ac/Manifest12
-rw-r--r--x11-plugins/wmacpiload-ac/files/wmacpiload-ac-acpi-fix-battery-unit.patch30
-rw-r--r--x11-plugins/wmacpiload-ac/files/wmacpiload-ac-acpi-segfault.patch22
-rw-r--r--x11-plugins/wmacpiload-ac/files/wmacpiload-ac-acpi-sys-temp-hwmon.patch121
-rw-r--r--x11-plugins/wmacpiload-ac/wmacpiload-ac-0.2.0-r1.ebuild46
6 files changed, 234 insertions, 6 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/Manifest b/x11-plugins/wmacpiload-ac/Manifest
index 8b510aed0f62..8b0b53e51a52 100644
--- a/x11-plugins/wmacpiload-ac/Manifest
+++ b/x11-plugins/wmacpiload-ac/Manifest
@@ -1,4 +1,8 @@
-DIST wmacpiload-0.2.0.tar.bz2 112858 RMD160 071abd43cc603dc4e9a19b95eed3240b1cf2fb44 SHA1 e80f9204acb9ca073027268d31f1d48f4d188d8e SHA256 c160db05fb968ec4d0f239ed7e35188de5ddce4e5a6ffcd3e3c496c279cd8808
-EBUILD wmacpiload-ac-0.2.0.ebuild 871 RMD160 2eebea7e675684a74c3b3147a39225f118d118db SHA1 48cc567701b2bb0ca71d79117b986f2c9bd5098e SHA256 787d36b14bd6161ff0b413917176ec3fa631d72663eb0d391ad43fe81d677e09
-MISC ChangeLog 1330 RMD160 f7dabea7a03f48fe1efebdbfbbe384f6a93ff4e4 SHA1 a4316894ec5ad91b08b7c8e22c406fe6e85788f8 SHA256 36b9dec75fdd262d7cbaf9d5448bcc2dc9571b76a7a5b501d84e7cfbd217d382
-MISC metadata.xml 165 RMD160 a554e96dc33b1fb4b3518f27a21bf3f59dc21b1c SHA1 674655a4f0fc35c7b3b2e05aab1910c0ebafade1 SHA256 c2f8a0b30c83dba56f0c36a4ba1cb002621ae58dfc13fae94b9db6eb67fb9f1b
+AUX wmacpiload-ac-acpi-fix-battery-unit.patch 1270 SHA256 cf286ff627e90ccbb23dbc65e7078509050de95d12e18ff4ce77cb457c104077 SHA512 46d5ab6cea2b7dd85bcec20ecf5f917f9025ae2c06f578c677c9defd1a8da3cc970f8158aacc87631d2f96b2c1017bc8c8d88271792200e809fd8623d24981f6 WHIRLPOOL d23e6849b935d9ebcf195dd3180e75556a51a17c5a87df8379db3b6e2cd785e28ab51b5fa205e1ee6dff4ace8a838d2580fcddb282a1b15bc523846b1463fbd2
+AUX wmacpiload-ac-acpi-segfault.patch 805 SHA256 c71226b455716edec0f74dc37c879b60282b8e46d671bcdd580297a0f252c94a SHA512 9903f06b95e0a372c980d9ca649fa5c11a47ffce709e98e03507303234fd8111cb0bd1e1204b69af332cfe0bb5293a6f758a7a593cc72244ee37547b579735d1 WHIRLPOOL 66f4365f1c1d63eb47bcda9aad4690f9a400b761e3dbc6788ac6e0f555196e0698afd23d7a77b4b701d4ad3b09caa59abf9feecb8577b758d10280b81305ce38
+AUX wmacpiload-ac-acpi-sys-temp-hwmon.patch 4320 SHA256 b77496aff08ed54a325a7a45de7363cd5a83f4667a6a9dbeb3f313b805db98c8 SHA512 fd7a08c6d7473c48c98d741827d33d6ccef592936379323d0c54ec588dde16b7131f2c6517ddac38e61350a122227818a51d4bf68da1121b71915d4bdb3c4467 WHIRLPOOL 7bb1d43770a82193b93a9184e98b2e3b00d3a09a2cb7bc4478a7e382799873472127e42dc0f05bfa1295af42f890f20305eaef477ec9a891c1f00f0556ad0c3d
+DIST wmacpiload-0.2.0.tar.bz2 112858 SHA256 c160db05fb968ec4d0f239ed7e35188de5ddce4e5a6ffcd3e3c496c279cd8808 SHA512 f0256ae313ad4ecbaf1604578321b45173912f250ba6fb7abf88edbcf6875dee30f8d2f7547cc207768c9229697dbfd48e77617c590e0ca27113b8c675e32714 WHIRLPOOL 83c2672eb6ef3610228a9d73fe9cb8652ec6278beb2d349eb59448d557563f0fbfadd129667759eeff384873707b18d254536ec0846dd807b55e286fa5c8b29c
+EBUILD wmacpiload-ac-0.2.0-r1.ebuild 1168 SHA256 7aa963707f689d3a57ed868c594666335c5f052a9fad0107363627ca385953d2 SHA512 fc30b9072f964fd0bdcf5667a77f84abf56ed8c4f83a3483a9248a7d06497a61fde9b4e2511ec23ead494e725b0e4f9d647f77a1bcba884b3d7084af4850380d WHIRLPOOL 3b2d1124f02eb22ccc713bbc9eb73efe5ce5e6a24fed1ba7d9280021053f99ecd5c6988947bd2e18b1e0dd78c1433e57eb05401e54be0f44aa280e32ccb8c93d
+EBUILD wmacpiload-ac-0.2.0.ebuild 871 SHA256 787d36b14bd6161ff0b413917176ec3fa631d72663eb0d391ad43fe81d677e09 SHA512 778d6e6dd57b2e346f5c9d19b6986bd6eca0b0bae941e69bb45368a443ac028f2af39ebccb858494b157c8ba0b097b74d48d73089ab00503285e6d1bb463fa10 WHIRLPOOL 62be3d71cca145aeed1ef46e98a390fbe914241a00e065c647e9750650cf344afe0c2affcc7f8fbac31613445475f81b51d92aba6541682762efd33c9f2b57bc
+MISC ChangeLog 1490 SHA256 7001414ce4a51177d5f6926bc00076654dce7c631317d878dbe339055a32f306 SHA512 befaaa079b6eb513cc9acba87bd99467fc8315feb4808306e8253dfa4d19b07133430db83fd68e5fcb0852f773f0a08c0beeb0b298708b8dfa489c8e3cbe180d WHIRLPOOL 65e916a6a3fc3ec0928c67b69e47ece87478779f7980dcfeab548cf2a8548421746883224bfc81cf15f3ea88e6b263e8142233f5f712e99351431cfa9b844b31
+MISC metadata.xml 165 SHA256 c2f8a0b30c83dba56f0c36a4ba1cb002621ae58dfc13fae94b9db6eb67fb9f1b SHA512 dd0c867c49224060269f229cdd6cfe3c2b8a1f9ebb94d26605878d5b050d10cedb229a64ffd4c13e5c119bce3e236b14f5a9f6dac36a6ace50965f0887e5362a WHIRLPOOL 5f4139a044e2f8bc197f5d21ee51f21b8a5131b2eb145d88bda1dc3b04cf7d21ed89da77dc9b43496071d8098d5eee2b19da0fbc810ac15d379cec0420d99950
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
+}